/*
    Color Theme
    #331743
    #6C315E
    #AF5669
    #DC9182
    #FACCA4

*/

/* Subnav */
.subnav {
    width: 100%;
    min-height: 36px;
    height: auto;
    background: -moz-linear-gradient(top,  rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.55) 54%, rgba(255,255,255,0.6) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.5)), color-stop(54%,rgba(255,255,255,0.55)), color-stop(100%,rgba(255,255,255,0.6))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.55) 54%,rgba(255,255,255,0.6) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.55) 54%,rgba(255,255,255,0.6) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.55) 54%,rgba(255,255,255,0.6) 100%); /* IE10+ */
    background: linear-gradient(top,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.55) 54%,rgba(255,255,255,0.6) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80ffffff', endColorstr='#99ffffff',GradientType=0 ); /* IE6-9 */

    border: 1px solid rgba(255,255,255,0.2);
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    position: relative;
}
.subnav .nav {
    margin-bottom: 0;
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    position: relative;
}
.subnav .nav > li > p {
    margin: 0;
    padding: 11px 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(200,200,200,0.4);
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    line-height: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.subnav .nav > li > a {
    margin: 0;
    padding: 11px 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(200,200,200,0.4);
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    flex-shrink: 0;
}
.subnav .nav > .active > a,
.subnav .nav > .active > a:hover {
    padding-left: 13px;
    color: #777;
    background-color: #e9e9e9;
    border-right-color: #ddd;
    border-left: 0;
    -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
    -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
    box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
}
.subnav .nav > .active > a .caret,
.subnav .nav > .active > a:hover .caret {
    border-top-color: #777;
}
.subnav .dropdown-menu {
    -webkit-border-radius: 0 0 4px 4px;
    -moz-border-radius: 0 0 4px 4px;
    border-radius: 0 0 4px 4px;
    z-index: 1050;
    position: absolute;
}

.subnav .nav > li.dropdown {
    position: relative;
}

.subnav .nav > li.dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    margin-top: 1px;
}

/* Ensure dropdown appears above the overflow:hidden container */
.subnav .nav > li.dropdown.open .dropdown-menu {
    display: block;
    position: absolute;
    z-index: 1060;
}

.subnav-fixed {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    z-index: 1020; /* 10 less than .navbar-fixed to prevent any overlap */
    border-color: #d5d5d5;
    border-width: 0 0 1px; /* drop the border on the fixed edges */
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
    -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
    box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
    filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); /* IE6-9 */
}
.subnav-fixed .nav {
    width: 938px;
    margin: 0 auto;
    padding: 0 1px;
}
.subnav .nav > li:first-child > a,
.subnav .nav > li:first-child > a:hover {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}

.alert-info {
    background-color: rgba(217, 237, 247, 0.7);
    border-color: #bce8f1;
    color: #1a678d;
}

.hero-unit {
    background-color: rgba(245, 245, 245, 0.4);
    padding: 50px;
    padding-bottom: 30px;
}

.hero-unit h1 {
    font-size: 50px;
}

.hero-unit p {
    font-size: 16px;
}

.table {
    background-color: rgba(255, 255, 255, 0.0);
}

.calendar td {
    width: 14.3%;
    height: 80px;
}

.events {
    padding: 2px;
}

.well {
    background-color:  rgba(245, 245, 245, 0.6);
}

legend {
    margin-bottom: 0px;
}

hr {
    border-bottom-color: #ddd;
}

blockquote p {
    font-size: 13px;
}

.today {
    background-color: rgba(141, 192, 219, 0.15);
}

.previous {
    background-color: rgba(0, 0, 0, 0.05)
}

/* css for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }

th.month {
    text-align: center;
}

table th, table td {
    background: none repeat scroll 0 0 rgba(245, 245, 245, 0.4);
}

.subscription {
    margin: 0 auto;
    text-align: center;
    padding: 15px;
}

.amount {
    margin-top: 20px;
}

.pound {
    font-size:19px;
    position: relative;
    top: -18px;
}

.price {
    font-size: 49px;
    color: #331743;
}

.period {
    font-size: 17px;
    position: relative;
    top: -3px;
}

.subscription .type {
    margin-top: 15px;
    font-size: 20px;
    font-weight: bold;
}

.subscription-info {
    margin: 10px auto 0;
    text-align: center;
}

.route_map {
    text-align: center;
    padding: 20px 0px 0px;
    width: 80%;
}

.comment-formset {
    margin-bottom: 5px;
}

/* Mobile-first responsive improvements */
/* Desktop/Mobile Navigation Toggle */
.desktop-nav {
    display: block;
}

.mobile-nav {
    display: none;
}

@media (max-width: 979px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    /* Add proper spacing for fixed mobile navbar */
    body {
        padding-top: 60px;
    }
    
    /* Make subnav more responsive */
    .subnav .nav > li > p,
    .subnav .nav > li > a {
        white-space: normal;
        word-wrap: break-word;
        min-width: 0;
    }
    
    /* Make navbar responsive */
    .navbar-fixed-top .container {
        width: auto;
        padding: 0 15px;
        overflow: visible;
    }
    
    /* Reduce mobile navbar height and spacing */
    .mobile-nav .navbar-inner {
        min-height: 40px;
        padding: 5px 0;
        overflow: visible;
    }
    
    .mobile-nav .container {
        padding: 0 10px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        margin: 0;
    }
    
    .mobile-nav {
        width: 100%;
        max-width: 100vw;
        overflow: visible;
    }
    
    /* Show hamburger button */
    .btn-navbar {
        display: block !important;
        float: none !important;
        margin: 5px 0;
        background-color: #333;
        border: 1px solid #333;
        cursor: pointer;
        padding: 4px 6px;
        flex-shrink: 0;
        position: relative;
        right: 0;
    }
    
    .btn-navbar:hover {
        background-color: #444;
    }
    
    .btn-navbar .icon-bar {
        display: block;
        width: 18px;
        height: 2px;
        background-color: #fff;
        margin: 2px 0;
    }
    
    /* Mobile Navigation Toggle */
    .nav-collapse {
        display: none;
        width: 100%;
        clear: both;
        overflow: visible;
        background-color: transparent;
    }
    
    .nav-collapse.in {
        display: block !important;
        height: auto !important;
        overflow: visible;
        background-color: transparent;
    }
    
    .navbar .nav {
        width: 100%;
        clear: both;
        float: none;
        margin: 0;
        background-color: rgba(43, 43, 43, 0.95);
        border-radius: 4px;
        margin-top: 10px;
    }
    
    .navbar .nav > li {
        float: none;
        display: block;
        width: 100%;
        background: transparent;
    }
    
    .navbar .nav > li > a {
        border-radius: 0;
        margin: 0;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: #fff;
        background: transparent;
    }
    
    .navbar .nav > li > a:hover {
        background-color: rgba(255,255,255,0.1);
        color: #fff;
    }
    
    /* Hide divider-vertical on mobile as they cause spacing issues */
    .navbar .nav > li.divider-vertical,
    .navbar .nav > .divider-vertical {
        display: none !important;
    }
    
    /* Also hide any divider elements */
    .navbar .nav > li.divider,
    .navbar .nav > .divider {
        display: none !important;
    }
    
    .navbar .nav .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin: 0;
        background-color: rgba(60, 60, 60, 0.95);
        border: none;
        box-shadow: none;
        display: none;
        opacity: 1;
    }
    
    /* That's it! Bootstrap's .dropdown.open .dropdown-menu { display: block; } handles the rest */
    
    /* Mobile Navigation Menu Styles */
    .mobile-nav-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background-color: rgba(43, 43, 43, 0.95) !important;
        border-radius: 0 0 4px 4px !important;
        z-index: 1050 !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
        width: 100% !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    .mobile-nav-menu.open {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure mobile nav container has proper positioning context */
    .mobile-nav .navbar-inner {
        position: relative;
        overflow: visible;
    }
    
    .mobile-nav .container {
        position: relative;
        overflow: visible;
    }
    
    .mobile-nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-item:last-child {
        border-bottom: none;
    }
    
    .mobile-nav-item > a,
    .mobile-dropdown-toggle {
        display: block;
        padding: 12px 15px;
        color: #fff;
        text-decoration: none;
        background: transparent;
        border: none;
        width: 100%;
        text-align: left;
        font-size: 14px;
        cursor: pointer;
    }
    
    .mobile-nav-item > a:hover,
    .mobile-dropdown-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        text-decoration: none;
    }
    
    .mobile-nav-section-header {
        padding: 8px 15px;
        color: #999;
        font-weight: bold;
        font-size: 11px;
        text-transform: uppercase;
        background-color: rgba(60, 60, 60, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile Dropdown */
    .mobile-dropdown-menu {
        display: none;
        background-color: rgba(60, 60, 60, 0.95);
    }
    
    .mobile-dropdown.open .mobile-dropdown-menu {
        display: block;
    }
    
    .mobile-dropdown-menu a {
        display: block;
        padding: 10px 25px;
        color: #ccc;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 13px;
    }
    
    .mobile-dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        text-decoration: none;
    }
    
    .mobile-dropdown-menu a:last-child {
        border-bottom: none;
    }
    
    /* Mobile Search */
    .mobile-search {
        padding: 10px 15px;
        background: transparent;
    }
    
    .mobile-search .search-query {
        width: calc(100% - 4px);
        max-width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 8px 12px;
        font-size: 14px;
        color: #333;
        box-sizing: border-box;
        margin: 0;
    }
    
    /* Logout styling */
    .mobile-nav-item.logout {
        border-top: 2px solid rgba(255, 255, 255, 0.2);
        margin-top: 10px;
    }
    
    .mobile-nav-item.logout a {
        color: #ff6b6b;
        font-weight: bold;
    }
}

/* Make readonly form fields appear disabled */
select[readonly], input[readonly] {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

@media (max-width: 979px) {
    .navbar .nav .dropdown-menu::after,
    .navbar .nav .dropdown-menu::before {
        display: none;
    }
    
    /* Hide Calendar and Admin Panel links on mobile */
    .navbar .nav > li > a[href*="index"]:has(i.fa-calendar),
    .navbar .nav > li > a[href*="admin"]:has(i.fa-bar-chart-o) {
        display: none !important;
    }
    
    /* Alternative approach since :has might not be supported everywhere */
    .navbar .nav > li:has(> a[href*="index"] i.fa-calendar),
    .navbar .nav > li:has(> a[href*="admin"] i.fa-bar-chart-o) {
        display: none !important;
    }
    
    /* Fallback approach using attribute selectors */
    .navbar .nav > li > a i.fa-calendar,
    .navbar .nav > li > a i.fa-bar-chart-o {
        display: none !important;
    }
    
    .navbar .nav > li > a[href*="index"]:only-child,
    .navbar .nav > li > a[href*="admin"]:only-child {
        display: none !important;
    }
    
    /* Most reliable approach - hide parent li elements containing these specific links */
    .navbar .nav > li:nth-child(3), /* Calendar link position */
    .navbar .nav.pull-right > li:nth-child(4) /* Admin panel link position */ {
        display: none !important;
    }
    
    /* Style for mobile sections */
    .navbar .nav .mobile-section {
        /* Mobile sections will be styled same as regular nav items */
    }
    
    .navbar .nav .dropdown-menu li a {
        padding: 8px 25px;
        color: #ccc;
        background: transparent;
    }
    
    .navbar .nav .dropdown-menu li a:hover {
        background-color: rgba(255,255,255,0.1);
        color: #fff;
    }
    
    /* Make search box mobile friendly */
    .navbar .navbar-search {
        width: 100%;
        margin: 10px 15px;
        padding: 0;
    }
    
    .navbar .navbar-search .search-query {
        width: calc(100% - 30px);
        background-color: rgba(255,255,255,0.95);
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 12px 15px;
        font-size: 16px;
        color: #333;
        height: 44px;
        line-height: 20px;
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
    }
    
    .navbar .navbar-search .search-query:focus {
        background-color: #fff;
        border-color: #66afe9;
        outline: none;
        box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
    }
    
    .navbar .navbar-search .search-query::placeholder {
        color: #999;
        font-style: italic;
    }
}

@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 0 15px;
    }
    
    /* Hero unit adjustments */
    .hero-unit {
        padding: 30px 20px;
    }
    
    .hero-unit h1 {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .hero-unit p {
        font-size: 14px;
        margin-bottom: 18px;
    }
    
    /* Table responsiveness */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: -ms-autohiding-scrollbar;
        border: 1px solid #ddd;
        margin-bottom: 15px;
    }
    
    .table-responsive table {
        margin-bottom: 0;
        background-color: #fff;
    }
    
    /* Form improvements */
    .form-horizontal .control-label {
        float: none;
        width: auto;
        text-align: left;
        padding-top: 0;
    }
    
    .form-horizontal .controls {
        margin-left: 0;
    }
    
    /* Button improvements */
    .btn:not(.btn-navbar) {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
    
    /* Keep inline buttons for specific cases */
    .btn-group .btn,
    .form-actions .btn {
        display: inline-block;
        width: auto;
        margin-right: 5px;
    }
    
    /* Modal adjustments */
    .modal {
        width: auto;
        margin: 10px;
    }
    
    /* Logo adjustments */
    .pull-right img {
        max-width: 80px;
        height: auto;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    body {
        padding-top: 70px;
    }
    
    .hero-unit {
        padding: 20px 15px;
    }
    
    .hero-unit h1 {
        font-size: 28px;
    }
    
    /* Calendar adjustments */
    .calendar td {
        height: 60px;
        font-size: 12px;
    }
    
    /* Navigation adjustments for very small screens */
    .navbar-brand {
        font-size: 16px;
    }
    
    /* Subscription pricing adjustments */
    .price {
        font-size: 36px;
    }
    
    .pound {
        font-size: 14px;
    }
    
    .period {
        font-size: 14px;
    }
}

/* Desktop styles - hide hamburger on larger screens */
@media (min-width: 980px) {
    .btn-navbar {
        display: none !important;
    }
    
    .navbar .nav {
        display: block !important;
    }
    
    .nav-collapse {
        max-height: none !important;
        overflow: visible !important;
    }
}