/* This is the container in your spot.html */
#dynamic-header-container {
    position: fixed;
    /* This makes it sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Higher than charts and cards */
    display: flex;
    justify-content: center;
}

/* overlay.css - Consolidated Overlay Menu + Header Navigation Styles */
/* Loaded last on spot.html → overrides earlier files */

/* Header & Sticky Elements */
#dynamic-header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Above charts/cards */
    display: flex;
    justify-content: center;
}

header,
.top-divider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 25, 47, 0.15);
    backdrop-filter: blur(10px);
}

header,
.top-content {
    padding: 15px 30px;
    box-sizing: border-box;
}

header.scrolled,
.top-divider.scrolled {
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
}

header.scrolled .logo,
.top-divider.scrolled .logo {
    background: rgba(100, 255, 218, 0.12);
}

header.scrolled .menu-toggle,
.top-divider.scrolled .menu-toggle {
    background: rgba(100, 255, 218, 0.15);
}

/* Menu Toggle Button */
.menu-toggle {
    margin-left: auto;
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 12px 30px;
    border-radius: 50px;
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(100, 255, 218, 0.15);
    color: white;
    transform: scale(1.05);
}

.menu-toggle:active {
    transform: scale(0.98);
}

/* Overlay Menu Container */
.overlay-menu {

    inset: 0;
    z-index: 2000;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 25, 47, 0.98);
    /* ← restored dark semi-transparent */
    backdrop-filter: blur(12px);
    /* ← restored glass effect */
    z-index: 10000;
    transform: translateY(-100%);
    visibility: hidden;
    opacity: 0;
    transition: all 0.6s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.2rem;
    padding-top: 90px;
    padding-bottom: 110px;
    overflow-y: auto;
    box-sizing: border-box;
}

.overlay-menu.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
}

/* Menu Links Base */
.overlay-menu a {
    font-family: var(--font-main);
    font-size: 2rem;
    color: var(--text-bright);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.4s ease;
}

/* Highest-specificity ACTIVE highlight (current page) */
body.menu-open .overlay-menu a.active,
.overlay-menu#navMenu a.active,
nav.overlay-menu a.active,
.overlay-menu a.active:hover,
.overlay-menu a.active:focus {
    color: var(--accent) !important;
    border-left: 8px solid var(--accent) !important;
    padding-left: 24px !important;
    font-weight: 900 !important;
    text-shadow: 0 0 12px rgba(100, 255, 218, 0.7) !important;
    background: linear-gradient(to right, rgba(100, 255, 218, 0.08), transparent) !important;
    transform: translateX(10px) !important;
    transition: all 0.4s ease !important;
}

/* Hover / Focus for all links */
.overlay-menu a:hover,
.overlay-menu a:focus {
    color: var(--accent) !important;
    transform: translateX(12px) !important;
    text-shadow: 0 0 15px rgba(100, 255, 218, 0.5) !important;
}

/* Close Button */
.menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 4rem;
    color: var(--accent);
    background: rgba(10, 25, 47, 0.6);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
}

.menu-close:hover {
    background: var(--accent);
    color: var(--bg);
    transform: rotate(90deg) scale(1.1);
}

/* Raise the entire header/menu layer way above content on all screens */
#dynamic-header-container,
header,
.top-divider,
#top-header,
.top-content,
.session-control-bar {
    /* add if you have this class */
    z-index: 999999 !important;
    /* extremely high */
    pointer-events: auto !important;
}

.top-content {
    display: flex;
    flex-wrap: nowrap;
    /* Prevent stacking at all costs */
    align-items: center;
    justify-content: space-between;
    width: 100%;
    overflow: hidden;
    /* Safety net */
}

/* Isolate the button from any overlap */
.menu-toggle {
    position: relative !important;
    z-index: 1000000 !important;
    pointer-events: auto !important;
    isolation: isolate !important;
    /* creates new stacking context – helps a lot */
}

.header-center {
    flex: 1 1 auto;
    /* Give the center the most flexibility */

    justify-content: center;
    flex: 0 1 40%;
    /* It can grow to 40% of the bar, but it is allowed to shrink (1) */
    min-width: 0;
    /* Crucial: allows flex-item to shrink below its content size */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header-right {
    flex: 0 0 auto;
    /* Grow: 0, Shrink: 0 - THIS PROTECTS THE MENU */
}

/* Optional: force no overlap from content on very small screens */
@media (max-width: 500px) {

    .data-grid,
    .stat-card,
    .ms-display,
    /* wind number area */
    .live-indicator,
    /* LIVE VIND dot */
    [style*="position: absolute"],
    /* any absolute positioned stuff */
    .big-gauge-container {
        /* if your circle has a wrapper class */
        pointer-events: none !important;
        /* content ignores mouse */
        z-index: 1 !important;
        /* definitely below header */
    }
}

/* The 'Teal Ball' hover effect you're missing */
.menu-toggle:hover {
    background: var(--accent);
    color: var(--deep-bg);
    box-shadow: 0 0 20px var(--accent);
    /* This creates the 'ball shaped thingy' glow */
    border-color: var(--accent);
}

/* Force the button to say LUK or show an X when menu is open */
body.menu-open .menu-toggle {
    background: var(--accent) !important;
    color: var(--deep-bg) !important;
    box-shadow: 0 0 15px var(--accent);
}

body.menu-open .menu-toggle::before {
    content: 'LUK';
    /* Forces the text to change via CSS if JS fails */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Make button bigger/easier to hit on mobile */
@media (max-width: 500px) {
    .menu-toggle {
        min-width: 80px;
        /* Reduced to leave room for selector */
        padding: 8px 16px;
        font-size: 10px;
    }
}

@media (max-width: 340px) {
    .menu-toggle {
        min-width: 60px;
        padding: 6px 10px;
        font-size: 9px;
    }
}

/* Body when menu open */
body.menu-open {
    overflow: hidden;
}

/* Media Queries – menu adjustments */
@media (max-height: 700px) {
    .overlay-menu {
        padding-top: 50px;
        padding-bottom: 25px;
    }

    .overlay-menu a {
        margin: 6px 0;
        line-height: 1.14;
    }
}

@media (max-height: 670px) {
    .overlay-menu a {
        margin: 5px 0;
        line-height: 1.12;
    }
}

@media (max-width: 480px) {
    section:not(#home) {
        padding: 110px 15px 70px;
    }
}

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100%;
    }

    header,
    .top-content {
        padding: 10px 4px !important;
        /* Maximizing screen space on the edges */
    }

    /* 1. Single-Line Layout: Squeeze everything on one row */
    .top-content {
        display: flex !important;
        flex-wrap: nowrap !important;
        /* CRITICAL: Prevent dropping to second row */
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        /* Reduced gap to save horizontal space */
        width: 100% !important;
        max-width: 100vw !important;
        /* Bound strictly to viewport */
        min-width: 0 !important;
        /* Force flex child to be shrinkable if nested */
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* 2. Top row items (Logo and Menu button) forced to squeeze */
    .header-left {
        flex: 0 1 auto;
        /* Allow shrinking */
        min-width: 0 !important;
        overflow: hidden;
    }

    .header-right {
        flex: 0 0 auto;
        /* Protect the menu button from shrinking too much, but bound it */
        min-width: 0 !important;
        max-width: 30vw;
        /* Hard limit on menu size so it never pushes off screen */
    }

    /* 3. Center item (Selector) takes up remaining space and shrinks aggressively */
    .header-center {
        flex: 1 1 0% !important;
        /* Force true fluid flex basis (zero) */
        max-width: 40vw !important;
        /* STRICT CLAMP FOR SAFARI BUG */
        width: 100%;
        box-sizing: border-box !important;
        justify-content: center;
        margin-top: 0;
        min-width: 0 !important;
        /* CRITICAL for flex shrinking */
        padding: 0;
        overflow: hidden;
    }

    /* 4. Hide "SESSION:" text */
    .header-center .session-label {
        display: none;
    }

    /* 5. Constrain the selector wrapper so it acts like a squishy container */
    .header-center .selector-wrapper {
        width: 100%;
        max-width: 40vw !important;
        /* STRICT CLAMP */
        margin: 0 auto;
        min-width: 0 !important;
        /* CRITICAL: Prevents flex child from refusing to shrink */
        box-sizing: border-box !important;
        overflow: hidden !important;
        display: flex;
    }

    #spot-selector-top {
        flex: 1 1 100%;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .header-center select {
        width: 100%;
        min-width: 0;
        appearance: none;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        padding: 2px 15px 2px 5px;
        /* Extremely tight padding to combat large 16px font */
        text-align: center;
        text-align-last: center;
        font-size: 16px !important;
        /* CRITICAL: Prevent iOS native auto-zoom on focus */
        font-weight: 700;
        letter-spacing: 0px;
        line-height: normal;
        height: auto;
        /* Remove hardcoded 30px height to prevent text clipping */
    }

    /* Reposition the custom dropdown chevron to match the centered text */
    .header-center .selector-wrapper i {
        right: 15px;
    }

    /* 4. Ensure the logo doesn't hog space */
    .logo-container {
        padding: 2px 6px !important;
    }

    .logo-blue,
    .logo-white {
        font-size: 0.80rem !important;
        letter-spacing: 1px !important;
    }

    /* 4.5. Ensure the MENU button doesn't hog space */
    .menu-toggle {
        min-width: 0 !important;
        padding: 5px 10px !important;
        font-size: 0.65rem !important;
        letter-spacing: 1px !important;
        /* CRITICAL SPACE SAVER */
    }
}

/* Adjust body padding for single-tier mobile header */
@media (max-width: 768px) {
    body {
        padding-top: 80px !important;
    }
}