/* =========================================================
   Aurora Development Dashboard — Dual Theme Edition
   ========================================================= */

/* ── Light theme (default) ──────────────────────────── */
:root {
    --aurora-yellow: #FFD500;
    --aurora-red: #E30613;

    --bg-main: #F2F4F7;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
    --text-primary: #1A1D23;
    --text-muted: rgba(0, 0, 0, 0.35);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --timeline-track-bg: rgba(0, 0, 0, 0.08);
    --timeline-fade: linear-gradient(to top, rgba(242, 244, 247, 0.92), transparent);
    --logo-filter: none;
}

/* ── Dark theme ─────────────────────────────────────── */
:root[data-theme="dark"] {
    --bg-main: #0D1117;
    --glass: rgba(13, 17, 23, 0.72);
    --glass-border: rgba(255, 213, 0, 0.12);
    --text-primary: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --timeline-track-bg: rgba(255, 255, 255, 0.08);
    --timeline-fade: linear-gradient(to top, rgba(13, 17, 23, 0.92), transparent);
    /* Brighten logo so "мультимаркет" subtitle is readable on dark */
    --logo-filter: brightness(1.6) contrast(0.95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh; width: 100vw;
    cursor: none;
    transition: background 0.5s ease, color 0.5s ease;
}

/* ── Layout ─────────────────────────────────────────── */
#dashboard-container { position: relative; width: 100vw; height: 100vh; }
#map { position: absolute; inset: 0; z-index: 1; }

.leaflet-container { background: var(--bg-main) !important; transition: background 0.5s ease; }
.leaflet-control-zoom, .leaflet-control-attribution { display: none !important; }

/* ── Logo badge ─────────────────────────────────────── */
.overlay-logo {
    position: absolute;
    top: 36px; left: 36px;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 12px 24px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
    transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.logo-img {
    height: 42px; width: auto;
    filter: var(--logo-filter);
    transition: filter 0.4s ease;
}

.dashboard-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-muted);
    transition: color 0.4s;
}

/* ── Hero stats ─────────────────────────────────────── */
.overlay-stats {
    position: absolute;
    top: 36px; right: 36px;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 22px 44px;
    display: flex; align-items: center; gap: 32px;
    box-shadow: var(--shadow);
    transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.hero-stat {
    display: flex; flex-direction: column; align-items: center;
    min-width: 110px;
}

.hero-number {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -3px;
    background: linear-gradient(135deg, var(--aurora-red) 0%, var(--aurora-yellow) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-top: 6px;
    transition: color 0.4s;
}

.hero-divider {
    width: 1px; height: 54px;
    background: linear-gradient(to bottom, transparent, var(--aurora-red), transparent);
    opacity: 0.15;
}

/* ── Timeline ───────────────────────────────────────── */
.timeline-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 90px;
    z-index: 1000;
    background: var(--timeline-fade);
    display: flex; flex-direction: column;
    justify-content: flex-end;
    padding: 0 48px 18px;
    transition: background 0.4s;
}

/* Visual track */
.timeline-track {
    position: relative;
    width: 100%; height: 6px;
    background: var(--timeline-track-bg);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: visible;
    transition: background 0.4s;
}

.timeline-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: linear-gradient(90deg, var(--aurora-red), var(--aurora-yellow));
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(227, 6, 19, 0.35);
}

.timeline-thumb {
    position: absolute;
    top: 50%; transform: translate(-50%, -50%);
    width: 18px; height: 18px;
    background: #FFF;
    border: 4px solid var(--aurora-red);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.3);
    transition: left 0.1s linear;
    z-index: 2;
}

/* Year labels */
.timeline-years {
    display: flex;
    justify-content: space-between;
    padding: 0;
    position: relative; z-index: 1002;
}

.year-tick {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.year-tick.active {
    color: var(--aurora-red);
    transform: translateY(-4px) scale(1.35);
    font-weight: 900;
}

/* Hidden range input */
input[type="range"] {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 50px;
    opacity: 0; cursor: pointer;
    z-index: 1003;
}

/* ── Mini controls ──────────────────────────────────── */
.mini-controls {
    position: absolute;
    bottom: 100px; right: 36px;
    z-index: 1000;
    display: flex; gap: 10px;
}

.mini-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease;
    opacity: 0.5;
    box-shadow: var(--shadow);
}

.mini-btn:hover {
    opacity: 1;
    background: var(--aurora-yellow);
    color: #000;
    transform: translateY(-2px);
}

/* ── Map markers ────────────────────────────────────── */
.marker-container {
    display: flex; justify-content: center; align-items: center;
}

.marker-pulse {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--aurora-red);
    border: 2px solid var(--aurora-yellow);
    box-shadow: 0 0 8px rgba(227, 6, 19, 0.3);
    animation: pulse-subtle 3s infinite ease-in-out;
}

@keyframes pulse-subtle {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.12); opacity: 1; box-shadow: 0 0 10px rgba(227, 6, 19, 0.45); }
}

/* ── Counter pop ────────────────────────────────────── */
.hero-number.pop {
    animation: number-pop 0.4s ease;
}

@keyframes number-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
