/* ==========================================================================
   spot.css – Dashboard & Spot Guide Specifics
   ========================================================================== */

/* === 1. General Layout & Grid === */

.main-wrapper {
    max-width: 1400px;
    margin: 20px auto 40px;
    /* reduced from 40px top */
    padding: 0 20px;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Explicit 3 equal columns – no minmax/auto-fit issues */
    gap: 24px;
    padding: 20px 0;
    /* Remove side padding if container already handles it */
    max-width: 1400px;
    margin: 0 auto;
    grid-auto-rows: minmax(340px, auto);
    /* Rows at least as tall as cards */
}

.stat-card {
    /* Core appearance – merged & improved */
    background: var(--card-glass);
    /* or keep rgba(13, 25, 48, 0.92) for slightly more opacity */
    border: 1px solid rgba(100, 255, 218, 0.15);
    /* middle ground between 0.12 and 0.2 */
    border-radius: 18px;
    /* compromise between 15px and 20px – looks modern */
    padding: 24px;
    /* clean single value; was 28px 24px → feels balanced */
    position: relative;
    overflow: hidden;
    min-height: 340px;
    /* keep – good for layout stability */

    /* Subtle glow + hover interaction */
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.06);
    transition: all 0.35s ease;
    /* slightly longer for smoother feel */
    backdrop-filter: blur(10px);
    /* keep glass effect */
}

/* Optional: nice hover/focus state */
.stat-card:hover,
.stat-card:focus-within {
    box-shadow: 0 0 25px rgba(100, 255, 218, 0.18);
    transform: translateY(-4px);
    border-color: rgba(100, 255, 218, 0.35);
}

/* Full-width variant override (already in common.css – no change needed) */
.stat-card.full-width {
    grid-column: 1 / -1 !important;
}

/* === 2. Typography & Labels === */

.label {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.68rem;
    color: var(--accent-mint);
    letter-spacing: 3px;
    display: block;
    margin-bottom: 22px;
    text-transform: uppercase;
    opacity: 0.95;
}

/* spot.css */
.ms-value {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--accent-mint);
    /* REMOVE THIS LINE */
    margin: 15px 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: -2px;
}

.ms-unit {
    font-size: 1.3rem;
    color: #a3c9ff;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

/* === 3. Status Badges === */

.wind-status,
.wind-badge {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    white-space: nowrap;
}

.status-good {
    background: rgba(100, 255, 218, 0.12);
    color: var(--accent-mint);
    border: 1px solid rgba(100, 255, 218, 0.35);
}

.status-bad {
    background: rgba(255, 77, 77, 0.12);
    color: var(--danger-red);
    border: 1px solid rgba(255, 77, 77, 0.35);
}

.status-mid {
    background: rgba(255, 183, 77, 0.12);
    color: var(--warning-orange);
    border: 1px solid rgba(255, 183, 77, 0.35);
}

/* === 4. Wind Card – Text Left | Compass Right === */

#wind-card .stat-card-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    margin-top: 12px;
}

.wind-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.arrow-container {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.cardinal-label {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Syncopate', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-mint);
    white-space: nowrap;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}

/* Wind direction text (OFFSHORE etc.) */
#wind-dir-container {
    margin-top: 38px;
    width: 100%;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ff8a80;
    padding: 10px 0;
}

/* === 5. Mobile – Stack everything centered === */

@media (max-width: 768px) {
    #wind-card .stat-card-inner {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .wind-text-content {
        align-items: center;
        text-align: center;
    }

    .wind-direction-wrapper {
        margin-left: 0;
    }

    .ms-value {
        font-size: 3.8rem;
    }
}


/* Chart container */
.chart-stat-card {
    grid-column: 1 / -1;
    padding: 24px;
}

#windChart {
    max-height: 240px !important;
}

.wind-direction-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#compass-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.compass-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    /* Sikrer at Nord er opad */
}

/* Tilføj bogstaver manuelt hvis SVG ikke indeholder dem */
.compass-letter {
    position: absolute;
    font-family: 'Syncopate', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

#wind-arrow {
    transform-origin: center;
    font-size: 3.2rem;
    color: var(--accent-mint);
    transition: transform 0.4s ease;
    /* Juster denne hvis pilen peger 45 grader forkert i forhold til teksten */
    display: inline-block;
}

/* Gør farveskiftet blødt på vind-tallene */
#ms-val,
#gust-val {
    transition: color 0.5s ease;
    /* Valgfrit: Tilføj et diskret glow der følger farven */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    display: inline-block;
}

/* Sikrer at enhederne (M/S) ikke skifter farve, medmindre du ønsker det */
.ms-unit {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Right side: Dropdown group */
.selector-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px
}

#spot-selector-top {
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    color: #64ffda;
    /* Teal text */
    border: 1px solid rgba(100, 255, 218, 0.4);
    padding: 10px 40px 10px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.session-label {
    font-size: 0.65rem;
    color: var(--accent-mint);
    /* */
    letter-spacing: 2px;
    font-weight: bold;
    margin-bottom: 2px;
}

.top-divider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 9999;
    background: rgba(10, 25, 47, 0.15);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
}

.menu-toggle {
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
}

.top-divider.scrolled {
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}


.session-info {
    display: flex;
    flex-direction: column;
}

#spot-name-header {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-family: 'Syncopate', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Stacks the 7-day forecast cards vertically on small screens */
@media (max-width: 768px) {
    #forecast-container {
        display: grid;
        grid-template-columns: 1fr;
        /* Forces a single column layout */
        gap: 12px;
        /* Adds space between the stacked days */
    }

    .forecast-card {
        width: 100%;
        /* Ensures cards take full width when stacked */
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: stack 1 column */
@media (max-width: 768px) {
    .main-wrapper {
        width: 100%;
        box-sizing: border-box;
        margin: 20px auto 40px;
        padding: 0 15px;
    }

    .data-grid {
        grid-template-columns: 1fr;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
        gap: 20px;
        padding: 10px 0;
    }

    .spot-details-section {
        width: 100%;
        box-sizing: border-box;
        margin: 40px auto 0;
        flex-direction: column;
    }
}

@media (max-width: 480px) {

    /* 1. Remove rigid constraints on the grid */
    .data-grid {
        grid-template-columns: 1fr;
        /* Force single column */
        padding: 10px;
        /* Reduce side gap to save space */
        gap: 15px;
        overflow-x: hidden;
        /* Prevent horizontal scrolling */
    }

    /* 2. Make cards fully fluid */
    .stat-card {
        min-width: 0 !important;
        /* Overrides any rigid minimums */
        width: 100%;
        /* Forces card to match parent width */
        padding: 20px 15px !important;
        /* Narrower internal padding */
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        /* Includes padding in the 100% width */
    }

    /* 3. Ensure internal content wraps */
    .stat-card * {
        max-width: 100%;
        word-wrap: break-word;
    }

    /* 4. OVERRIDE INLINE FLEX: Force inner sections to wrap and stack on nano-screens */
    .stat-card>div[style*="display: flex"] {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .stat-card>div[style*="display: flex"]>div {
        flex: 1 1 100% !important;
        /* Forces left (text) and right (compass) to stack if they don't fit */
        text-align: center !important;
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Center the wind status badge specifically */
    #wind-status-container,
    .ms-display {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Ensure canvases shrink */
    .stat-card canvas {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 5. Force ALL remaining wide containers to wrap */
    .forecast-legend,
    .lift-actions,
    .sun-container,
    .water-level-box {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* 6. Break rigid text boxes so they don't force a minimum document width */
    .wind-status,
    .mini-share,
    .cardinal-label {
        white-space: normal !important;
        height: auto !important;
        text-align: center;
    }
}

/* 7. Extreme micro-screen safety net (under 330px) */
@media (max-width: 330px) {
    .main-wrapper {
        padding: 0 5px !important;
    }

    .stat-card {
        padding: 15px 5px !important;
    }

    .ms-value,
    .current-level {
        font-size: 3.2rem !important;
        /* Scale down the giant numbers so they don't break the layout */
    }

    .wind-direction-wrapper {
        width: 80px !important;
        height: 80px !important;
    }

    #wind-arrow {
        font-size: 1.6rem !important;
    }
}

/* PUSH MAIN CONTENT DOWN */
body {
    padding-top: var(--header-height) !important;
}


@media (max-width: 768px) {

    /* Push the menu links higher up on mobile */
    body.menu-open .overlay-menu {
        padding-top: 120px !important;
    }

    /* Shrink the session control bar so it's less intrusive when menu is open */
    body.menu-open .session-control-bar {
        height: 50px !important;
        transition: all 0.3s ease;
    }

    /* Reduce spacing between links specifically for mobile */
    body.menu-open .overlay-menu nav {
        gap: 8px !important;
    }
}

/* Header all 4 in one sticky button */

/* Container adjustments */
.top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 96% !important;
    /* Ensure it spans the full bar */
    padding: 0 25px;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 1. Shrink the Logo */
.logo-container {
    text-decoration: none;
    display: flex;
    align-items: center;
    line-height: 1;
    /* Prevents invisible height from pushing it down */
}

.logo-blue,
.logo-white {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    /* Reduced from original size */
    letter-spacing: 1px;
}

/* Center Content Styles */
.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Space between "SESSION:" and the dropdown */
}

.header-center .session-label {
    margin: 0;
    white-space: nowrap;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    color: var(--accent-mint);
}

/* Selector Tweaks for Header fit */
.header-center .selector-wrapper {
    margin-top: 0;
    /* Remove top margins */
    min-width: 160px;
}

.header-center select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    padding: 6px 30px 6px 12px;
    font-size: 0.75rem;
    height: 34px;
}

/* Hide the old second bar if it still exists in your CSS */
.session-control-bar {
    display: none !important;
}

/* This legacy 480px block was removed to support the new two-tier flex layout in overlay.css */

.spot-details-section {
    display: flex;
    flex-direction: row;
    gap: 24px;
    /* Match data-grid gap */
    max-width: 1400px;
    /* Match data-grid */
    margin: 40px auto 0;
    /* Add top margin for separation; auto centers it */
    padding: 0 20px;
    /* Match data-grid */
}

.left-column,
.right-column {
    flex: 1;
    /* Equal growth for balanced columns */
    min-width: 0;
    /* Prevent overflow */
}

@media (max-width: 768px) {
    .spot-details-section {
        flex-direction: column;
        /* Stack on mobile to avoid narrow steps */
    }
}

/* Left empty - header content layout is exclusively managed by overlay.css */

/* Left empty - header element spacing managed by overlay.css */

.section-spacer {
    height: 18px;
    /* or 56px / 64px – test what feels best */
    /* Optional: subtle gradient or line if you want visual separation */
    /* background: linear-gradient(to bottom, transparent, rgba(100,255,218,0.04)); */
}

/* Global Styling for Info Blocks */
.info-block {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-mint);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 0 12px 12px 0;
    transition: transform 0.3s ease;
}

.info-block:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.05);
}

.info-block h3 {
    color: var(--accent-mint);
    font-family: 'Syncopate', sans-serif;
    font-size: 0.8rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* spot.css update */

.forecast-legend span {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-dim);
    /* Uses your common.css variable */
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

/* spot.css */
.forecast-legend {
    display: flex !important;
    /* Force display */
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px auto;
    padding: 15px;
    background: rgba(100, 255, 218, 0.05);
    /* Light teal background */
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    width: fit-content;
    min-height: 50px;
    z-index: 100;
}

.forecast-legend span {
    color: #64ffda !important;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}



.action-btn {
    background: rgba(100, 255, 218, 0.1);
    /* Din optimal-farve */
    border: 1px solid #64ffda;
    color: #64ffda;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: #64ffda;
    color: #0d1930;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.4);
}


/* Fin level warning Cards */

/* Low tide / fin warning states */
.water-card-warning {
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.18), rgba(255, 87, 34, 0.10));
    border: 2px solid var(--warning-orange);
    box-shadow: 0 0 20px rgba(255, 183, 77, 0.35);
    transition: all 0.4s ease;
}

.water-card-warning .live-indicator {
    color: var(--warning-orange);
}

.water-card-warning .pulse-dot {
    background: var(--warning-orange);
    box-shadow: 0 0 0 rgba(255, 183, 77, 0.7);
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 183, 77, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(255, 183, 77, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 183, 77, 0);
    }
}



/* fin level warning finished */

/* ------------------------
   Data Disclaimer Tooltip
   ------------------------ */
.data-disclaimer-tooltip {
    position: relative;
    display: inline-block;
}

.data-disclaimer-tooltip .tooltip-icon:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.data-disclaimer-tooltip .tooltip-popup {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: 120%;
    /* Pop upwards vertically above the icon */
    right: 0;
    width: 200px;
    background: rgba(10, 20, 30, 0.95);
    color: #fff;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
    pointer-events: none;
    /* Stops the popup from blocking mouse exists */
}

/* Small triangle pointer for the tooltip */
.data-disclaimer-tooltip .tooltip-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    /* Arrow points down from the bottom of the box */
    right: 12px;
    /* Align with the icon position below */
    border-width: 6px;
    border-style: solid;
    border-color: rgba(10, 20, 30, 0.95) transparent transparent transparent;
}

/* Show tooltip on hover or active interaction */
.data-disclaimer-tooltip:hover .tooltip-popup,
.data-disclaimer-tooltip:active .tooltip-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}