:root {
            --primary-color: #0066cc;
            --secondary-color: #28a745;
            --danger-color: #dc3545;
            --warning-color: #ffc107;
            --light-bg: #f8f9fa;
            --border-color: #dee2e6;
        }
        
        /* Markham Light Green Theme */
        body.markham-theme {
            --primary-color: #6caf6c;
            --secondary-color: #4caf50;
        }
        
        body.markham-theme .navbar {
            background: linear-gradient(135deg, #6caf6c, #4caf50);
        }
        
        body.markham-theme .btn-primary {
            background-color: #6caf6c;
            border-color: #6caf6c;
        }
        
        body.markham-theme .btn-primary:hover {
            background-color: #5a9f5a;
            border-color: #5a9f5a;
        }
        
        body.markham-theme .btn-outline-primary {
            color: #6caf6c;
            border-color: #6caf6c;
        }
        
        body.markham-theme .btn-outline-primary:hover {
            background-color: #6caf6c;
            border-color: #6caf6c;
            color: white;
        }
        
        body.markham-theme .view-toggle .btn-primary {
            background-color: #6caf6c;
            border-color: #6caf6c;
        }
        
        body.markham-theme .description-title {
            color: #6caf6c;
        }
        
        body.markham-theme .calendar-day.has-events {
            background-color: #a5d6a7;
            border-color: #6caf6c;
        }
        
        body.markham-theme .calendar-day.has-events:hover {
            background-color: #81c784;
        }
        
        body.markham-theme .calendar-day.today {
            border-color: #6caf6c;
        }
        
        body.markham-theme .event-card {
            border-left-color: #6caf6c;
        }
        
        body.markham-theme .event-card:hover {
            box-shadow: 0 4px 12px rgba(108, 175, 108, 0.2);
        }
        
        body.markham-theme .badge.bg-primary {
            background-color: #6caf6c !important;
        }
        
        body.markham-theme .library-link {
            color: #6caf6c;
        }
        
        body.markham-theme .library-link:hover {
            color: #4caf50;
        }
        
        body.markham-theme .filter-group .filter-header {
            background-color: #e8f5e9;
            border-color: #6caf6c;
        }
        
        body.markham-theme .filter-group .filter-header:hover {
            background-color: #c8e6c9;
        }
        
        body.markham-theme .filter-group input[type="checkbox"]:checked + .filter-header {
            background-color: #6caf6c;
            color: white;
        }
        
        body.markham-theme .active-filter-badge {
            background-color: #6caf6c;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--light-bg);
            color: #333;
            overflow-x: hidden; /* Prevent horizontal scroll */
            -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        }
        
        * {
            box-sizing: border-box;
        }
        
        /* Prevent horizontal scroll on mobile */
        html, body {
            max-width: 100%;
            overflow-x: hidden;
        }
        
        .navbar {
            background: linear-gradient(135deg, var(--primary-color), #004d99);
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .navbar-brand {
            font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-weight: 700;
            font-size: clamp(1.2rem, 2.4vw, 1.6rem);
            line-height: 1.2;
            white-space: normal;
            max-width: min(360px, 75vw);
            text-align: center;
            display: block;
            margin: 0 auto;
            letter-spacing: 0.01em;
        }
        
        /* Welcome page specific overrides */
        body:has(.welcome-page) .navbar-brand,
        body:not(:has(.markham-theme)) .navbar-brand[style*="text-transform"] {
            white-space: nowrap !important;
            max-width: none !important;
            text-align: left !important;
            display: inline-flex !important;
            margin: 0 !important;
        }
        
        /* Mobile navbar improvements */
        @media (max-width: 991.98px) {
            .navbar-nav {
                margin-top: 1rem;
            }
            
            /* Hide status text on very small screens */
            .navbar-text {
                font-size: 0.85rem;
            }
        }
        
        @media (max-width: 575.98px) {
            .navbar-text {
                display: none; /* Hide status on very small screens to save space */
            }
            
            .navbar-brand {
                font-size: clamp(1rem, 5vw, 1.2rem);
                max-width: 100%;
                text-align: center;
            }
        }
        
        .main-container {
            margin-top: 2rem;
            padding: 0 1rem;
        }
        
        /* Description Section */
        .description-section {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 12px;
            padding: 2.5rem 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
        }
        
        .description-title {
            color: var(--primary-color);
            font-weight: 700;
            font-size: 2rem;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        
        .description-text {
            font-size: 1.1rem;
            line-height: 1.6;
            color: #555;
            margin-bottom: 2rem;
            text-align: center;
        }
        
        .description-features {
            margin-top: 2rem;
        }
        
        .feature-item {
            text-align: center;
            padding: 1.5rem 1rem;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border: 1px solid #e9ecef;
            transition: all 0.3s ease;
            height: 100%;
        }
        
        .feature-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        
        .feature-icon {
            font-size: 2.5rem;
            color: var(--primary-color);
            margin-bottom: 1rem;
        }
        
        .feature-item h4 {
            color: var(--primary-color);
            font-weight: 600;
            margin-bottom: 0.75rem;
            font-size: 1.2rem;
        }
        
        .feature-item p {
            color: #666;
            font-size: 0.95rem;
            line-height: 1.5;
            margin: 0;
        }
        
        /* Filter Section */
        .filter-section {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
        }
        
        .filter-title {
            color: var(--primary-color);
            font-weight: 600;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .form-control, .form-select {
            border-radius: 8px;
            border: 1px solid #ddd;
            padding: 0.75rem 1rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus, .form-select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
        }
        
        /* Multi-Select Filter Groups */
        .filter-group {
            width: 100%;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 14px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            background: white;
            margin-bottom: 1rem;
        }
        
        /* Header (click to toggle) */
        .filter-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            cursor: pointer;
            color: #0046be;
            font-weight: 600;
            border-bottom: 1px solid #e0e0e0;
            user-select: none;
        }
        
        .filter-header span {
            pointer-events: none;
        }
        
        /* Arrow icon */
        .filter-header::after {
            content: "▾";
            font-size: 12px;
            color: #555;
            transition: transform 0.2s ease;
        }
        
        /* Hide the native checkbox used for toggling the dropdown */
        .filter-toggle {
            display: none;
        }
        
        /* Dropdown list */
        .filter-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.2s ease-out;
            padding: 0 12px;
        }
        
        /* When toggle checked, show list */
        .filter-toggle:checked + label + .filter-body {
            max-height: 400px;
            overflow-y: auto;
            overflow-x: hidden;
            padding-bottom: 10px;
            padding-top: 5px;
        }
        
        /* Custom scrollbar styling for filter bodies */
        .filter-body::-webkit-scrollbar {
            width: 8px;
        }
        
        .filter-body::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }
        
        .filter-body::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 4px;
        }
        
        .filter-body::-webkit-scrollbar-thumb:hover {
            background: #555;
        }
        
        /* Change arrow direction when open */
        .filter-toggle:checked + label::after {
            content: "▴";
        }
        
        /* Each item */
        .filter-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
        }
        
        .filter-option label {
            display: flex;
            align-items: center;
            cursor: pointer;
            color: #111;
            width: 100%;
        }
        
        /* Checkbox styling */
        .filter-option input[type="checkbox"] {
            margin-right: 8px;
            cursor: pointer;
        }
        
        /* Count number */
        .filter-count {
            color: #777;
            font-size: 0.9em;
        }
        
        /* Active Filters Display */
        .active-filters-display {
            padding: 0.75rem 1rem;
            background-color: #f8f9fa;
            border-radius: 6px;
            border: 1px solid #e0e0e0;
            min-height: 40px;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        
        .active-filters-display .filter-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.5rem;
            background-color: var(--primary-color);
            color: white;
            border-radius: 4px;
            font-size: 0.85rem;
            gap: 0.25rem;
        }
        
        .active-filters-display .filter-badge .filter-label {
            font-weight: 600;
            margin-right: 0.25rem;
        }
        
        .active-filters-display .filter-badge .filter-value {
            opacity: 0.95;
        }
        
        .active-filters-display .filter-badge .filter-close {
            cursor: pointer;
            margin-left: 0.25rem;
            opacity: 0.8;
            transition: opacity 0.2s;
        }
        
        .active-filters-display .filter-badge .filter-close:hover {
            opacity: 1;
        }
        
        /* View Toggle */
        .view-toggle {
            background: white;
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
        }
        
        .view-toggle .btn-group {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        
        .view-toggle .btn-group .btn {
            border-radius: 8px !important;
            padding: 0.75rem 1.5rem;
            font-weight: 500;
            margin: 0 !important;
            border: 2px solid var(--primary-color);
            transition: all 0.3s ease;
        }
        
        .view-toggle .btn-group .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
        }
        
        .view-toggle .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        /* Calendar Navigation */
        .calendar-nav {
            background: white;
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .calendar-nav h2 {
            margin: 0;
            color: var(--primary-color);
            font-weight: 600;
        }
        
        .nav-buttons .btn {
            margin: 0 0.25rem;
            border-radius: 8px;
            padding: 0.5rem 1rem;
            font-weight: 500;
        }
        
        /* Map Filter Controls */
        .map-filter-controls {
            background: white;
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .map-filter-controls label {
            font-weight: 500;
            margin: 0;
            white-space: nowrap;
        }
        
        .map-filter-controls .form-control {
            width: 200px;
        }
        
        .map-filter-controls .btn {
            white-space: nowrap;
        }
        
        /* Current location button */
        .location-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 1000;
        }

        .location-btn {
            background: white;
            border: 2px solid #ccc;
            border-radius: 4px;
            padding: 5px;
            cursor: pointer;
            box-shadow: 0 1px 5px rgba(0,0,0,0.65);
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .location-btn:hover {
            background: #f4f4f4;
        }

        .location-btn.loading {
            color: #0066cc;
        }
        
        /* Calendar Grid Styles with Event Tiles */
        .calendar-container {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
            width: 100%;
            box-sizing: border-box;
            max-width: 100%;
        }
        
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 1px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            overflow: hidden;
            background: var(--border-color);
            width: 100%;
            box-sizing: border-box;
        }
        
        .calendar-day-header {
            background: var(--primary-color);
            color: white;
            padding: 1rem;
            text-align: center;
            font-weight: 600;
            font-size: 0.9rem;
        }
        
        .calendar-day {
            background: #fff;
            height: 120px;
            padding: 0.4rem;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        .calendar-day:hover {
            background: #f0f8ff;
            box-shadow: inset 0 0 0 2px var(--primary-color);
        }
        
        .calendar-day.other-month {
            background: #f8f9fa;
            color: #999;
        }
        
        .calendar-day.other-month:hover {
            background: #f0f0f0;
        }
        
        .calendar-day.today {
            background: #e3f2fd;
            border: 2px solid var(--primary-color);
            box-sizing: border-box;
        }
        
        .day-number {
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 0.3rem;
            color: #333;
            flex-shrink: 0;
        }
        
        .other-month .day-number {
            color: #999;
        }
        
        /* Event tiles in calendar */
        .events-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }
        
        .event-tile {
            background: var(--primary-color);
            color: white;
            font-size: 0.65rem;
            padding: 0.1rem 0.3rem;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.3s ease;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 1.2;
            display: block;
        }
        
        .event-tile:hover {
            background: #004d99;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        
        .more-events {
            background: #666;
            color: white;
            font-size: 0.6rem;
            padding: 0.1rem 0.3rem;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            font-style: italic;
        }
        
        .more-events:hover {
            background: #333;
            transform: translateY(-1px);
        }
        
        /* Day Events Modal */
        .day-events-modal .modal-dialog {
            max-width: 900px;
        }
        
        .day-events-modal .modal-content {
            border-radius: 12px;
            border: none;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        
        .day-events-modal .modal-header {
            background: var(--primary-color);
            color: white;
            border-radius: 12px 12px 0 0;
        }
        
        .day-event-card {
            border: 1px solid #e9ecef;
            border-radius: 8px;
            margin-bottom: 1rem;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        
        .day-event-card:hover {
            border-color: var(--primary-color);
            box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
            transform: translateY(-2px);
        }
        
        .day-event-card .card-header {
            background: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
            font-weight: 600;
            color: var(--primary-color);
        }
        
        .library-link {
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 500;
        }
        
        .library-link:hover {
            color: #004d99;
            text-decoration: underline;
        }
        
        /* Event Details Modal */
        .modal-header {
            background: var(--primary-color);
            color: white;
            border-radius: 12px 12px 0 0;
        }
        
        .modal-content {
            border-radius: 12px;
            border: none;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        
        .event-detail-item {
            padding: 0.75rem 0;
            border-bottom: 1px solid #eee;
        }
        
        .event-detail-item:last-child {
            border-bottom: none;
        }
        
        .event-detail-label {
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: 0.25rem;
        }
        
        /* Map Styles */
        .map-container {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
        }
        
        #map {
            height: 500px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            position: relative;
            touch-action: pan-x pan-y;
            -webkit-tap-highlight-color: transparent;
        }
        
        /* Leaflet map touch optimizations */
        .leaflet-container {
            touch-action: pan-x pan-y;
            -webkit-tap-highlight-color: transparent;
        }
        
        .leaflet-control {
            touch-action: manipulation;
        }
        
        .leaflet-control-zoom a {
            min-width: 44px;
            min-height: 44px;
            line-height: 44px;
            touch-action: manipulation;
        }
        
        .library-popup {
            width: clamp(220px, 40vw, 300px);
            max-width: 92vw;
            box-sizing: border-box;
        }
        
        .library-popup h3 {
            color: var(--primary-color);
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            word-wrap: break-word;
        }
        
        .popup-event {
            padding: 0.5rem;
            border: 1px solid #eee;
            border-radius: 4px;
            margin-bottom: 0.25rem;
            cursor: pointer;
            transition: background 0.3s ease;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
        }
        
        .popup-event:hover {
            background: #f8f9fa;
        }
        
        .popup-event:active {
            background: #e9ecef;
        }
        
        .popup-event a {
            text-decoration: none;
            color: inherit;
            display: block;
            touch-action: manipulation;
        }
        
        .popup-event small {
            display: block;
            margin-top: 0.25rem;
            touch-action: manipulation;
        }
        
        .popup-view-details-btn {
            background: none !important;
            border: none !important;
            color: #0066cc !important;
            padding: 0.5rem 0 !important;
            margin-top: 0.25rem !important;
            font-size: 0.85rem !important;
            cursor: pointer !important;
            text-decoration: underline !important;
            touch-action: manipulation !important;
            min-height: 32px !important;
            text-align: left !important;
            width: 100% !important;
            -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1) !important;
        }
        
        .popup-view-details-btn:active {
            color: #004d99 !important;
            background-color: rgba(0, 102, 204, 0.05) !important;
        }
        
        .event-list {
            max-height: 200px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }
        
        /* Leaflet popup mobile adjustments */
        .leaflet-popup-content-wrapper {
            border-radius: 8px;
            box-shadow: 0 3px 14px rgba(0,0,0,0.4);
            max-width: clamp(240px, 45vw, 340px);
            width: auto;
        }
        
        .leaflet-popup-content {
            margin: 13px 19px;
            line-height: 1.4;
        }
        
        .leaflet-popup-tip {
            box-shadow: 0 3px 14px rgba(0,0,0,0.4);
        }
        
        /* Popup wrapper for better mobile control */
        .library-popup-wrapper .leaflet-popup-content-wrapper {
            max-height: calc(100vh - 100px);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        .library-popup-wrapper .leaflet-popup-content {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            max-height: calc(100vh - 150px);
            margin: 0;
            padding: 13px 19px;
        }
        
        /* New Programs View Styles */
        .new-programs-header {
            background: white;
            border-radius: 14px;
            padding: 1.5rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            border: 1px solid var(--border-color);
        }
        
        .new-programs-header-top {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 1.25rem;
        }
        
        .new-programs-header h2 {
            font-size: clamp(1.4rem, 2vw, 1.75rem);
            font-weight: 700;
            color: var(--primary-color);
        }
        
        .new-programs-description {
            font-size: 0.95rem;
            color: #5f6b7a;
        }
        
        .new-programs-timeframe {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0.75rem;
            background: #f8fbff;
            border: 1px solid rgba(0,102,204,0.1);
            border-radius: 10px;
        }
        
        .new-programs-timeframe label {
            margin: 0;
            font-weight: 600;
            color: var(--primary-color);
            font-size: 0.9rem;
            white-space: nowrap;
        }
        
        .new-programs-timeframe .form-select {
            min-width: 140px;
        }
        
        .new-programs-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.25rem;
        }
        
        .new-program-card {
            background: white;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: 0 4px 18px rgba(11, 18, 33, 0.08);
            border: 1px solid rgba(0,0,0,0.05);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            min-height: 260px;
            touch-action: manipulation;
        }
        
        .new-program-card:hover,
        .new-program-card:focus-within {
            transform: translateY(-3px);
            box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
        }
        
        .new-program-card h4 {
            color: var(--primary-color);
            font-size: 1.1rem;
            font-weight: 700;
            margin: 0;
            line-height: 1.3;
        }
        
        .program-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 0.75rem;
        }
        
        .program-tag-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        
        .program-tag {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.65rem;
            border-radius: 999px;
            background: #f3f6fb;
            color: #3b4253;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .program-tag i {
            color: var(--primary-color);
        }
        
        .new-program-card .program-description {
            color: #4a5568;
            font-size: 0.95rem;
            line-height: 1.55;
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .program-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            flex-wrap: wrap;
        }
        
        .new-program-card .program-date {
            color: var(--secondary-color);
            font-weight: 600;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        
        .new-program-card .program-updated {
            color: #6c7688;
            font-size: 0.85rem;
            font-weight: 600;
            white-space: nowrap;
        }
        
        .program-updated-row {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: #6c7688;
            font-size: 0.85rem;
            font-weight: 600;
        }
        
        .program-updated--new {
            color: #0f9d58;
        }
        
        .program-card-btn {
            min-width: 140px;
            border-radius: 999px;
            font-weight: 600;
            padding: 0.55rem 1.25rem;
            flex-shrink: 0;
        }
        
        @media (max-width: 768px) {
            .new-programs-list {
                grid-template-columns: 1fr;
            }
            
            .new-programs-header-top {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .new-programs-timeframe {
                width: 100%;
                justify-content: space-between;
            }
            
            .new-programs-timeframe label {
                font-size: 0.85rem;
            }
        }
        
        /* Loading and Status */
        .loading {
            text-align: center;
            padding: 3rem;
            color: #666;
        }
        
        .loading i {
            font-size: 2rem;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .status-bar {
            background: white;
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border: 1px solid var(--border-color);
        }
        
        .status-item {
            display: inline-block;
            margin-right: 2rem;
            color: #666;
        }
        
        .status-item strong {
            color: var(--primary-color);
        }
        
        /* Mobile responsiveness - Enhanced */
        
        /* Touch-friendly minimum sizes */
        .btn, button, .form-control, .form-select, input, select {
            min-height: 44px; /* iOS recommended touch target */
            font-size: 16px; /* Prevents zoom on iOS */
        }
        
        /* Small phones (up to 576px) */
        @media (max-width: 575.98px) {
            .main-container {
                padding: 0 0.5rem;
                margin-top: 1rem;
            }
            
            .navbar-brand {
                font-size: 1.1rem;
            }
            
            .description-section {
                padding: 1.5rem 1rem;
            }
            
            .description-title {
                font-size: 1.5rem;
            }
            
            .description-text {
                font-size: 0.95rem;
            }
            
            .filter-section {
                padding: 1rem 0.75rem;
            }
            
            .filter-title {
                font-size: 1.1rem;
                padding: 0.75rem;
            }
            
            .filter-section .row > div {
                margin-bottom: 0.75rem;
            }
            
            .form-label {
                font-size: 0.9rem;
                margin-bottom: 0.25rem;
            }
            
            .view-toggle {
                padding: 0.75rem;
            }
            
            .view-toggle .btn-group {
                gap: 0.5rem;
            }
            
            .view-toggle .btn {
                padding: 0.6rem 1rem;
                font-size: 0.9rem;
            }
            
            .new-programs-header {
                padding: 1.25rem;
            }
            
            .new-programs-header-top {
                gap: 0.75rem;
            }
            
            .new-programs-timeframe {
                flex-direction: column;
                align-items: flex-start;
                width: 100%;
            }
            
            .new-programs-timeframe .form-select {
                width: 100%;
            }
            
            .new-programs-list {
                grid-template-columns: minmax(0, 1fr);
                gap: 0.85rem;
            }
            
            .new-program-card {
                padding: 1rem;
                border-radius: 12px;
                gap: 0.75rem;
                min-height: auto;
            }
            
            .program-card-header {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .program-card-header h4 {
                font-size: 1rem;
            }
            
            .program-tag {
                font-size: 0.8rem;
                padding: 0.25rem 0.55rem;
            }
            
            .program-card-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
            
            .program-card-btn {
                width: 100%;
                min-width: 0;
                text-align: center;
            }
            
            .new-program-card .program-description {
                font-size: 0.9rem;
                -webkit-line-clamp: 4;
                line-clamp: 4;
            }
            
            .calendar-nav {
                flex-direction: column;
                gap: 0.75rem;
                padding: 1rem;
            }
            
            .calendar-nav h2 {
                font-size: 1.25rem;
                order: -1;
                text-align: center;
            }
            
            .nav-buttons {
                display: flex;
                justify-content: space-between;
                width: 100%;
                gap: 0.5rem;
            }
            
            .nav-buttons .btn {
                flex: 1;
                padding: 0.5rem;
                font-size: 0.85rem;
            }
            
            .calendar-container {
                padding: 0.5rem;
            }
            
            .calendar-day-header {
                padding: 0.45rem 0.2rem;
                font-size: 0.68rem;
            }
            
            .calendar-day {
                height: auto;
                min-height: 95px;
                padding: 0.3rem 0.2rem;
            }
            
            .day-number {
                font-size: 0.75rem;
                margin-bottom: 0.15rem;
                font-weight: 600;
            }
            
            .event-tile {
                font-size: 0.52rem;
                padding: 0.12rem 0.18rem;
                margin-bottom: 0.1rem;
                line-height: 1.25;
            }
            
            .more-events {
                font-size: 0.48rem;
                padding: 0.1rem 0.18rem;
            }
            
            .status-bar {
                flex-direction: column;
                gap: 0.5rem;
                padding: 0.75rem;
            }
            
            .status-item {
                font-size: 0.85rem;
            }
            
            #map {
                height: 350px;
                border-radius: 8px;
            }
            
            .day-events-modal .modal-dialog {
                max-width: 95%;
                margin: 0.5rem auto;
            }
            
            .day-events-modal .modal-content {
                border-radius: 12px;
            }
            
            .day-events-modal .modal-header {
                padding: 1rem;
            }
            
            .day-events-modal .modal-body {
                padding: 1rem;
            }
            
            .map-filter-controls {
                flex-direction: column;
                align-items: stretch;
                gap: 0.75rem;
                padding: 1rem;
            }
            
            .map-filter-controls .form-control,
            .map-filter-controls .form-select {
                width: 100%;
            }
            
            .library-popup {
                width: clamp(190px, 82vw, 260px);
                max-width: clamp(190px, 82vw, 260px);
                font-size: 0.9rem;
                padding: 0.5rem;
            }
            
            .library-popup h3 {
                font-size: 1rem;
                margin-bottom: 0.5rem;
                padding-right: 0.5rem;
            }
            
            .library-popup p {
                font-size: 0.85rem;
                margin-bottom: 0.5rem;
            }
            
            .popup-event {
                padding: 0.75rem;
                font-size: 0.85rem;
                min-height: 44px;
                display: flex;
                flex-direction: column;
                justify-content: center;
            }
            
            .popup-event strong {
                font-size: 0.9rem;
                margin-bottom: 0.25rem;
            }
            
            .popup-event small {
                font-size: 0.8rem;
                margin-top: 0.25rem;
            }
            
            .event-list {
                max-height: calc(50vh - 150px);
                min-height: 100px;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior: contain;
                padding-right: 0.25rem;
            }
            
            /* Leaflet popup mobile adjustments */
            .leaflet-popup-content-wrapper {
                max-width: clamp(200px, 88vw, 280px);
                width: auto;
            }
            
            .leaflet-popup-content {
                margin: 10px 12px;
                width: auto !important;
            }
            
            .leaflet-popup-close-button {
                width: 30px;
                height: 30px;
                font-size: 24px;
                line-height: 30px;
                padding: 0;
                touch-action: manipulation;
            }
            
            .view-all-programs-btn {
                min-height: 44px;
                padding: 0.75rem;
                font-size: 0.9rem;
                touch-action: manipulation;
            }
        }
        
        /* Tablets and small screens (576px to 768px) */
        @media (min-width: 576px) and (max-width: 768px) {
            .main-container {
                padding: 0 1rem;
            }
            
            .calendar-container {
                padding: 0.75rem;
            }
            
            .calendar-day-header {
                padding: 0.6rem 0.3rem;
                font-size: 0.75rem;
            }
            
            .calendar-day {
                height: auto;
                min-height: 105px;
                padding: 0.35rem 0.3rem;
            }
            
            .event-tile {
                font-size: 0.6rem;
                padding: 0.12rem 0.25rem;
                line-height: 1.3;
            }
            
            .more-events {
                font-size: 0.55rem;
                padding: 0.1rem 0.25rem;
            }
            
            #map {
                height: 400px;
            }
            
            .filter-section .row > div {
                margin-bottom: 1rem;
            }
        }
        
        /* Tablets in landscape (576px to 768px landscape) */
        @media (min-width: 576px) and (max-width: 768px) and (orientation: landscape) {
            .calendar-day {
                min-height: 90px;
            }
            
            .calendar-day-header {
                padding: 0.5rem 0.25rem;
            }
        }
        
        /* Standard mobile (up to 768px) */
        @media (max-width: 768px) {
            .calendar-nav {
                flex-direction: column;
                gap: 1rem;
                padding: 0.75rem 1rem;
                margin-bottom: 1rem;
            }
            
            .calendar-nav h2 {
                font-size: 1.1rem;
            }
            
            .calendar-container {
                padding: 0.5rem;
                margin-bottom: 1rem;
                border-radius: 8px;
            }
            
            .calendar-grid {
                gap: 0.5px;
                border-radius: 6px;
            }
            
            .calendar-day-header {
                padding: 0.5rem 0.25rem;
                font-size: 0.7rem;
                font-weight: 600;
            }
            
            .calendar-day {
                height: auto;
                min-height: 100px;
                padding: 0.3rem 0.2rem;
            }
            
            .day-number {
                font-size: 0.75rem;
                margin-bottom: 0.2rem;
            }
            
            .event-tile {
                font-size: 0.55rem;
                padding: 0.15rem 0.2rem;
                line-height: 1.3;
            }
            
            .more-events {
                font-size: 0.5rem;
                padding: 0.1rem 0.2rem;
            }
            
            .main-container {
                padding: 0 0.5rem;
            }
            
            #map {
                height: 350px;
            }
            
            .day-events-modal .modal-dialog {
                max-width: 95%;
                margin: 1rem auto;
            }
            
            .map-filter-controls {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
            
            .map-filter-controls .form-control {
                width: 100%;
            }
            
            /* Stack filter columns on mobile */
            .filter-section .row > div {
                flex: 0 0 100%;
                max-width: 100%;
            }
            
            /* Improve button spacing */
            .btn-group {
                width: 100%;
            }
            
            .btn-group .btn {
                flex: 1;
            }
            
            /* Better modal sizing */
            .modal-dialog {
                margin: 0.5rem;
            }
            
            /* Better popup sizing */
            .library-popup {
                width: clamp(210px, 78vw, 280px);
                max-width: clamp(210px, 78vw, 280px);
                padding: 0.75rem;
            }
            
            .library-popup h3 {
                font-size: 1rem;
                margin-bottom: 0.5rem;
            }
            
            .library-popup p {
                font-size: 0.9rem;
                margin-bottom: 0.5rem;
            }
            
            .popup-event {
                padding: 0.7rem;
                font-size: 0.88rem;
                min-height: 44px;
            }
            
            .popup-event strong {
                font-size: 0.95rem;
            }
            
            .popup-event small {
                font-size: 0.82rem;
            }
            
            .event-list {
                max-height: calc(50vh - 180px);
                min-height: 120px;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior: contain;
            }
            
            /* Leaflet popup mobile adjustments */
            .leaflet-popup-content-wrapper {
                max-width: clamp(220px, 85vw, 300px);
                width: auto;
            }
            
            .leaflet-popup-content {
                margin: 12px 15px;
                width: auto !important;
            }
            
            .leaflet-popup-close-button {
                width: 32px;
                height: 32px;
                font-size: 22px;
                line-height: 32px;
                touch-action: manipulation;
            }
            
            .view-all-programs-btn {
                min-height: 44px;
                padding: 0.7rem;
                font-size: 0.9rem;
                touch-action: manipulation;
            }
            
            /* Improve notification positioning */
            .alert.position-fixed {
                top: 10px;
                right: 10px;
                left: 10px;
                max-width: none;
            }
        }
        
        /* Landscape orientation on mobile */
        @media (max-width: 768px) and (orientation: landscape) {
            #map {
                height: 250px;
            }
            
            .calendar-container {
                padding: 0.5rem;
            }
            
            .calendar-day-header {
                padding: 0.4rem 0.2rem;
                font-size: 0.65rem;
            }
            
            .calendar-day {
                min-height: 85px;
                padding: 0.25rem 0.15rem;
            }
            
            .day-number {
                font-size: 0.7rem;
                margin-bottom: 0.15rem;
            }
            
            .event-tile {
                font-size: 0.5rem;
                padding: 0.1rem 0.15rem;
                line-height: 1.2;
            }
            
            .more-events {
                font-size: 0.45rem;
                padding: 0.08rem 0.15rem;
            }
            
            /* Landscape popup adjustments */
            .library-popup {
                width: clamp(210px, 45vw, 260px);
                max-width: clamp(210px, 45vw, 260px);
            }
            
            .leaflet-popup-content-wrapper {
                max-width: clamp(210px, 45vw, 280px);
                width: auto;
            }
            
            .event-list {
                max-height: calc(40vh - 100px);
                min-height: 80px;
            }
        }
        
        /* Small phones in portrait (up to 480px) */
        @media (max-width: 480px) {
            .calendar-container {
                padding: 0.25rem;
            }
            
            .calendar-day-header {
                padding: 0.4rem 0.15rem;
                font-size: 0.65rem;
            }
            
            .calendar-day {
                min-height: 90px;
                padding: 0.25rem 0.15rem;
            }
            
            .day-number {
                font-size: 0.7rem;
            }
            
            .event-tile {
                font-size: 0.5rem;
                padding: 0.1rem 0.15rem;
            }
            
            .more-events {
                font-size: 0.45rem;
                padding: 0.08rem 0.15rem;
            }
            
            .library-popup {
                width: clamp(180px, 88vw, 230px);
                max-width: clamp(180px, 88vw, 230px);
                padding: 0.5rem;
            }
            
            .leaflet-popup-content-wrapper {
                max-width: clamp(185px, 90vw, 240px);
                width: auto;
            }
        }
        
        /* Small phones in landscape (up to 480px landscape) */
        @media (max-width: 480px) and (orientation: landscape) {
            .calendar-day {
                min-height: 75px;
                padding: 0.2rem 0.1rem;
            }
            
            .calendar-day-header {
                padding: 0.35rem 0.15rem;
                font-size: 0.6rem;
            }
            
            .day-number {
                font-size: 0.65rem;
            }
            
            .event-tile {
                font-size: 0.45rem;
                padding: 0.08rem 0.12rem;
            }
            
            .library-popup {
                width: clamp(190px, 60vw, 240px);
                max-width: clamp(190px, 60vw, 240px);
            }
            
            .leaflet-popup-content-wrapper {
                max-width: clamp(200px, 62vw, 250px);
                width: auto;
            }
        }
        
        /* Prevent text size adjustment on iOS */
        @media screen and (-webkit-min-device-pixel-ratio: 0) {
            select,
            textarea,
            input[type="text"],
            input[type="date"],
            input[type="email"] {
                font-size: 16px !important;
            }
        }
        
        /* Touch device optimizations */
        @media (hover: none) and (pointer: coarse) {
            /* Improve touch targets */
            .btn, button {
                padding: 0.75rem 1rem;
            }
            
            /* Remove hover effects on touch devices */
            .calendar-day:hover {
                background: #fff;
                box-shadow: none;
            }
            
            .event-tile:hover {
                background: var(--primary-color);
            }
            
            /* Better tap feedback */
            .btn:active,
            button:active,
            .calendar-day:active {
                transform: scale(0.98);
                transition: transform 0.1s;
            }
        }
        
        /* Utility Classes */
        .text-muted { color: #6c757d !important; }
        .text-primary { color: var(--primary-color) !important; }
        .text-success { color: var(--secondary-color) !important; }
        .text-danger { color: var(--danger-color) !important; }
        .text-warning { color: var(--warning-color) !important; }
        
        /* Accessibility improvements */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .btn:focus,
        .form-control:focus,
        .form-select:focus {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        .skip-link {
            position: absolute;
            top: -40px;
            left: 6px;
            background: var(--primary-color);
            color: white;
            padding: 8px;
            text-decoration: none;
            z-index: 1000;
        }

        .skip-link:focus {
            top: 6px;
        }
        
        /* Contact Form Styles */
        .contact-modal .modal-content {
            border-radius: 12px;
            border: none;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        }
        
        .contact-modal .modal-header {
            background: linear-gradient(135deg, var(--primary-color), #004d99);
            color: white;
            border-radius: 12px 12px 0 0;
            border-bottom: none;
        }
        
        .contact-modal .modal-header .btn-close {
            filter: invert(1);
        }
        
        .contact-modal .form-label {
            font-weight: 500;
            color: #333;
            margin-bottom: 0.5rem;
        }
        
        .contact-modal .form-control,
        .contact-modal .form-select {
            border-radius: 8px;
            border: 1px solid var(--border-color);
            padding: 0.75rem;
        }
        
        .contact-modal .form-control:focus,
        .contact-modal .form-select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
        }
        
        .contact-modal textarea.form-control {
            resize: vertical;
            min-height: 120px;
        }
        
        .contact-modal .btn-submit {
            background: var(--primary-color);
            border: none;
            padding: 0.75rem 2rem;
            font-weight: 500;
        }
        
        .contact-modal .btn-submit:hover {
            background: #0056b3;
        }
        
        .contact-modal .btn-submit:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        
        .contact-link {
            color: rgba(255, 255, 255, 0.9);
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            transition: all 0.3s;
        }
        
        .contact-link:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }
