/* ═══════ Base ═══════ */
html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg, #08020f); }
::-webkit-scrollbar-thumb { background: var(--accent-700, #9c0090); border-radius: 0; box-shadow: 0 0 6px var(--neon, #ff00ea); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-500, #ff00ea); }

/* ═══════ CRT Scanline Overlay (site-wide) ═══════ */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0)   0,
        rgba(0,0,0,0)   2px,
        rgba(0,0,0,0.10) 2px,
        rgba(0,0,0,0.10) 3px
    );
    mix-blend-mode: multiply;
}
/* Subtle vignette + screen-curvature feel */
.scanlines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}

/* ═══════ Mountain Background Scene ═══════ */
.mountain-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.mountain-scene > svg:not(.neon-sun):not(.grid-horizon) {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    filter: drop-shadow(0 0 6px var(--neon, #ff00ea));
}
.mountain-scene .stars {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 50%;
}
.mountain-scene .star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.4;
}
.mountain-scene .star.bright {
    opacity: 0.7;
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px var(--neon-secondary, #00f0ff);
}
@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.7; }
}
.mountain-scene .star.twinkle {
    animation: twinkle 3s ease-in-out infinite;
}
.mountain-scene .neon-sun {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-width: 38vw;
    filter: drop-shadow(0 0 14px var(--neon, #ff00ea)) drop-shadow(0 0 28px var(--sun-stop-2, #ff7700));
    opacity: 0.85;
}
.mountain-scene .grid-horizon {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 22vh;
    opacity: 0.35;
    filter: drop-shadow(0 -2px 8px var(--neon, #ff00ea));
}

/* ═══════ Neon Text Helper ═══════ */
.neon-text {
    text-shadow:
        0 0 4px var(--neon, #ff00ea),
        0 0 12px var(--neon, #ff00ea),
        0 0 24px var(--neon-secondary, #00f0ff);
    letter-spacing: 0.08em;
}

/* ═══════ Nav links (synthwave) ═══════ */
.nav-link {
    color: rgba(229, 231, 235, 0.7);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, text-shadow 0.15s ease, border-color 0.15s ease;
    letter-spacing: 0.1em;
}
.nav-link:hover {
    color: #fff;
    text-shadow: 0 0 6px var(--neon, #ff00ea);
}
.nav-link.active {
    color: #fff;
    border-bottom-color: var(--neon, #ff00ea);
    text-shadow: 0 0 6px var(--neon, #ff00ea), 0 0 12px var(--neon, #ff00ea);
}

/* ═══════ Glassmorphism (now neon-edged) ═══════ */
.glass {
    background: rgba(8, 2, 15, 0.68);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 234, 0.15);
}
[data-theme="synthwave-sunset"] .glass {
    background: rgba(22, 8, 18, 0.68);
    border-color: rgba(255, 107, 158, 0.18);
}
[data-theme="synthwave-glacier"] .glass {
    background: rgba(3, 16, 26, 0.68);
    border-color: rgba(0, 240, 255, 0.18);
}

/* ═══════ Animations ═══════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out both; }
.animate-fade-in    { animation: fadeIn 0.4s ease-out both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.30s; }

/* ═══════ Synth Button ═══════ */
.synth-btn {
    background: transparent;
    color: #fff;
    border: 2px solid var(--neon, #ff00ea);
    box-shadow: 0 0 8px var(--neon, #ff00ea), inset 0 0 8px rgba(255, 0, 234, 0.18);
    text-shadow: 0 0 4px var(--neon, #ff00ea);
    border-radius: 0;
    cursor: pointer;
}
.synth-btn:hover {
    background: var(--neon, #ff00ea);
    color: #fff;
    box-shadow: 0 0 14px var(--neon, #ff00ea), 0 0 28px var(--neon, #ff00ea);
    text-shadow: 0 0 6px #fff;
}

/* ═══════ Board Cards ═══════ */
.board-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.board-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon, #ff00ea) !important;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--neon, #ff00ea),
        0 0 18px rgba(255, 0, 234, 0.35);
}

/* ═══════ Score Ring ═══════ */
.score-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

/* ═══════ Data-completeness tooltip (Q2) ═══════ */
/* Show the factor breakdown when the user hovers the score-ring wrap OR
   focuses the warning badge via keyboard. The tooltip is positioned
   below-left of the ring so it can't overflow the right edge of a
   3-column grid card. */
.score-ring-wrap:hover .factor-tooltip,
.factor-badge:focus + .factor-tooltip,
.factor-badge:focus-visible + .factor-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.factor-tooltip {
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.score-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color, var(--neon, #ff00ea)) calc(var(--pct, 0) * 3.6deg),
        rgba(55, 65, 81, 0.5) calc(var(--pct, 0) * 3.6deg)
    );
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    box-shadow: 0 0 8px var(--ring-color, var(--neon, #ff00ea));
}

/* ═══════ Range Slider ═══════ */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #374151;
    outline: none;
    cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: var(--accent-500, #ff00ea);
    border: 2px solid #fff;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 0 8px var(--neon, #ff00ea);
}
.range-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 14px var(--neon, #ff00ea), 0 0 24px var(--neon, #ff00ea);
    transform: scale(1.15);
}
.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: var(--accent-500, #ff00ea);
    border: 2px solid #fff;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 0 8px var(--neon, #ff00ea);
}
.range-slider::-moz-range-thumb:hover {
    box-shadow: 0 0 14px var(--neon, #ff00ea), 0 0 24px var(--neon, #ff00ea);
    transform: scale(1.15);
}
.range-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: #374151;
}

/* ═══════ Table row hover ═══════ */
tbody tr { transition: background-color 0.15s ease; }

/* ═══════ Admin Tabs ═══════ */
.tab-btn {
    transition: color 0.15s ease, border-color 0.15s ease;
    color: #9ca3af;
    border-color: transparent;
}
.tab-btn:hover {
    color: white;
    border-color: #4b5563;
}
.tab-btn.active {
    color: white;
    border-color: var(--accent-500, #0c87f0);
}

/* ═══════ Stat Bars (usage analytics) ═══════ */
.stat-bar {
    border-radius: 4px;
    background: linear-gradient(to right, var(--accent-700, #0054a6), var(--accent-500, #0c87f0));
    transition: width 0.3s ease;
}

/* ═══════ Trip Planner ═══════ */
.resort-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.resort-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--neon, #ff00ea), 0 0 18px rgba(255, 0, 234, 0.3);
}

/* Snow condition badges */
.snow-badge-pow  { background: rgba(34, 197, 94, 0.2); color: #4ade80; border-radius: 4px; }
.snow-badge-fresh { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-radius: 4px; }
.snow-badge-light { background: rgba(156, 163, 175, 0.15); color: #9ca3af; border-radius: 4px; }
.snow-badge-dry   { background: rgba(75, 85, 99, 0.15); color: #6b7280; border-radius: 4px; }

/* Distance badge */
.distance-badge {
    font-variant-numeric: tabular-nums;
}

/* Leaflet overrides for dark theme */
#resort-map { background: #111827; }
.leaflet-popup-content-wrapper {
    background: rgba(17, 24, 39, 0.95);
    color: #e5e7eb;
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}
.leaflet-popup-tip { background: rgba(17, 24, 39, 0.95); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; line-height: 1.5; }
.leaflet-popup-content b { color: white; }
.leaflet-control-zoom a {
    background: rgba(17, 24, 39, 0.9) !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}
.leaflet-control-zoom a:hover { background: #1f2937 !important; }
.leaflet-control-attribution { background: rgba(0,0,0,0.5) !important; color: #6b7280 !important; }
.leaflet-control-attribution a { color: #9ca3af !important; }

/* ═══════ Price History Modal (Phase B) ═══════ */
/* Clickable price on each recommendation card opens a modal with a
   14-day price trend graph. The button is styled to look like the
   original span until hovered, so the card layout is unchanged. */
.price-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    font-weight: inherit;
}
.price-btn:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.price-btn:focus-visible {
    outline: 2px solid var(--accent-400, #36a5ff);
    outline-offset: 2px;
    border-radius: 2px;
}
.price-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
    animation: fadeIn 0.15s ease-out both;
}
.price-modal.hidden {
    display: none;
}
.price-modal-content {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(75, 85, 99, 0.6);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
