/* ========================================
   the move - Event Discovery PWA
   Complete Stylesheet
   ======================================== */

/* Instant background on html element so the WebView never flashes white
   after the splash screen in dark mode, or black in light mode. */
html {
    background-color: #ffffff;
}
@media (prefers-color-scheme: dark) {
    html { background-color: #0a0a0f; }
}

/* ----------------------------------------
   CSS Custom Properties (Design Tokens)
   ---------------------------------------- */
:root {
    /* Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;
    --bg-card: #ffffff;
    --bg-input: #f0f0f5;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-modal: #ffffff;
    --bg-dropdown: #ffffff;
    --bg-banner: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);

    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    /* Was #8888a0 (3.46:1 on white — fails WCAG AA's 4.5:1 for normal text). Darkened to
       clear 4.5:1 against both --bg-primary and --bg-secondary while staying visibly
       lighter/more muted than --text-secondary. */
    --text-tertiary: #6f6f83;
    --text-inverse: #ffffff;

    --border-color: #e0e0e8;
    --border-light: #f0f0f5;

    --accent-primary: #3b82f6;
    --accent-secondary: #1d4ed8;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --accent-green: #27ae60;
    --accent-red: #e74c3c;
    --accent-orange: #f39c12;
    --accent-blue: #3498db;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    --header-height: 56px;
    --bottom-nav-height: 56px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode Colors */
body.dark-mode {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1c1c28;
    --bg-card: #16161f;
    --bg-input: #1c1c28;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-modal: #16161f;
    --bg-dropdown: #1c1c28;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    /* Was #6a6a82 (3.76:1 on the dark bg — fails WCAG AA's 4.5:1 for normal text).
       Lightened to clear 4.5:1 against both --bg-primary and --bg-secondary while staying
       visibly darker/more muted than --text-secondary. */
    --text-tertiary: #7b7b97;

    --border-color: #2a2a3a;
    --border-light: #1e1e2c;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ----------------------------------------
   Reset & Base Styles
   ---------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    /* Contain vertical overscroll so pulling past the top can't chain into the
       browser's native pull-to-refresh (Chrome/Android) or bounce-navigation —
       those do a full page reload and wipe all in-memory state (filters, active
       view, etc). Our own JS pull-to-refresh is unaffected since it works off
       touch events, not native scroll chaining. */
    overscroll-behavior-y: contain;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
}

input, select {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------------------
   Nav Glass Backdrop
   Single fixed element spanning full floating-nav height.
   One backdrop-filter = zero seam between nav rows.
   Only active on mobile (<768px) and desktop (≥1024px) where the nav is fixed.
   ---------------------------------------- */
.nav-backdrop {
    display: none; /* hidden on tablet/non-fixed contexts */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 996; /* below all nav elements but above page content */
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    will-change: backdrop-filter;
    pointer-events: none;
}

body.dark-mode .nav-backdrop {
    background: rgba(10, 10, 15, 0.78);
}

/* ----------------------------------------
   App Container
   ---------------------------------------- */
.app-container {
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
    padding-top: var(--safe-area-top);
}

/* ----------------------------------------
   Header
   ---------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Glass: semi-transparent so page content blurs through */
    background-color: rgba(255, 255, 255, 0.82);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    will-change: backdrop-filter;
    overflow: hidden;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06), 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Specular highlight along the bottom edge */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0.5px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.7) 25%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 255, 255, 0.7) 75%,
        transparent 100%);
    pointer-events: none;
}

body.dark-mode .header {
    background-color: rgba(10, 10, 15, 0.78);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.3), 0 4px 24px rgba(0, 0, 0, 0.2);
}

body.dark-mode .header::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 25%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 75%,
        transparent 100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Left-side header slot (dark mode toggle on mobile) */
.header-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.logo-img {
    height: 64px;
    width: auto;
    display: block;
    cursor: pointer;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Icon Buttons */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    background: transparent;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
    background-color: var(--bg-tertiary);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn svg {
    display: block;
}

/* ----------------------------------------
   View Toggle
   ---------------------------------------- */
.view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal);
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.toggle-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.toggle-btn.active {
    background: var(--accent-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.toggle-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ----------------------------------------
   Search Container
   ---------------------------------------- */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px;
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal);
}

.search-input {
    flex: 1;
    height: 42px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.04);
}

body.dark-mode .search-input {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), 0 1px 3px rgba(0, 0, 0, 0.25);
}

body.dark-mode .search-input::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.filter-toggle-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-toggle-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Desktop layout wrapper — no-op on mobile (flex only kicks in at 1024px) */
.desktop-app-layout {
    display: block;
}

/* Desktop filter sidebar: hidden on mobile, shown via 1024px media query */
.desktop-filter-sidebar {
    display: none;
}

/* Split view button and sidebar toggle: hidden on mobile, shown via 1024px media query */
.desktop-split-btn,
.desktop-sidebar-toggle {
    display: none;
}

/* ----------------------------------------
   View Containers (Map & List)
   ---------------------------------------- */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

/* Map View */
.map-view {
    position: relative;
}

:root {
    --chip-bar-height: 49px; /* filter chip bar: 8px padding top + 33px button + 8px padding bottom */
}

.map-view #map,
#map {
    width: 100%;
    height: calc(100vh - var(--header-height) - var(--chip-bar-height) - 120px);
    height: calc(100dvh - var(--header-height) - var(--chip-bar-height) - 120px);
    z-index: 1;
}

/* First-time map hint tooltip */
.map-hint-tooltip {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.map-hint-tooltip.fade-out {
    opacity: 0;
}

.map-hint-tooltip.hidden {
    display: none;
}

/* ----------------------------------------
   Bottom Navigation Bar
   ---------------------------------------- */
.bottom-nav {
    display: none;
}

/* Button styles defined globally so they always apply when nav is visible */
.bnav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    color: #6f6f83; /* fallback — matches --text-tertiary light mode */
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-size: 10px;
    /* iOS Safari: force compositing layer above backdrop-filter blur */
    position: relative;
    z-index: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.bnav-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
    transition: transform 120ms ease;
}

.bnav-btn span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    display: block;
}

.bnav-btn.active {
    color: var(--accent-primary);
}

.bnav-btn.active svg {
    stroke: var(--accent-primary);
}

.bnav-btn:active svg {
    transform: scale(0.85);
}

@media (max-width: 1279px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        /* Float as a pill above the safe area */
        bottom: calc(10px + var(--safe-area-bottom));
        left: 14px;
        right: 14px;
        height: var(--bottom-nav-height);
        padding-bottom: 0;
        border-radius: 20px;
        /* Liquid Glass: frosted blur over page content */
        background: rgba(248, 248, 250, 0.90);
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        will-change: backdrop-filter;
        border: 0.5px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        z-index: 900;
        align-items: stretch;
        color: var(--text-tertiary);
        overflow: hidden;
    }

    /* No top-edge highlight pseudo — border handles the outline */
    .bottom-nav::before {
        display: none;
    }

    body.dark-mode .bottom-nav {
        background: rgba(16, 16, 24, 0.90);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
    }

    /* Active tab: glass pill indicator */
    .bnav-btn.active {
        background: rgba(59, 130, 246, 0.12);
        border-radius: 12px;
        margin: 6px 3px;
        padding: 0 6px;
    }

    body.dark-mode .bnav-btn.active {
        background: rgba(59, 130, 246, 0.18);
    }

    /* Hide top view-toggle on mobile — bottom nav replaces it */
    .view-toggle {
        display: none;
    }

    /* Hide menu items that are redundant with the bottom nav on mobile */
    .desktop-only {
        display: none !important;
    }

    /* #map is position:fixed so containers can't clip it.
       Two height declarations: dvh fallback first, then lvh preferred.
       100lvh = large viewport height (never shrinks when iOS address bar appears),
       so tiles always render past the address bar — no grey strip ever. */
    .map-view #map,
    #map {
        position: fixed !important;
        top: calc(var(--safe-area-top) + var(--header-height) + 58px + var(--chip-bar-height)) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 5 !important;
        height: calc(100dvh - var(--safe-area-top) - var(--header-height) - 58px - var(--chip-bar-height)) !important;
        height: calc(100lvh - var(--safe-area-top) - var(--header-height) - 58px - var(--chip-bar-height)) !important;
    }

    /* Prevent list content from hiding behind floating bottom nav (height + gap + safe area) */
    .events-list {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 22px);
    }

    /* ---- Floating mobile header ---- */
    /* Change from sticky to fixed so it genuinely floats above scrolling content.
       padding-top + taller height push the logo below the iOS status bar so the
       nav-backdrop glass covers the safe-area-inset-top region consistently. */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(var(--safe-area-top) + var(--header-height));
        padding-top: var(--safe-area-top);
        border-bottom: none;
        box-shadow: none;
        /* Hand glass effect to the single nav-backdrop element */
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Dark mode: override body.dark-mode .header which has higher specificity */
    body.dark-mode .header {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-bottom: none;
    }

    /* Kill the specular-highlight pseudo, compositing hint, and clip boundary —
       these all cause a hairline seam at the header's bottom edge */
    .header::after { display: none; }
    .header { overflow: visible; will-change: auto; }

    /* Activate single nav-backdrop: safe-area + header + search + chip bar */
    .nav-backdrop {
        display: block;
        height: calc(var(--safe-area-top) + var(--header-height) + 58px + var(--chip-bar-height));
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 6px 32px rgba(0, 0, 0, 0.04);
    }

    body.dark-mode .nav-backdrop {
        border-bottom-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 6px 32px rgba(0, 0, 0, 0.2);
    }

    /* ---- Search bar joins the floating nav on mobile ---- */
    /* Fixed directly below header — transparent so nav-backdrop shows through */
    .search-container {
        position: fixed;
        top: calc(var(--safe-area-top) + var(--header-height));
        left: 0;
        right: 0;
        z-index: 998;
        padding: 8px 16px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        box-shadow: none;
    }

    /* CRITICAL: base .filter-chip-bar CSS (line ~1949) comes AFTER this block and overrides it
       via cascade. Use !important on structural properties so mobile wins regardless of order. */
    .filter-chip-bar {
        position: fixed !important;
        top: calc(var(--safe-area-top) + var(--header-height) + 58px) !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 997 !important;
        background: transparent !important; /* let nav-backdrop glass show through */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none !important;
    }

    /* Horizontal scroll for the chip buttons so they never overflow the viewport.
       Dropdowns are already rendered as position:fixed via JS so they won't be clipped. */
    .filter-chips-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
    }
    .filter-chips-scroll::-webkit-scrollbar { display: none; }

    /* Active filter pills are redundant on mobile — chip toggles already show active state */
    .active-filters-row { display: none !important; }

    /* Tooltip: position fixed so it renders relative to the viewport, not the
       collapsed .map-view (which has 0 height when #map is position:fixed) */
    .map-hint-tooltip {
        position: fixed;
        bottom: calc(var(--bottom-nav-height, 64px) + 24px);
        left: 50%;
        transform: translateX(-50%);
    }

    /* Sponsored banner: use fixed positioning so it stays anchored just below the chip bar
       regardless of how many active filter pills are present. --chip-bar-height is updated
       by a ResizeObserver in app.js that watches the actual chip bar height. */
    .sponsored-banner {
        position: fixed !important;
        top: calc(var(--safe-area-top) + var(--header-height) + 58px + var(--chip-bar-height) + 12px) !important;
    }
    .sponsored-banner.closed {
        transform: translateX(-50%) translateY(-200%) !important;
    }

    /* Push app content below fixed header + search + chip bar */
    .app-container {
        padding-top: calc(var(--safe-area-top) + var(--header-height) + 58px + var(--chip-bar-height));
    }
}

/* 2-column event grid on tablet-sized screens regardless of pointer type.
   The pointer:fine tablet block below handles pointer-specific styling,
   but the grid itself should apply to any device at 768–1279px. */
@media (min-width: 768px) and (max-width: 1279px) {
    .events-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        padding: 0 20px calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 22px);
    }

    .lazy-load-sentinel,
    .empty-state {
        grid-column: 1 / -1;
    }
}

/* Hide empty active-filter row so it doesn't create phantom spacing */
.active-filters-row:empty {
    display: none;
}

/* SEO event links: hidden via CSS so layout isn't disrupted; content still
   rendered in DOM for crawlers that execute JavaScript */
#seo-event-links {
    display: none;
}

/* Leaflet popup overrides */
.map-popup {
    min-width: 200px;
    max-width: 280px;
    font-family: inherit;
}

.map-popup-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
    line-height: 1.3;
}

.map-popup-info {
    font-size: 0.8125rem;
    color: #555570;
    margin-bottom: 10px;
    line-height: 1.6;
}

.map-popup-btn {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity var(--transition-fast);
}

.map-popup-btn:hover {
    opacity: 0.9;
}

/* Sponsored event map pin */
.sponsored-map-pin {
    background: none;
    border: none;
}

.sponsored-pin-inner {
    width: 32px;
    height: 32px;
    background: #f59e0b;
    border: 2px solid #b45309;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    font-size: 14px;
    line-height: 1;
}

.sponsored-pin-inner::before {
    content: '★';
    display: block;
    transform: rotate(45deg);
    color: #fff;
    font-size: 14px;
    line-height: 32px;
    text-align: center;
    width: 100%;
}

/* Sponsored Event Banner in popup */
.sponsored-event-banner {
    background: var(--accent-gradient);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* List View */
.list-view {
    padding-bottom: calc(20px + var(--safe-area-bottom));
}

.list-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 16px;
}

.density-toggle {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.density-toggle.compact-active {
    color: var(--accent-primary);
}

/* ----------------------------------------
   Compact List Density
   ---------------------------------------- */
.events-list.compact {
    gap: 5px;
}

.events-list.compact .event-card {
    padding: 8px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* Image is hidden; card-text takes all remaining width */
.events-list.compact .event-card-image {
    display: none;
}

.events-list.compact .card-text {
    flex: 1;
    min-width: 0; /* allows truncation */
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.events-list.compact .sponsored-badge {
    font-size: 0.5625rem;
    padding: 1px 7px;
    margin-bottom: 2px;
    align-self: flex-start;
}

.events-list.compact .event-category {
    font-size: 0.6875rem;
}

.events-list.compact .event-title {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

/* Details: horizontal pill row — date · venue · price */
.events-list.compact .event-details {
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 0;
    margin-top: 2px;
}

.events-list.compact .event-detail-row {
    font-size: 0.72rem;
    gap: 3px;
}

.events-list.compact .event-detail-row svg {
    display: none; /* drop icons in compact to save space */
}

/* Engagement buttons: right column, stacked vertically */
.events-list.compact .card-engagement {
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-top: none;
    padding: 0;
    min-width: 32px;
}

/* In compact mode, show price row inline with date/venue */
.events-list.compact .event-price-row {
    display: flex;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-control label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.sort-select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.8125rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.sort-select:focus {
    border-color: var(--accent-primary);
}

/* ----------------------------------------
   Events List & Event Cards
   ---------------------------------------- */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 16px;
}

.event-card {
    background: rgba(255, 255, 255, 0.82);
    border: 0.5px solid rgba(0, 0, 0, 0.07);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.dark-mode .event-card {
    background: rgba(22, 22, 31, 0.82);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.35);
}

body.dark-mode .event-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.4);
}

.event-card:active {
    transform: translateY(0);
}

.event-card.sponsored {
    border: 1px solid rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

body.dark-mode .event-card.sponsored {
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.sponsored-badge {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.event-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background-color: var(--bg-tertiary);
}

.event-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.event-title {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.event-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.event-detail-row svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.event-detail-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Engagement Bar */
.card-engagement {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.card-vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.card-vote-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.card-vote-btn.active {
    color: var(--accent-primary);
    background-color: rgba(102, 126, 234, 0.1);
}

.card-vote-btn[title="Downvote"].active {
    color: var(--accent-red);
    background-color: rgba(231, 76, 60, 0.1);
}

.card-vote-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
}

.card-vote-count.positive {
    color: var(--accent-primary);
}

.card-vote-count.negative {
    color: var(--accent-red);
}

.card-favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    margin-left: auto;
    transition: all var(--transition-fast);
}

.card-favorite-btn:hover {
    background-color: rgba(231, 76, 60, 0.08);
    color: var(--accent-red);
}

.card-favorite-btn.favorited {
    color: var(--accent-red);
}

.card-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.card-share-btn:hover {
    background-color: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
}

.card-feature-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: #f59e0b;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.card-feature-btn:hover {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Venue search result section label */
.venue-search-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 12px 16px 6px;
}

/* Lazy Load Sentinel */
.lazy-load-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   Sponsored Banner (Map Overlay)
   ---------------------------------------- */
.sponsored-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 480px;
    z-index: 500;
    background: var(--bg-banner);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    color: white;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    animation: slideDown 0.4s ease-out;
}

.sponsored-banner.closed {
    transform: translateX(-50%) translateY(-140%);
    opacity: 0;
    pointer-events: none;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.banner-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.banner-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.25rem;
    line-height: 1;
    transition: background-color var(--transition-fast);
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.banner-content {
    margin-bottom: 6px;
}

.banner-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.banner-details {
    font-size: 0.8125rem;
    opacity: 0.85;
    margin-bottom: 6px;
}

.banner-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.9;
}

.banner-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.banner-dot.active {
    width: 18px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
}

/* ----------------------------------------
   User Menu Dropdown
   ---------------------------------------- */
.user-menu-dropdown {
    position: fixed;
    top: var(--header-height);
    right: 8px;
    z-index: 2000;
    min-width: 280px;
    background-color: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-content {
    padding: 8px;
}

.user-menu-guest {
    padding: 16px 12px;
    text-align: center;
}

.user-menu-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.sign-in-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.sign-in-btn:hover {
    opacity: 0.92;
}

.sign-in-btn:active {
    transform: scale(0.98);
}

/* Authenticated Menu */
.user-menu-authenticated {
    padding: 4px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.user-profile.clickable {
    cursor: pointer;
}

.user-profile.clickable:hover {
    background-color: var(--bg-tertiary);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.user-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    width: 100%;
    text-align: left;
    transition: background-color var(--transition-fast);
}

.user-menu-item:hover {
    background-color: var(--bg-tertiary);
}

.user-menu-item.active {
    color: var(--accent-primary);
    background-color: rgba(102, 126, 234, 0.08);
}

.user-menu-item svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.user-menu-item.active svg {
    color: var(--accent-primary);
}

.sign-out-btn {
    color: var(--accent-red) !important;
}

.sign-out-btn svg {
    color: var(--accent-red) !important;
}

.feature-event-link {
    color: #f59e0b !important;
}

.feature-event-link svg {
    color: #f59e0b !important;
}

/* ----------------------------------------
   Modals (General)
   ---------------------------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    animation: modalSlideUp 0.3s ease-out;
    -webkit-overflow-scrolling: touch;
    will-change: backdrop-filter;
}

body.dark-mode .modal-content {
    background: rgba(16, 16, 22, 0.88);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Wider modals on tablet — fills ~70% of the 1024px iPad screen */
@media (min-width: 768px) and (max-width: 1279px) {
    .modal-content,
    .filter-modal-content {
        max-width: 720px;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile: slide up as a bottom sheet */
@media (max-width: 767px) {
    .modal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        max-height: 88dvh;
        border-radius: 24px 24px 0 0;
        border-bottom: none;
        animation: sheetSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    /* Drag handle */
    .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.16);
        border-radius: 2px;
        margin: 12px auto 4px;
        flex-shrink: 0;
    }

    body.dark-mode .modal-content::before {
        background: rgba(255, 255, 255, 0.2);
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}

.modal-body {
    padding: 24px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 1.375rem;
    color: var(--text-secondary);
    z-index: 10;
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--accent-red);
    color: white;
}

.modal-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 4px;
    padding-right: 40px;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ----------------------------------------
   Sign In Modal
   ---------------------------------------- */
.sign-in-modal {
    padding: 32px 24px;
    text-align: center;
}

.sign-in-modal h2 {
    padding-right: 0;
}

/* Sign-in modal must appear above event detail modal */
#signInModal {
    z-index: 3500;
}

.email-sign-in-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-input::placeholder {
    color: var(--text-tertiary);
}

.auth-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.password-field {
    position: relative;
    width: 100%;
}
.password-field .auth-input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover { color: var(--text-secondary); }
.password-toggle svg { width: 18px; height: 18px; }

.auth-submit-btn {
    width: 100%;
    height: 48px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.auth-submit-btn:hover {
    opacity: 0.92;
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-toggle-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-toggle-text a {
    font-weight: 600;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.social-sign-in-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.social-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.social-btn:active {
    transform: scale(0.98);
}

.social-btn svg {
    flex-shrink: 0;
}

.google-btn:hover {
    border-color: #4285F4;
}

.apple-btn:hover {
    border-color: var(--text-primary);
}

.facebook-btn:hover {
    border-color: #1877F2;
}

.terms-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 20px;
    line-height: 1.5;
}

/* ----------------------------------------
   Filter Modal
   ---------------------------------------- */
.filter-modal-content {
    max-width: 520px;
}

.filter-modal-content .modal-body {
    padding: 24px;
}

.filter-modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-right: 40px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.date-btn {
    /* Inherits from .filter-btn */
}

.category-btn {
    /* Inherits from .filter-btn */
}

.vibe-filter-section {
    padding-bottom: 4px;
}

.vibe-btn {
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 4px;
}

.vibe-btn.active {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

/* Price Filter */
.price-inputs {
    display: flex;
    gap: 12px;
}

.price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-input-group label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.price-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.price-input::placeholder {
    color: var(--text-tertiary);
}

.price-input:focus {
    border-color: var(--accent-primary);
}

.apply-filters-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.apply-filters-btn:hover {
    opacity: 0.92;
}

.apply-filters-btn:active {
    transform: scale(0.98);
}

.clear-filters-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.clear-filters-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ----------------------------------------
   Filter Chip Bar (dropdown chips)
   ---------------------------------------- */
.filter-chip-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: var(--header-height, 56px);
    z-index: 601; /* above sponsored-banner z:500 so dropdowns are never hidden behind it */
}

/* Inner row that holds the dropdown chip buttons.
   On mobile this becomes a horizontal scroll container so chips never overflow the viewport. */
.filter-chips-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
}

/* Each dropdown trigger + panel pair */
.filter-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
}

/* The visible chip / toggle button — glass-native style that works on the frosted nav backdrop */
.filter-chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
body.dark-mode .filter-chip-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}
.filter-chip-toggle:hover {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
body.dark-mode .filter-chip-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}
.filter-chip-toggle.has-selection {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.45), 0 1px 3px rgba(0, 0, 0, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.filter-chip-toggle.open {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15), 0 0 0 0.5px rgba(59, 130, 246, 0.3);
}
body.dark-mode .filter-chip-toggle.open {
    background: rgba(59, 130, 246, 0.15);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(59, 130, 246, 0.4);
}

.chip-chevron {
    transition: transform 0.18s ease;
    opacity: 0.7;
    flex-shrink: 0;
}
.filter-chip-toggle.open .chip-chevron,
.filter-chip-toggle[aria-expanded="true"] .chip-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown panel */
.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    min-width: 170px;
    overflow: hidden;
    padding: 4px 0;
}
.filter-dropdown.open {
    display: block;
}

/* Dropdown item */
.filter-drop-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 14px;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}
.filter-drop-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.filter-drop-item.active {
    color: var(--text-primary);
    font-weight: 600;
}
.filter-drop-item.active::before {
    content: '✓';
    margin-right: 8px;
    font-size: 0.75rem;
    color: var(--accent-primary);
}
.filter-drop-item:not(.active)::before {
    content: '';
    display: inline-block;
    width: 16px; /* Reserve space for checkmark alignment */
    margin-right: 8px;
}
.filter-drop-item.now-btn {
    color: #f59e0b;
}

/* Vibe chips (inline after the 3 dropdowns) */
.chip-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
    margin: 0 3px;
}
.filter-chip-vibes {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.filter-chip-vibes .filter-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* Active filter pills row */
.active-filters-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 12px 2px;
    min-height: 0;
}
.active-filters-row:empty {
    padding: 0;
}
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
}
.active-filter-chip:hover {
    background: rgba(99, 102, 241, 0.3);
}
.active-filter-chip .afc-dismiss {
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
}

/* ----------------------------------------
   Event Detail Modal
   ---------------------------------------- */
.modal-image-container {
    position: relative;
    margin: -24px -24px 20px -24px;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-event-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.modal-image-container:hover .modal-event-image {
    transform: scale(1.03);
}

.image-expand-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: white;
    font-size: 0.75rem;
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal-image-container:hover .image-expand-hint {
    opacity: 1;
}

.modal-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.3;
    padding-right: 20px;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.modal-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-detail-row svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-tertiary);
}

.modal-detail-row strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.modal-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.modal-link {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white !important;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    margin-bottom: 16px;
}

.modal-link:hover {
    opacity: 0.92;
    color: white !important;
}

.modal-link:active {
    transform: scale(0.98);
}

.address-link {
    color: var(--accent-primary);
    text-decoration: underline;
    text-decoration-color: rgba(102, 126, 234, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color var(--transition-fast);
}

.address-link:hover {
    text-decoration-color: var(--accent-primary);
}

/* ── Venue link button (in event cards + event detail modal) ── */
.venue-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent-primary);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s;
}
.venue-link-btn:hover { text-decoration-color: var(--accent-primary); }

/* ── Trending Venues row (List View) ── */
.trending-venues {
    padding: 12px 16px 4px;
}
.trending-venues-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.trending-venues-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.trending-venues-scroll::-webkit-scrollbar { display: none; }
.venue-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59,130,246,0.08);
    border: 0.5px solid rgba(59,130,246,0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.venue-chip:hover, .venue-chip:active {
    background: rgba(59,130,246,0.16);
    border-color: rgba(59,130,246,0.45);
}
.venue-chip-score {
    font-size: 0.72rem;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Venue modal sits above event modal (z-index 3000) */
#venueModal { z-index: 4000; }

/* ── Onboarding modal ── */
#onboardingModal { z-index: 5000; }

.onboarding-content {
    position: relative;
    padding: 28px 24px 20px;
    max-width: 380px;
    width: 100%;
}

.onboarding-skip {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}
.onboarding-skip:hover { color: var(--text-primary); }

.onboarding-steps { min-height: 160px; }

.onboarding-step { display: none; }
.onboarding-step.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.onboarding-step-icon {
    font-size: 2.5rem;
    margin-bottom: 14px;
    line-height: 1;
}

.onboarding-step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.onboarding-step p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.onboarding-dots {
    display: flex;
    gap: 6px;
}

.onboarding-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.2s;
}
.onboarding-dot.active { background: var(--accent-primary); }

.onboarding-next {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 9px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.onboarding-next:hover { opacity: 0.88; }

/* ── Venue Modal content ── */
.venue-header { margin-bottom: 1rem; }
.venue-header .venue-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 2px;
}
.venue-header .venue-address {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.venue-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}
.venue-directions-btn:hover { opacity: 0.85; }
.venue-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.venue-report-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 6px;
    opacity: 0.65;
    text-decoration: underline;
    text-underline-offset: 2px;
    display: block;
}
.venue-report-btn:hover { opacity: 1; }
/* .pin-report-content sizing set below with full rule */
.pin-report-form { display: flex; flex-direction: column; gap: 10px; }
.pin-report-form label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.01em; }
.pin-report-textarea,
.pin-report-input {
    background: var(--bg-input, #f0f0f5);
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 14px;
    resize: vertical;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.pin-report-textarea:focus,
.pin-report-input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
}
.pin-report-submit {
    background: var(--accent-primary, #3b82f6);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 12px;
    margin-top: 6px;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}
.pin-report-submit:hover { opacity: 0.85; }
.pin-report-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.pin-report-success { color: #4ade80; text-align: center; padding: 1rem 0; font-size: 0.95rem; }
.pin-report-error { color: var(--error); font-size: 0.82rem; margin-top: 4px; }
.pin-report-modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 6000;
}
.pin-report-content {
    max-width: 400px;
    padding: 28px 24px 24px;
    background: var(--bg-modal, #fff) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.pin-report-header {
    text-align: center;
    margin-bottom: 20px;
}
.pin-report-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.pin-report-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 4px;
    padding-right: 0;
}
.pin-report-venue {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}
.pin-report-optional {
    font-weight: 400;
    opacity: 0.7;
}
.venue-stats-row {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    border-top: 0.5px solid var(--border-color);
    border-bottom: 0.5px solid var(--border-color);
    margin: 12px 0;
}
.venue-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.venue-stat .vs-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.venue-stat .vs-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.venue-mini-map {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg-secondary);
}
.venue-events-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.venue-event-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 0.5px solid var(--border-color);
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 6px;
}
.venue-event-row:last-child { border-bottom: none; }
.venue-event-row:hover { background: var(--bg-secondary); padding-left: 6px; }
.venue-event-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 46px;
    text-align: center;
    background: rgba(59,130,246,0.08);
    border-radius: 6px;
    padding: 4px 0;
    flex-shrink: 0;
}
.venue-event-info { flex: 1; min-width: 0; }
.venue-event-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.venue-event-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1px;
}
.venue-event-engagement {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Event Actions Row (Share & Calendar) */
.event-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.action-btn:active {
    transform: scale(0.97);
}

.modal-feature-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.modal-feature-link:hover {
    background-color: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* ----------------------------------------
   Engagement Section (Modal)
   ---------------------------------------- */
.engagement-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.engagement-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.vote-section {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.vote-btn svg {
    width: 20px;
    height: 20px;
}

.vote-btn:hover {
    background-color: var(--bg-tertiary);
}

.upvote-btn:hover,
.upvote-btn.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background-color: rgba(102, 126, 234, 0.08);
}

.downvote-btn:hover,
.downvote-btn.active {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background-color: rgba(231, 76, 60, 0.08);
}

.favorite-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-left: auto;
    transition: all var(--transition-fast);
}

.favorite-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background-color: rgba(231, 76, 60, 0.08);
}

.favorite-btn.favorited {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background-color: rgba(231, 76, 60, 0.1);
}

/* Auth Required Overlay */
.auth-required-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

body.dark-mode .auth-required-overlay {
    background: rgba(10, 10, 15, 0.85);
}

.auth-required-message {
    text-align: center;
    padding: 24px;
}

.auth-required-message h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-required-message p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-required-btn {
    padding: 10px 28px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.auth-required-btn:hover {
    opacity: 0.92;
}

/* ----------------------------------------
   Comments Section
   ---------------------------------------- */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.comments-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.comment-input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-input::placeholder {
    color: var(--text-tertiary);
}

.comment-input:focus {
    border-color: var(--accent-primary);
}

.comment-submit-btn {
    padding: 0 18px;
    height: 40px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

.comment-submit-btn:hover {
    opacity: 0.92;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment {
    padding: 12px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: 8px;
}

.comment-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.comment-delete-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--accent-red);
}

.comment-delete-btn svg {
    width: 14px;
    height: 14px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.comment-report-btn,
.comment-block-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.comment-report-btn:hover {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--accent-orange);
}

.comment-block-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--accent-red);
}

.comment-report-btn svg,
.comment-block-btn svg {
    width: 14px;
    height: 14px;
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.no-comments {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 16px 0;
    font-style: italic;
}

/* ----------------------------------------
   Settings Modal
   ---------------------------------------- */
.settings-modal {
    padding: 28px 24px;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 4px;
}

.setting-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.setting-description {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-top: 4px;
    padding-left: 28px;
}

.setting-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.setting-select:focus {
    border-color: var(--accent-primary);
}

.setting-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast);
    margin-bottom: 4px;
}

.setting-input::placeholder {
    color: var(--text-tertiary);
}

.setting-input:focus {
    border-color: var(--accent-primary);
}

.settings-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 100%;
    transition: all var(--transition-fast);
}

.settings-action-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.settings-action-btn:active {
    transform: scale(0.98);
}

.settings-action-btn.danger {
    color: var(--accent-red);
    border-color: rgba(231, 76, 60, 0.3);
}

.settings-action-btn.danger:hover {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: var(--accent-red);
}

.settings-action-btn.danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.danger-zone-confirm {
    margin-top: 12px;
    padding: 16px;
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-md);
}

.danger-zone-confirm p {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.danger-zone-actions {
    display: flex;
    gap: 8px;
}

/* Profile Picture Upload */
.profile-picture-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.profile-picture-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.profile-picture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-preview svg {
    color: var(--text-tertiary);
}

.upload-picture-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-primary);
    background-color: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all var(--transition-fast);
}

.upload-picture-btn:hover {
    background-color: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

/* ----------------------------------------
   Share Modal
   ---------------------------------------- */
.share-modal {
    padding: 28px 24px;
}

.share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.8125rem;
    outline: none;
    min-width: 0;
}

.copy-link-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 42px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.copy-link-btn:hover {
    opacity: 0.92;
}

.share-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.share-social-btn:hover {
    background-color: var(--bg-tertiary);
}

.share-social-btn:active {
    transform: scale(0.98);
}

.share-social-btn.twitter-btn:hover {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-social-btn.whatsapp-btn:hover {
    border-color: #25D366;
    color: #25D366;
}

.share-social-btn.facebook-btn:hover {
    border-color: #1877F2;
    color: #1877F2;
}

/* Share Event Modal (dynamically created) */
.share-event-modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.share-modal-close {
    /* inherits .modal-close styles */
}

/* ----------------------------------------
   Image Overlay (Full Screen)
   ---------------------------------------- */
.image-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background-color: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    animation: fadeIn 0.2s ease-out;
}

.image-overlay-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.image-overlay-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.image-close-btn {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: white;
    transition: background-color var(--transition-fast);
}

.image-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ----------------------------------------
   Error Banner
   ---------------------------------------- */
.error-banner {
    background-color: rgba(231, 76, 60, 0.1);
    border-bottom: 1px solid rgba(231, 76, 60, 0.2);
    padding: 10px 16px;
    animation: errorBannerSlideDown 0.3s ease-out;
}

@keyframes errorBannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.875rem;
    color: var(--accent-red);
}

.error-banner-content span {
    flex: 1;
}

.error-banner-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
}

.error-banner-close:hover {
    background-color: rgba(231, 76, 60, 0.15);
}

/* ----------------------------------------
   PWA Install Banner
   ---------------------------------------- */
.pwa-install-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    z-index: 4000;
    background-color: var(--bg-modal);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-area-bottom));
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.pwa-banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-text h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.pwa-banner-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pwa-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install-btn {
    padding: 8px 20px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

.pwa-install-btn:hover {
    opacity: 0.92;
}

.pwa-dismiss-btn {
    padding: 6px 20px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    text-align: center;
    transition: color var(--transition-fast);
}

.pwa-dismiss-btn:hover {
    color: var(--text-secondary);
}

/* ----------------------------------------
   Leaflet Marker Cluster Overrides
   ---------------------------------------- */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(102, 126, 234, 0.3) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: var(--accent-gradient) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
}

/* Zoom/near-me controls: fixed to the viewport so they stay put regardless of map height,
   and positioned comfortably above the floating bottom nav pill. */
@media (max-width: 767px) {
    .leaflet-bottom.leaflet-right {
        position: fixed !important;
        bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 12px) !important;
        right: 10px !important;
        z-index: 800 !important;
    }
}

/* Hide Leaflet attribution text */
.leaflet-control-attribution {
    display: none !important;
}

/* Leaflet zoom control dark mode */
body.dark-mode .leaflet-control-zoom a {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .leaflet-control-zoom a:hover {
    background-color: var(--bg-secondary);
}

body.dark-mode .leaflet-control-attribution {
    background-color: rgba(10, 10, 15, 0.7);
    color: var(--text-tertiary);
}

body.dark-mode .leaflet-control-attribution a {
    color: var(--text-secondary);
}

/* Dark mode map tiles - subtle invert for darker appearance */
body.dark-mode .leaflet-tile-pane {
    filter: brightness(0.7) contrast(1.2) saturate(0.3);
}

/* ----------------------------------------
   Scrollbar Styles
   ---------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ----------------------------------------
   Responsive Design
   ---------------------------------------- */

/* Small phones */
@media (max-width: 374px) {
    .pwa-banner-content {
        flex-wrap: wrap;
    }

    .pwa-banner-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }

    .share-link-container {
        flex-direction: column;
    }

    .event-actions-row {
        flex-direction: column;
    }
}

/* Tablets */
@media (min-width: 768px) and (pointer: fine) {
    .events-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 20px 20px;
    }

    .event-card-image {
        height: 200px;
    }

    .header-content {
        padding: 0 24px;
    }

    .header-controls {
        right: 24px;
    }

    .search-container {
        padding: 8px 24px 12px;
        max-width: 600px;
        margin: 0 auto;
    }

    .view-toggle {
        padding: 10px 24px;
    }

    .modal-content {
        max-width: 540px;
    }

    .user-menu-dropdown {
        right: 24px;
    }

    .sponsored-banner {
        max-width: 400px;
    }

    .lazy-load-sentinel {
        grid-column: 1 / -1;
    }

    .empty-state {
        grid-column: 1 / -1;
    }
}

/* Desktop — pointer:fine + hover:hover ensures this never triggers on touch/mobile */
@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
    /* Combined nav offset: fixed header + fixed view-toggle strip below it */
    :root {
        --desktop-view-toggle-height: 52px;
        --desktop-nav-offset: calc(var(--header-height) + var(--desktop-view-toggle-height));
    }

    /* ---- Fixed floating header ---- */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-bottom: none;
        box-shadow: none;
        /* Hand glass effect to the single nav-backdrop element */
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Dark mode: override body.dark-mode .header which has higher specificity */
    body.dark-mode .header {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-bottom: none;
    }

    /* Kill the specular-highlight pseudo, compositing hint, and clip boundary */
    .header::after { display: none; }
    .header { overflow: visible; will-change: auto; }

    /* Activate single nav-backdrop: header + view-toggle + chip bar */
    .nav-backdrop {
        display: block;
        height: calc(var(--desktop-nav-offset) + var(--chip-bar-height));
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 6px 32px rgba(0, 0, 0, 0.04);
    }

    body.dark-mode .nav-backdrop {
        border-bottom-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 6px 32px rgba(0, 0, 0, 0.2);
    }

    /* ---- Fixed floating view-toggle strip ---- */
    /* Transparent — nav-backdrop provides the glass effect for the whole nav area */
    .view-toggle {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 24px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        box-shadow: none;
    }

    /* Sidebar toggle: left-aligned, separated from the centered view buttons */
    .desktop-sidebar-toggle {
        display: inline-flex;
        position: absolute;
        left: 24px;
    }

    /* Show the split view button only on desktop */
    .desktop-split-btn {
        display: inline-flex;
    }

    /* Push all page content below header + view-toggle + chip bar */
    .app-container {
        padding-top: calc(var(--desktop-nav-offset) + var(--chip-bar-height));
        transition: padding-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Sidebar removed — chip bar replaced it */

    .events-list {
        grid-template-columns: repeat(3, 1fr);
        max-width: none;
        margin: 0;
        padding: 0 24px 24px;
    }

    .list-controls {
        max-width: none;
        margin: 0;
        padding: 8px 24px;
    }

    /* Remove tablet centering on the search bar */
    .search-container {
        max-width: none;
        margin: 0;
    }

    .map-view #map,
    #map {
        height: calc(100vh - var(--desktop-nav-offset) - var(--chip-bar-height) - 60px);
    }

    /* Chip bar joins the desktop glass nav: fixed below the view-toggle strip,
       transparent so the nav-backdrop glass effect covers it uniformly. */
    .filter-chip-bar {
        position: fixed;
        top: var(--desktop-nav-offset);
        left: 0;
        right: 0;
        z-index: 998;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        justify-content: center;
    }

    /* ---- Desktop Floating Sidebar (removed — chip bar replaced it) ---- */
    .desktop-app-layout {
        display: block;
    }

    .desktop-filter-sidebar {
        display: block;
        position: fixed;
        top: var(--desktop-nav-offset);
        left: 0;
        z-index: 500;
        width: 260px;
        height: calc(100vh - var(--desktop-nav-offset));
        overflow-y: auto;
        padding: 1.25rem 1.25rem 2rem;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-right: 0.5px solid rgba(0, 0, 0, 0.08);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.08), 1px 0 0 rgba(255, 255, 255, 0.6) inset;
        transform: translateX(0);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
    }

    .desktop-filter-sidebar.sidebar-collapsed {
        transform: translateX(-100%);
        box-shadow: none;
    }

    body.dark-mode .desktop-filter-sidebar {
        background: rgba(14, 14, 22, 0.94);
        border-right-color: rgba(255, 255, 255, 0.06);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
    }

    .sidebar-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .sidebar-filters-heading {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 0;
        color: var(--text-primary);
    }

    .sidebar-close-btn {
        opacity: 0.5;
        transition: opacity 0.15s;
    }
    .sidebar-close-btn:hover {
        opacity: 1;
    }

    .desktop-filter-sidebar .filter-section {
        margin-bottom: 1.25rem;
    }

    .desktop-filter-sidebar .filter-section-title {
        font-size: 0.8125rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-tertiary);
        margin-bottom: 0.625rem;
    }

    .desktop-filter-sidebar .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .desktop-filter-sidebar .filter-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .desktop-main-content {
        width: 100%;
        min-width: 0;
    }

    /* Center the list view content without constraining map/split */
    .desktop-main-content > .list-view {
        max-width: 1400px;
        margin: 0 auto;
    }

    /* Hide mobile filter toggle on desktop — sidebar toggle replaces it */
    .filter-toggle-btn {
        display: none;
    }

    /* ---- Split View ---- */
    .desktop-main-content.split-view-active {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
    }

    .desktop-main-content.split-view-active .map-view {
        display: block !important;
        flex: 1;
        min-width: 0;
        border-right: 1px solid var(--border-color);
    }

    .desktop-main-content.split-view-active .map-view #map {
        height: calc(100vh - var(--desktop-nav-offset) - 60px);
    }

    .desktop-main-content.split-view-active .list-view {
        display: block !important;
        flex: 1;
        min-width: 0;
        overflow-y: auto;
        height: calc(100vh - var(--desktop-nav-offset) - 60px);
    }

    /* In split view, show a single column to fit the narrower panel */
    .desktop-main-content.split-view-active .events-list {
        grid-template-columns: 1fr;
    }
}

/* Large desktop */
@media (min-width: 1400px) and (hover: hover) and (pointer: fine) {
    .events-list {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1400px;
    }

    .list-controls {
        max-width: 1400px;
    }
}

/* ----------------------------------------
   Reduced Motion
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----------------------------------------
   Selection & Focus Styles
   ---------------------------------------- */
::selection {
    background-color: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ----------------------------------------
   Skeleton Loaders
   ---------------------------------------- */
@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%);
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

.skeleton-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    border-radius: 4px;
    background: linear-gradient(90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%);
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

.skeleton-line.short  { height: 12px; width: 40%; }
.skeleton-line.title  { height: 18px; width: 85%; }
.skeleton-line.medium { height: 12px; width: 65%; }

/* Distance badge on cards */
.distance-row {
    color: var(--accent-primary);
    font-weight: 500;
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */
@media print {
    .header,
    .view-toggle,
    .search-container,
    .map-view,
    .pwa-install-banner,
    .sponsored-banner,
    .card-engagement,
    .engagement-section {
        display: none !important;
    }

    .events-list {
        display: block;
    }

    .event-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 12px;
    }
}

/* ----------------------------------------
   Pull-to-Refresh Indicator
   ---------------------------------------- */
.pull-refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: height 0.1s ease, opacity 0.1s ease;
    background: transparent;
}

.pull-refresh-indicator.ready .pull-refresh-label {
    color: var(--accent-primary);
}

.pull-refresh-indicator.refreshing .pull-refresh-label {
    color: var(--accent-primary);
}

.pull-refresh-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
}

.pull-refresh-indicator.refreshing .pull-refresh-spinner {
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pull-refresh-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ----------------------------------------
   Cluster Hover Tooltip
   ---------------------------------------- */
.cluster-hover-tooltip {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    display: none;
    transform: translate(-50%, calc(-100% - 16px));
}

.cluster-tooltip-inner {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 10px 14px;
    min-width: 160px;
    max-width: 240px;
}

.cluster-tooltip-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cluster-tooltip-list li {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.cluster-tooltip-more {
    color: var(--accent-primary) !important;
    font-weight: 600;
}

/* ----------------------------------------
   Calendar Dropdown (Add to Calendar)
   ---------------------------------------- */
.calendar-dropdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.cal-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-align: left;
    width: 100%;
}

.cal-option:hover {
    background: var(--bg-secondary);
}

/* ----------------------------------------
   Get Directions Button in Event Modal
   ---------------------------------------- */
.modal-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.08);
    border: 1px solid rgba(var(--accent-primary-rgb, 59, 130, 246), 0.2);
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.modal-directions-btn:hover {
    background: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.15);
    border-color: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.35);
}

/* ========================================
   Feature: Category Image Placeholders
   ======================================== */
.category-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
}
.event-card-image.category-placeholder {
    height: 160px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.placeholder-emoji {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    user-select: none;
}
.placeholder-emoji.large {
    font-size: 3.5rem;
}
/* Modal placeholder image */
.modal-placeholder-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0;
}

/* ========================================
   Feature: Recurring Badge
   ======================================== */
.recurring-badge {
    display: inline-block;
    background: rgba(99,102,241,0.12);
    color: #818cf8;
    border: 1px solid rgba(99,102,241,0.28);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    white-space: nowrap;
}
.modal-recurring-badge {
    display: block;
    margin-bottom: 8px;
}

/* ========================================
   Feature: "Now" filter button highlight
   ======================================== */
.filter-btn.date-btn.now-btn {
    background: rgba(251,191,36,0.12);
    color: #f59e0b;
    border-color: rgba(251,191,36,0.3);
}
.filter-btn.date-btn.now-btn.active {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

/* ========================================
   Feature: Near Me map button
   ======================================== */
.near-me-control {
    margin-bottom: 10px !important;
}
.near-me-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-modal, #fff);
    border: none;
    cursor: pointer;
    color: var(--text-primary, #333);
    padding: 0;
    transition: color 0.15s;
}
.near-me-btn:hover {
    color: var(--accent-primary, #3b82f6);
}
/* User location pulsing dot */
.user-location-marker {
    background: transparent !important;
    border: none !important;
}
.user-location-dot {
    position: relative;
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.4);
}
.user-location-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: rgba(59,130,246,0.25);
    animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
    0%   { transform: scale(0.6); opacity: 0.9; }
    80%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Map toast notification */
.map-toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height, 56px) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(20,20,30,0.92);
    color: #f0f0f5;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 9900;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}
.map-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Feature: Similar Events section
   ======================================== */
.similar-events-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.similar-events-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.similar-events-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.similar-events-scroll::-webkit-scrollbar {
    display: none;
}
.similar-event-card {
    flex: 0 0 140px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.similar-event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.similar-card-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}
.similar-card-img.category-placeholder {
    height: 80px;
}
.similar-card-img.category-placeholder .placeholder-emoji {
    font-size: 1.8rem;
}
.similar-card-body {
    padding: 7px 8px 8px;
}
.similar-card-cat {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 3px;
}
.similar-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.similar-card-date {
    font-size: 0.68rem;
    color: var(--text-secondary);
}
