/* ============================================= */
/* THE ARCHIVE PROTOCOL - STYLESHEET FINAL       */
/* ============================================= */

/* --- 1. CONFIGURATION & STYLES DE BASE --- */

/* Importation de la police utilisée sur tout le site */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap');

/* Définition des variables de couleur pour le thème */
:root {
    --background: #0A0A0A;
    --text-main: #FFB800; /* Ambre principal */
    --text-secondary: rgba(255, 184, 0, 0.6); /* Ambre plus discret */
    --border-color: rgba(255, 184, 0, 0.2);
    --accent-hover: #FFFFFF; /* Blanc pour le survol */
}

/* Reset de base et application du style global */
*, *::before, *::after {
    box-sizing: border-box; /* Calcul de taille plus intuitif */
}

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--background);
    color: var(--text-main);
    margin: 0; /* Retire les marges par défaut du navigateur */
    padding-top: 5rem; /* Espace pour le menu fixe en haut */
    padding-bottom: 4rem; /* Espace pour le footer fixe en bas */
    padding-left: 2rem;
    padding-right: 2rem;
    text-align: left;
}

/* Effet de scanlines subtil sur toute la page */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(0deg, transparent 50%, rgba(255, 184, 0, 0.05) 50%);
    background-size: 100% 3px;
    z-index: -1;
    pointer-events: none;
}

/* Styles de typographie de base */
h1 { font-size: 1.5rem; margin-bottom: 0.5rem; text-transform: uppercase; }
p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 800px; line-height: 1.6; }
a { color: var(--text-main); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* --- 2. STRUCTURE & COMPOSANTS --- */

/* Conteneur principal qui centre le contenu */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Style de base pour tous les "panneaux" */
.panel {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: rgba(255, 184, 0, 0.02); /* Effet de verre */
    backdrop-filter: blur(5px);
}

.panel-title {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* --- 3. NAVIGATION (GLOBALE & LOCALE) --- */

/* Menu fixe en haut pour naviguer entre les sites */
.galaxy-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    display: flex;
    gap: 1.5rem;
    box-sizing: border-box;
    z-index: 100;
}
.galaxy-nav a { text-decoration: none; font-size: 0.8rem; text-transform: uppercase; }
.galaxy-nav a:hover { text-decoration: none; }
.galaxy-nav .hub-link { font-weight: bold; }

/* Menu local, pour naviguer à l'intérieur d'un site */
nav.panel {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 1.5rem;
}
nav.panel a { text-decoration: none; font-weight: 500; }
nav.panel a.active { background-color: var(--text-main); color: var(--background); padding: 0.2rem 0.5rem; }

/* --- 4. CONTRÔLES (BOUTONS, MENUS) --- */

#controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
input, select, button { font-family: 'Roboto Mono', monospace; font-size: 1rem; padding: 0.5rem; border: 1px solid var(--border-color); background: transparent; color: var(--text-main); }
select option { background: #111; }
input:focus, select:focus { outline: none; border-color: var(--text-main); }
button { cursor: pointer; border-color: var(--text-main); }
button:hover { background: var(--text-main); color: var(--background); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- 5. GALERIES D'IMAGES --- */

/* Style de base pour toutes les grilles d'images */
.gallery { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem; 
}

/* Conteneur de chaque image, pour forcer le ratio carré */
.gallery .gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* L'image elle-même, qui remplit son conteneur */
.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}
.gallery .gallery-item img:hover, .gallery > img:hover {
    transform: scale(1.1);
}

/* --- 6. LIGHTBOX (Version Unifiée) --- */

#lightbox { 
    position: fixed; inset: 0; 
    background-color: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(10px); 
    z-index: 200; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    padding: 1rem;
    box-sizing: border-box;
}
#lightbox.visible { display: flex; }

/* Wrapper pour la mise en page en grille (image + texte) pour APOD Archives */
.archive-lightbox-wrapper {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 1.5rem;
    width: 90%;
    height: 90%;
    max-width: 1600px;
}

#lightbox-media-container {
    height: 100%;
    min-width: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
#lightbox-metadata {
    height: 100%;
    overflow-y: auto;
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-secondary);
}
#lightbox-metadata .panel-title { color: var(--text-main); }
#lightbox-metadata .apod-explanation { overflow-wrap: break-word; white-space: pre-wrap; }
.lightbox-video { width: 100%; height: 100%; border: none; }

.close-button, .prev-button, .next-button { position: absolute; color: var(--text-main); font-size: 2.5rem; cursor: pointer; z-index: 10; }
.close-button { top: 1.5rem; right: 1.5rem; }
.prev-button { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.next-button { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.close-button:hover, .prev-button:hover, .next-button:hover { color: var(--accent-hover); }

/* --- 7. COMPOSANTS SPÉCIFIQUES --- */

/* ISS Tracker */
#iss_map { height: 500px; border: 1px solid var(--border-color); background-color: #000; }
.chart-container { position: relative; height: 250px; }
.current-value { font-size: 2.5rem; font-weight: bold; text-align: center; color: var(--text-main); margin-bottom: 1rem; }
#telemetry-data { display: flex; flex-direction: column; gap: 0.8rem; font-size: 1.1rem; }

/* Voyager Feed */
.voyager-panel { border-left: 4px solid var(--text-main); padding-left: 1.5rem; }
.data-item { margin-bottom: 1.2rem; }
.data-label { color: var(--text-secondary); text-transform: uppercase; font-size: 0.9rem; }
.data-value { font-size: 1.8rem; font-weight: bold; color: var(--text-main); display: block; }
.ping-status { margin-top: 1rem; color: var(--text-secondary); height: 40px; }
.timeline-container { padding: 2rem 0; }
.timeline { position: relative; width: 100%; height: 2px; background: var(--border-color); }
.milestone { position: absolute; top: -10px; transform: translateX(-50%); width: 2px; height: 20px; background: var(--text-secondary); }
.milestone-label { position: absolute; top: 25px; transform: translateX(-50%); color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.probe-icon { position: absolute; top: -8px; transform: translateX(-50%); font-size: 1.5rem; }

/* --- 8. FOOTER --- */

footer.panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.8);
    border-top: 1px solid var(--border-color);
    border-bottom: none; border-left: none; border-right: none;
    z-index: 100;
    margin-bottom: 0;
    padding: 0.5rem 2rem;
    box-sizing: border-box;
}
.footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 900px; margin: 0 auto; font-size: 0.8rem; color: var(--text-secondary); }
.donate-button { color: var(--background); background-color: var(--text-main); padding: 0.4rem 0.8rem; text-decoration: none; border: 1px solid var(--text-main); transition: all 0.2s; }
.donate-button:hover { background-color: transparent; color: var(--text-main); text-decoration: none; }

/* --- 9. RESPONSIVE DESIGN --- */

/* Styles pour les écrans de moins de 1024px de large */
@media (max-width: 1024px) {
    body { padding-left: 1rem; padding-right: 1rem; }
    
    /* Le tableau de bord de l'ISS passe sur une seule colonne */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }
    .charts-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    /* La lightbox des archives passe sur une seule colonne */
    .archive-lightbox-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }
    #lightbox-metadata {
        height: auto; 
        max-height: 40vh;
    }
}