/* ==========================================
   SPLASH SCREEN & TRANSITIONS
   ========================================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #050a15;
    z-index: 9999;
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#splash-screen::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(77, 166, 255, 0.08) 0%, rgba(5, 10, 21, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

#splash-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

#splash-logo {
    width: 75vw;
    max-width: 280px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 18px rgba(77, 166, 255, 0.25));
}

#splash-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #4da6ff;
    letter-spacing: 4px;
    animation: pulse 1.5s infinite;
    margin: 0;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#home-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 600px;
    margin-top: 25px; 
    box-sizing: border-box;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none; 
}

#splash-screen.hub-active #home-menu-grid {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#splash-screen.hub-active #splash-text {
    display: none; 
}

.menu-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 12px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-card h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(16px, 3.5vw, 24px);
    margin: 0 0 6px 0;
    letter-spacing: 1px;
    color: #ffffff;
}

.menu-card p {
    font-family: sans-serif;
    font-size: clamp(11px, 1.8vw, 14px);
    color: #94a3b8;
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 1024px) {
    #splash-screen {
        display: block; 
    }

    #splash-screen::before {
        width: 1400px;
        height: 1400px;
        background: radial-gradient(ellipse, rgba(77, 166, 255, 0.06) 0%, rgba(5, 10, 21, 0) 50%);
    }

    #splash-branding {
        position: absolute;
        top: 50%;
        left: 50%; 
        transform: translate(-50%, -50%);
        width: 38vw;
        max-width: 680px;
        transition: left 0.9s cubic-bezier(0.25, 1, 0.35, 1), 
                    transform 0.9s cubic-bezier(0.25, 1, 0.35, 1);
    }

    #splash-logo {
        width: 100%;
        max-width: none; 
        margin-bottom: 25px;
    }

    #splash-text {
        font-size: 28px;
        letter-spacing: 6px;
    }

    #splash-screen.hub-active #splash-branding {
        left: 24%; 
    }

    #home-menu-grid {
        position: absolute;
        top: 50%;
        left: 74%; 
        margin-top: 0; 
        width: 44vw; 
        max-width: 850px; 
        gap: 2vw; 
        transform: translate(-50%, 20px); 
        opacity: 0;
        transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.25, 1, 0.35, 1);
    }

    #splash-screen.hub-active #home-menu-grid {
        transform: translate(-50%, -50%); 
        opacity: 1;
    }

    .menu-card {
        border-radius: 28px; 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        aspect-ratio: 4 / 3; 
        padding: 2.5vw; 
    }

    .menu-card h3 {
        font-size: clamp(22px, 2.8vw, 36px); 
        margin-bottom: 12px;
    }

    .menu-card p {
        font-size: clamp(13px, 1.1vw, 18px); 
    }

    .menu-card:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: translateY(-8px) scale(1.02); 
        border-color: rgba(77, 166, 255, 0.5);
        box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.7), 
                    0 0 40px rgba(77, 166, 255, 0.15);
    }
}

#home-menu-grid.exiting .menu-card {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

#home-menu-grid.exiting #card-tropics   { transition-delay: 0.0s; }
#home-menu-grid.exiting #card-radar    { transition-delay: 0.1s; }
#home-menu-grid.exiting #card-satellite { transition-delay: 0.2s; }
#home-menu-grid.exiting #card-models    { transition-delay: 0.3s; }

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ==========================================
   NAVIGATION & UI OVERLAYS
   ========================================== */
#top-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 30;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #f8fafc;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}

/* ==========================================
   TOP TIME BADGE (MOBILE DEFAULT / DESKTOP INLINE)
   ========================================== */
#top-time-container {
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.clock-display {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #38bdf8;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
}

/* ==========================================
   ULTRA-COMPACT BOTTOM TIMELINE CAPSULE
   ========================================== */
#timeline-container {
    position: absolute; 
    bottom: 24px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 90%;
    max-width: 360px;
    background: rgba(11, 15, 25, 0.88); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 14px; 
    border-radius: 16px; 
    color: #f8fafc; 
    display: flex; 
    flex-direction: column;
    gap: 8px; 
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6); 
    z-index: 10; 
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.timeline-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.timeline-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Replace the #timeline-slider section in css/ui.css with this: */
#timeline-slider { 
    flex: 1; 
    accent-color: #38bdf8; 
    cursor: pointer; 
    height: 6px;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    background: rgba(239, 68, 68, 0.5); /* Default red for unloaded track */
    transition: background 0.15s ease;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

#timeline-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
    border: none;
}

#time-label { 
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700; 
    font-size: 12px; 
    color: #94a3b8;
    min-width: 40px; 
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.play-btn {
    padding: 6px 14px;
}

.gif-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gif-btn:hover {
    background: rgba(56, 189, 248, 0.3);
}

#status-toast {
    position: absolute; 
    top: 70px; 
    left: 50%; 
    transform: translateX(-50%);
    background: rgba(11, 15, 25, 0.9); 
    color: #38bdf8; 
    padding: 8px 18px; 
    border-radius: 20px;
    font-size: 13px; 
    font-weight: 500; 
    z-index: 20; 
    border: 1px solid rgba(56,189,248,0.3);
    pointer-events: none;
}

.maplibregl-popup-content {
    background: #0b0f19 !important; 
    color: #f8fafc !important;
    border-radius: 12px; 
    padding: 12px 16px; 
    text-align: center;
    border: 1px solid rgba(255,255,255,0.15);
}

.temp-f { font-size: 20px; font-weight: 800; color: #38bdf8; }
.temp-c { font-size: 13px; color: #94a3b8; }

/* ==========================================
   DESKTOP RESPONSIVE EXTENSION (>= 1024px)
   ========================================== */
@media (min-width: 1024px) {
    #top-time-container {
        position: static;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0 18px;
        margin-left: 12px;
        border-left: 2px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
    }

    .clock-display {
        font-size: 18px; 
        color: #38bdf8; 
        text-align: left;
        letter-spacing: 1px;
        text-shadow: 0 0 8px rgba(56, 189, 248, 0.4); 
    }

    #timeline-container {
        flex-direction: row;
        width: 75%; 
        max-width: 1200px; 
        min-width: 800px; 
        padding: 12px 24px;
        border-radius: 24px;
        gap: 20px;
        bottom: 30px;
    }

    .timeline-controls {
        width: auto;
        min-width: 280px; /* Keeps the empty space on the left for future buttons */
        justify-content: flex-end; /* Snaps the buttons right next to the slider */
    }
    
    .timeline-slider-wrapper {
        width: auto;
        flex: 1; /* Allows the slider to stretch and fill all that empty middle space */
    }

    .gif-btn {
        height: 32px;
        padding: 0 14px;
        font-size: 12px;
    }
}

/* ==========================================
   MODEL RUN DROPDOWN SELECTOR
   ========================================== */
.model-run-dropdown-container {
    position: relative;
}

.run-toggle-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.run-toggle-btn:hover {
    background: rgba(56, 189, 248, 0.3);
}

.run-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 240px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    padding: 6px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.run-dropdown-item {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s ease, color 0.15s ease;
}

.run-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.run-dropdown-item.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-weight: 700;
}

.run-dropdown-item .check-icon {
    font-size: 12px;
    opacity: 0;
}

.run-dropdown-item.active .check-icon {
    opacity: 1;
}

/* Custom Scrollbar for Dropdown */
.run-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.run-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}