
/* ==========================================================================
   1. Base & Reset Styles
   ========================================================================== */
html, body {
    margin: 0;
    height: 100%;
    font-family: 'Roboto', Arial, sans-serif;
    overflow: hidden;
    background-color: #FDFDFD;
}

/* ==========================================================================
   Main Website Navigation Header
   ========================================================================== */
.main-nav-header {
    background: linear-gradient(135deg, #0E718C, #1a8ba6);
    color: white;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(14, 113, 140, 0.15);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.main-site-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.main-site-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.main-site-link i {
    font-size: 16px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

.app-title i {
    font-size: 16px;
}

/* Adjust body height to account for nav header */
body {
    height: 100vh;
}

/* Mobile responsive nav */
@media (max-width: 768px) {
    .main-nav-header {
        padding: 6px 12px;
        height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-content {
        height: 100%;
        align-items: center;
        width: 100%;
    }

    .main-site-link {
        font-size: 12px;
        padding: 6px 10px;
        height: 32px;
        border-radius: 16px;
    }

    .main-site-link span {
        display: inline;
    }

    .main-site-link i {
        font-size: 16px;
    }

    .app-title {
        font-size: 12px;
        height: 32px;
        align-items: center;
    }

    .app-title span {
        display: inline;
    }

    .app-title i {
        font-size: 16px;
    }
}

/* ==========================================================================
   2. Layout Containers (Desktop & Main Layout)
   ========================================================================== */
.container {
    width: 100vw !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    height: calc(100vh - 40px); /* Adjust for nav header */
}

/* Adjust for mobile bottom navigation */
@media (max-width: 768px) {
    .container {
        height: calc(100vh - 44px); /* Adjust for nav header */
    }
}

.map-container {
    flex: 1;
    position: relative;
}
#map {
    width: 100%;
    height: calc(100vh - 40px); /* Adjust for nav header */
}

/* Adjust map height for mobile bottom navigation */
@media (max-width: 768px) {
    #map {
        height: calc(100vh - 44px); /* Adjust for nav header */
    }
}

/* ==========================================================================
   3. Sidebar & List/Event Styles
   ========================================================================== */
.sidebar {
    width: 340px;
    height: 100vh;
    background: #FDFDFD;
    z-index: 999;
    border-right: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.search-input-wrapper {
    padding: 16px 20px;
    background: #FDFDFD;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

.sidebar h2 {
    margin: 20px 0 16px 0;
    color: #0E718C;
    font-weight: 600;
    font-size: 18px;
}
.search-input:focus {
    outline: none;
    border-color: #0E718C;
    box-shadow: 0 0 0 2px rgba(14, 113, 140, 0.1);
}
.event {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(14, 113, 140, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}
.event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    background-color: #f8f9fa;
}
.event h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #0E718C;
    line-height: 1.2;
}
.event p {
    margin: 0 0 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.event small {
    color: #888;
    font-size: 12px;
}
.event .category-badge {
    background: #0E718C;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    margin-bottom: 4px;
    float: right;
    margin-top: -1px;
}
.event a.button {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    background-color: #0E718C;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    transition: background-color 0.3s ease;
}
.event a.button:hover {
    background-color: #0a5a73;
}
.event.highlighted {
    background-color: #e8f4f8;
    border-color: #0E718C;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 113, 140, 0.2);
}

/* ==========================================================================
   4. Filters & Overlay (Popup, Badges, Buttons)
   ========================================================================== */
.filters {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(14, 113, 140, 0.15);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid #e0e0e0;
}
.filters.hidden {
    transform: translateX(320px);
    opacity: 0;
    pointer-events: none;
}
.filters h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #0E718C;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filter-toggle {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    padding: 6px;
    color: #666;
    font-size: 18px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-toggle:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.filter-group {
    margin-bottom: 12px;
}
.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fafafa;
}
.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #0E718C;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 113, 140, 0.1);
}
.filter-group select:hover,
.filter-group input:hover {
    border-color: #0E718C;
    background: #fff;
}

/* Date input styling */
.date-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fafafa;
    margin-bottom: 4px;
}

.date-input:focus {
    outline: none;
    border-color: #0E718C;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 113, 140, 0.1);
}

.date-input:hover {
    border-color: #0E718C;
    background: #fff;
}
.filter-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #0E718C;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 113, 140, 0.15);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.filter-toggle-btn:hover {
    background: #0a5a73;
    transform: scale(1.05);
}
.hidden {
    display: none !important;
}

/* Overlay for mobile filter popup */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ==========================================================================
   5. Mobile Layouts (Tabs, Search Bar, etc.)
   ========================================================================== */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(14, 113, 140, 0.95), rgba(26, 139, 166, 0.95));
    border-radius: 16px;
    z-index: 1001;
    box-shadow: 0 4px 16px rgba(14, 113, 140, 0.3);
    padding: 3px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: auto;
    gap: 2px;
}
.mobile-tab {
    padding: 6px 10px;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    min-width: 32px;
    height: 32px;
    position: relative;
    overflow: hidden;
}
.mobile-tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}
.mobile-tab.active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    pointer-events: none;
}
.mobile-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}
.mobile-tab i {
    margin: 0;
    font-size: 16px;
    z-index: 1;
    position: relative;
}
.mobile-tab span {
    display: none;
}
.mobile-search-bar {
    display: none;
    padding: 12px;
    background: #FDFDFD;
    border-bottom: 1px solid #e0e0e0;
}
.mobile-search-container {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
}
.mobile-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}
.mobile-filter-btn {
    padding: 8px 12px;
    background: #0E718C;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
}
.filter-btn {
    margin: 5px;
}
.primary-button {
    display: inline-block;
    padding: 4px 8px;
    background-color: #ffffff;
    color: #0E718C;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    transition: background-color 0.3s ease;
    border: 1px solid #0E718C;
    cursor: pointer;
}
.primary-button:hover,
.primary-button.active {
    background-color: #0a5a73;
    color: white;
}

/* ==========================================================================
   6. Filter Badges & Scrollbar Customizations
   ========================================================================== */
#cityFilterBadges {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}
#cityFilterBadges::-webkit-scrollbar { width: 0px; background: transparent; }
#cityFilterBadges { scrollbar-width: none; }
#filters {
    max-height: 70vh;
    overflow-y: auto;
}
#filters::-webkit-scrollbar { width: 0px; background: transparent; }
#filters { scrollbar-width: none; }

/* ==========================================================================
   7. Responsive Media Queries (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .mobile-search-bar { display: block; }
    .sidebar {
        width: 100%;
        height: 0;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid #ccc;
        transform: translateY(0);
        transition: all 0.3s ease;
        padding: 0;
        z-index: 1000 !important;
    }
    .sidebar.show-mobile {
        height: calc(100vh - 120px);
        padding: 0;
        overflow-y: auto;
    }

    .sidebar.show-mobile h2 {
        font-size: 16px;
        margin: 16px 0 16px 0;
    }

    .sidebar.show-mobile .search-input-wrapper {
        padding: 8px 20px 8px 20px;
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
        min-height: auto;
    }

    .sidebar.show-mobile .sidebar-content {
        padding: 0 20px 20px 20px;
    }
    .sidebar .search-input { display: none; }
    .map-container {
        flex: 1;
        height: calc(100vh - 120px);
        display: none;
    }
    .map-container.show-mobile { display: block; }
    #map { height: 100%; }
    .filters {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 340px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 3000 !important;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    }
    .filters.hidden {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    .filter-toggle-btn { display: none; }
    .mobile-search-container .search-suggestions {
        z-index: 3000 !important;
    }
}

@media (max-width: 480px) {
    .filters { padding: 16px; width: 95%; }
    .event { padding: 8px; margin-bottom: 6px; }
    .event h3 { font-size: 15px; }
    .event p { font-size: 12px; }
}

/* ==========================================================================
   8. Search Suggestions / Popup
   ========================================================================== */
.search-input-wrapper { position: relative; }
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 18px #0001;
    margin: 0;
    margin-top: -2px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

/* Ensure hidden search suggestions don't take space */
.search-suggestions[style*="display: none"] {
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}
.search-suggestion-item {
    padding: 11px 16px;
    cursor: pointer;
    font-size: 15px;
    color: #156b8c;
    border-bottom: 1px solid #f3f3f3;
    background: #fff;
    transition: background 0.18s;
}
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: #e8f4f8;
    color: #0e718c;
}
.cat-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
    background: #e0f1ff;
    color: #1976d2;
}
.cat-badge.category { background: #dbeafe; color: #156b8c; }
.cat-badge.tag { background: #f3e8ff; color: #8830c6; }
.cat-badge.city { background: #e0fbe8; color: #10954b; }
.cat-badge.highlight { background: #fff7d6; color: #a07000; }

/* ==========================================================================
   9. Highlights & Badges
   ========================================================================== */
.highlight-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 6px 0 0 0;
}
.highlight-badge {
    background: #dbeafe;
    color: #156b8c;
    border-radius: 8px;
    font-size: 13px;
    padding: 3px 11px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}
.highlight-badge:hover { background: #b6e0fa; }
.show-more-btn {
    background: none;
    border: none;
    color: #1976d2;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    font-size: 13px;
    padding: 0;
}

/* ==========================================================================
   10. Map Popup Styles
   ========================================================================== */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0 !important;
}

/* Add padding to popup content divs */
.leaflet-popup-content > div {
    padding: 6px;
}

/* Enhanced button hover effect for popup */
.leaflet-popup-content a[href*="venue.html"] {
    transition: all 0.2s ease;
}

.leaflet-popup-content a[href*="venue.html"]:hover {
    background-color: #0a5a6b !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 113, 140, 0.3) !important;
}

/* Image styling for popup */
.leaflet-popup-content img {
    transition: opacity 0.3s ease;
}

/* Mobile responsiveness for popups */
@media (max-width: 768px) {
    .leaflet-popup-content-wrapper {
        max-width: 280px;
    }
    
    .leaflet-popup-content img {
        height: 100px !important;
    }
    
    .leaflet-popup-content > div {
        padding: 4px;
    }
}
