/* ==========================================
   🎬 V7.12 CINEMATIC OVERLAYS & ARCHIVES
   ========================================== */

/* --- THE WELCOME OVERLAY --- */
#welcome-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0, 0, 0, 0.8); z-index: 9999; 
    display: flex; align-items: center; justify-content: center; 
    text-align: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.5s ease; 
}

/* 🛡️ COMPACT & WIDENED UI ARCHITECTURE */
.welcome-box {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-panel);
    
    width: 95%;
    max-width: 460px;
    max-height: 85vh; 
    
    display: flex;
    flex-direction: column;
    gap: 0.75rem; 
    padding: 1.25rem 1.5rem; 
    margin: auto;
    
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(56, 189, 248, 0.05);

    /* STEALTH MODE */
    overflow-y: auto; 
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.welcome-box::-webkit-scrollbar {
    display: none;
}

.welcome-box h1 { 
    margin: 0; text-transform: uppercase; letter-spacing: 2px; 
    font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 900;
    background: linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.welcome-box p { 
    color: #CBD5E1; margin: 0; font-size: clamp(0.85rem, 3vw, 0.95rem); line-height: 1.4; 
}

@media (min-width: 769px) {
    .welcome-box {
        gap: 0.4rem; 
        padding: 1rem 1.5rem; 
    }
}

/* ==========================================
   🔭 JWST DEEP SPACE ARCHIVE (FULL-SCREEN)
   ========================================== */

#jwst-modal-overlay {
    padding: 0; 
}

.jwst-carousel-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    background: #000; 
    position: relative;
    display: block; 
    animation: jwstModalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes jwstModalFadeIn {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}

/* 🛸 Floating Pill Header */
.jwst-carousel-header {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 12px 40px;
    border-radius: 50px;
    text-align: center;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.jwst-carousel-header h2 { margin: 0; color: #E2E8F0; font-family: 'Nunito', sans-serif; letter-spacing: 2px; text-transform: uppercase; font-size: 1.5rem; }
.jwst-carousel-header span { color: var(--color-neon-blue); font-size: 0.75rem; font-weight: bold; letter-spacing: 2px; }

/* 🔥 FULL SCREEN MAGIC 🔥 */
.jwst-image-wrapper {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; max-height: none;
    border-radius: 0; border: none; background: #000; z-index: 1;
}

.jwst-image-wrapper img {
    width: 100%; height: 100%; object-fit: contain; 
    animation: fadeInImg 0.6s ease forwards;
}

@keyframes fadeInImg { from { opacity: 0; } to { opacity: 1; } }

.jwst-scanline {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(56,189,248,0), rgba(56,189,248,0.05) 50%, rgba(56,189,248,0));
    background-size: 100% 4px; pointer-events: none;
    animation: scanline 8s linear infinite; opacity: 0.5; z-index: 2;
}

/* ⬅️ Navigation Arrows ➡️ */
.jwst-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--color-neon-blue); font-size: 2rem; width: 60px; height: 60px;
    border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: all 0.2s ease; z-index: 20; backdrop-filter: blur(8px);
}
.jwst-nav-btn.left { left: 40px; }
.jwst-nav-btn.right { right: 40px; }
.jwst-nav-btn:hover { background: var(--color-neon-blue); color: #fff; box-shadow: 0 0 20px rgba(56, 189, 248, 0.5); transform: translateY(-50%) scale(1.1); }

/* 📊 The Text Overlay */
.jwst-info-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 80px 80px 140px 80px; 
    background: linear-gradient(to top, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.8) 40%, transparent 100%);
    border: none; z-index: 10; pointer-events: none; 
}
.jwst-info-overlay h3 { margin: 0 0 10px 0; color: var(--color-primary); font-size: 2.2rem; font-family: 'Nunito', sans-serif; text-shadow: 0 2px 10px rgba(0,0,0,0.8);}
.jwst-info-overlay p { margin: 0 0 15px 0; color: #cbd5e1; font-size: 1.15rem; line-height: 1.6; max-width: 1000px; text-shadow: 0 2px 5px rgba(0,0,0,0.9);}

.jwst-telemetry-row { display: flex; gap: 20px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 15px; max-width: 1000px; }
.jwst-telemetry-row span { font-size: 0.9rem; font-family: monospace; font-weight: bold; text-shadow: 0 1px 3px rgba(0,0,0,0.8);}
#jwst-target-date { color: #94a3b8; }
#jwst-target-spectrum { color: #0ea5e9; }

/* 🖼️ Floating Horizontal Thumbnail Strip */
.jwst-horizontal-strip {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; gap: 15px; z-index: 20; width: 90%; max-width: 800px; overflow-x: auto;
}
.jwst-thumb-card {
    width: 120px; height: 75px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2); transition: all 0.2s ease; flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.jwst-thumb-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; transition: opacity 0.2s ease;}
.jwst-thumb-card:hover { border-color: rgba(56, 189, 248, 0.8); transform: translateY(-5px);}
.jwst-thumb-card:hover img { opacity: 0.9; }
.jwst-thumb-card.active { border-color: var(--color-neon-blue); box-shadow: 0 0 20px rgba(56,189,248,0.8); transform: translateY(-5px); }
.jwst-thumb-card.active img { opacity: 1; }

/* ❌ Floating Close Button */
#btn-close-jwst {
    position: absolute; top: 30px; right: 40px; z-index: 30 !important;
    background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
    width: 50px; height: 50px; display: flex; justify-content: center; align-items: center;
    font-size: 1.8rem; color: #fff; cursor: pointer; transition: all 0.2s ease; backdrop-filter: blur(8px);
}
#btn-close-jwst:hover { background: #ef4444; border-color: #ef4444; transform: scale(1.1) rotate(90deg); }

/* Mobile Overrides for JWST */
@media (max-width: 768px) {
    .jwst-carousel-header { width: 80%; top: 15px; padding: 10px 20px; }
    .jwst-carousel-header h2 { font-size: 1.1rem; }
    #btn-close-jwst { top: 15px; right: 15px; width: 40px; height: 40px; font-size: 1.5rem; }
    .jwst-nav-btn { display: none; }
    .jwst-info-overlay { padding: 40px 20px 100px 20px; }
    .jwst-info-overlay h3 { font-size: 1.5rem; }
    .jwst-info-overlay p { font-size: 0.95rem; }
    .jwst-horizontal-strip { bottom: 15px; justify-content: flex-start; }
    .jwst-thumb-card { width: 90px; height: 60px; }
}

/* ==========================================
   🧘‍♂️ CINEMATIC ZEN MODE (AUTO-HIDE UI)
   ========================================== */
.jwst-carousel-header, .jwst-info-overlay, .jwst-horizontal-strip, #btn-close-jwst {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.jwst-zen-mode .jwst-carousel-header,
.jwst-zen-mode .jwst-info-overlay,
.jwst-zen-mode .jwst-horizontal-strip,
.jwst-zen-mode #btn-close-jwst {
    opacity: 0;
    pointer-events: none;
}

.jwst-zen-mode .jwst-carousel-header { transform: translate(-50%, -20px); }
.jwst-zen-mode .jwst-info-overlay { transform: translateY(30px); }
.jwst-zen-mode .jwst-horizontal-strip { transform: translate(-50%, 30px); }

/* ==========================================
   📀 VOYAGER GOLDEN RECORD UI
   ========================================== */
.golden-record-disk {
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, #fde047 0%, #ca8a04 40%, #854d0e 80%, #422006 100%);
    border: 3px solid #fef08a; box-shadow: 0 0 40px rgba(234, 179, 8, 0.4), inset 0 0 20px rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center; position: relative;
}

.golden-record-grooves {
    width: 90%; height: 90%; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2);
    background: repeating-radial-gradient(transparent, transparent 3px, rgba(0,0,0,0.15) 4px, rgba(0,0,0,0.15) 5px);
    position: absolute;
}

.golden-record-center {
    width: 32%; height: 32%; border-radius: 50%; background: #fef08a;
    border: 2px solid #a16207; display: flex; justify-content: center; align-items: center;
    position: absolute; box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.golden-record-hole { 
    width: 12%; height: 12%; border-radius: 50%; background: #0B0E14; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

.spinning { animation: spinRecord 4s linear infinite; }
@keyframes spinRecord { 100% { transform: rotate(360deg); } }

#btn-play-record:hover { transform: scale(1.05); box-shadow: 0 5px 25px rgba(234, 179, 8, 0.6); }
