/* 1. BEBAS NEUE */
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/bebas-neue-v16-latin-regular.woff2') format('woff2');
}

/* 2. MONTSERRAT REGULAR */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-regular.woff2') format('woff2');
}

/* 3. MONTSERRAT MEDIUM (Utilisé pour le Gras) */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700; /* On le déclare en 700 pour que le CSS l'utilise comme gras */
  font-display: swap;
  src: url('../fonts/montserrat-v31-latin-500.woff2') format('woff2');
}

/* 4. JETBRAINS MONO */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

/* --- MISE À JOUR DES VARIABLES --- */
.home-page {
    --font-data: 'JetBrains Mono', monospace;
    --font-titre: 'Bebas Neue', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

body { background-color: var(--bg-dark); color: #e6edf3; font-family: var(--font-data); margin: 0; }

.lab-container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }

/* HUD & TITRE */
.system-status { font-size: 0.75rem; border-bottom: 1px solid var(--steel-gray); padding-bottom: 10px; margin-bottom: 20px; display: flex; align-items: center; }
.status-blink { height: 8px; width: 8px; background: var(--cyan); border-radius: 2px; margin-right: 12px; box-shadow: 0 0 8px var(--cyan); animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

.glitch-title { font-family: var(--font-titre); font-size: 4rem; color: var(--cyan); margin: 0 0 30px 0; text-transform: uppercase; }

/* UNITÉS DASH (COINS COUPÉS) */
.dash-unit { 
    background: var(--panel); 
    border: 1px solid rgba(0, 242, 255, 0.1); 
    padding: 25px; 
    margin-bottom: 30px; 
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.section-tag { font-family: var(--font-titre); font-size: 1.5rem; margin-bottom: 20px; color: #fff; }

/* GRILLES */
.video-grid, .photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; min-height: 100px; }
.photo-card { aspect-ratio: 16/9; background-size: cover; border: 1px solid var(--steel-gray); }

/* --- LA CARTE (FIXÉ) --- */
.map-wrapper {
    width: 100%;
    height: 650px;
    background: #000;
    border: 1px solid var(--cyan);
    position: relative;
    overflow: hidden; /* Obligatoire pour Panzoom */
    cursor: grab;
}

#panzoom-element { 
    position: relative; 
    display: inline-block; /* Taille calquée sur l'image */
}

.map-img { 
    display: block; 
    width: auto; 
    height: auto; 
    max-width: none; 
}

#hotspots-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
}

.hotspot {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 20;
}
.type-attraction { background: #ff0055; box-shadow: 0 0 15px #ff0055; }
.type-panorama { background: var(--cyan); box-shadow: 0 0 15px var(--cyan); }

/* MODALES */
.modal-lab { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: #0d141b; border: 1px solid var(--cyan); width: 80%; max-width: 800px; padding: 30px; position: relative; }


/* DESIGN DES MODALES CYBER */

.modal-content {
    background: #0d1117;
    border: 1px solid var(--cyan);
    width: 95%;
    max-width: 1200px;
    padding: 30px;
    max-height: 92vh;
    overflow-y: auto;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
}

/* Specs en bandeau sous le titre */
.specs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: rgba(0, 242, 255, 0.05);
    padding: 15px;
    border: 1px dashed var(--steel-gray);
    margin-bottom: 30px;
    list-style: none;
    font-size: 0.85rem;
    color: var(--cyan);
}

/* Container Global pour les flux */
.modal-body-flow {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Grille Vidéos (En ligne) */
.video-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Grille Photos (En dessous) */
 .mini-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 15px !important;
}

.photo-card-mini img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 0.85;
    transition: 0.3s;
}
.photo-card-mini img:hover { opacity: 1; border-color: var(--cyan); }

/* Avis textuels en bas */
.text-reviews-sector {
    border-top: 1px solid var(--steel-gray);
    padding-top: 20px;
}

/* Mobile */
@media (max-width: 900px) {
    .modal-grid-layout { grid-template-columns: 1fr; }
    .intel-sector { border-left: none; padding-left: 0; }
}
/* SÉLECTEUR D'ÉTOILES CYBER */
.stars-selector {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}
.stars-selector input { display: none; }
.stars-selector label {
    font-size: 1.8rem;
    color: #30363d;
    cursor: pointer;
    transition: 0.2s;
}
.stars-selector label:hover,
.stars-selector label:hover ~ label,
.stars-selector input:checked ~ label {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}
.login-prompt-box {
    border: 1px dashed var(--cyan);
    padding: 15px;
    background: rgba(0, 242, 255, 0.05);
    text-align: center;
}
/* Bouton Fermer (Plus gros et plus réactif) */
.close-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 4rem; /* Très grand */
    color: var(--cyan);
    cursor: pointer;
    line-height: 1;
    transition: 0.3s;
    z-index: 100;
    padding: 10px;
}
.close-btn:hover {
    transform: scale(1.2);
    text-shadow: 0 0 15px var(--cyan);
}

/* Flèches Carousel */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    color: var(--cyan);
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: 0.3s;
}
.nav-arrow:hover { text-shadow: 0 0 20px var(--cyan); scale: 1.1; }
.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

.visualizer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
/* Grille forcée 3x2 */
.photo-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin-top: 20px;
}

/* La Boîte "Unit" */
.photo-unit-box {
    background: #0d1117;
    border: 1px solid var(--steel-gray);
    padding: 6px;
    display: flex;
    flex-direction: column;
    height: 220px;
    position: relative;
    transition: 0.3s;
    /* Coin coupé style Lab */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.photo-unit-box:hover {
    border-color: var(--cyan);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.2);
}

/* Étiquette en haut de boîte */
.unit-label {
    font-family: monospace;
    font-size: 0.6rem;
    color: var(--cyan);
    display: flex;
    justify-content: space-between;
    padding: 2px 5px 5px 5px;
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    margin-bottom: 5px;
}

/* La zone photo à l'intérieur */
.photo-unit-box img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

/* Petit texte technique en bas */
.unit-footer {
    font-family: monospace;
    font-size: 0.55rem;
    color: var(--steel-gray);
    padding: 5px 5px 2px 5px;
}

/* La photo elle-même */
.photo-unit-box img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}
/* Style des rapports sur la page principale */
.lab-intel-card {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--steel);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
    transition: 0.3s;
}
.lab-intel-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
}
.intel-header {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.65rem;
    color: var(--cyan);
}
.intel-text {
    font-size: 0.85rem;
    color: #e6edf3;
    font-style: italic;
    line-height: 1.4;
    min-height: 40px;
}
/* --- FIX PRIORITÉ AFFICHAGE (Z-INDEX) --- */

/* 1. On force la modale à passer au-dessus du header */
.modal-lab {
    z-index: 99999 !important; /* Priorité absolue */
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(5, 7, 10, 0.95); /* Fond plus sombre pour masquer le header derrière */
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center; /* Centre la boîte verticalement */
}

/* 2. On s'assure que le header du site ne dépasse pas */
.page-header-park, 
header, 
.site-header {
    z-index: 1000 !important; /* Le header reste en dessous de 99999 */
}

/* 3. Ajustement de la boîte de contenu pour qu'elle ne "colle" pas en haut */
.modal-content {
    position: relative;
    margin: 2vh auto; /* Petit espace en haut et en bas */
    max-height: 90vh; /* Garde 10% de marge pour voir le fond */
    overflow-y: auto;
    border: 1px solid var(--cyan);
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.15); /* Glow cyber */
}

/* 4. Le bouton fermer doit toujours être accessible */
.close-btn {
    position: sticky; /* Reste visible même quand on scrolle dans la modale */
    float: right;
    top: 0;
    right: 0;
    z-index: 100001;
    background: rgba(13, 17, 23, 0.8);
    border-radius: 0 0 0 10px;
}

/* 5. Visualiseur (Carousel) encore plus haut */
#visualizer-lab {
    z-index: 1000000 !important;
}
.admin-terminate-btn {
    background: #ff0055;
    color: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    transition: 0.3s;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

.admin-terminate-btn:hover {
    background: #ff4d88;
    box-shadow: 0 0 15px #ff0055;
    transform: scale(1.05);
}
/* ============================================================= */
/*   UI FORMULAIRES - TACTICAL WRITING INTERFACE                */
/* ============================================================= */

/* Conteneur du formulaire */
.cyber-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

/* Zone de texte principale (Avis) */
.cyber-textarea {
    width: 100%;
    min-height: 160px; /* Plus grand pour le confort */
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--steel-gray) !important;
    color: #fff !important;
    padding: 15px;
    font-family: var(--font-data);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.cyber-textarea:focus {
    outline: none;
    border-color: var(--cyan) !important;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
    background: rgba(0, 242, 255, 0.02) !important;
}

/* Champs d'entrée (Email / URL Vidéo) */
.cyber-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--steel-gray) !important;
    color: #fff !important;
    padding: 12px 15px;
    font-family: var(--font-data);
    font-size: 0.85rem;
    transition: 0.3s;
    box-sizing: border-box;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--cyan) !important;
}

/* Bouton de transmission (Grand format) */
.storm-btn-full {
    width: 100%;
    background: var(--cyan);
    color: #000;
    border: none;
    padding: 18px;
    font-family: var(--font-titre);
    font-size: 1.5rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    /* Coupe biseautée large */
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
    margin-top: 10px;
}

.storm-btn-full:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--cyan);
}

.storm-btn-full:active {
    transform: scale(0.98);
}

/* État "En cours d'envoi" */
.storm-btn-full:disabled {
    background: var(--steel-gray);
    color: #666;
    cursor: not-allowed;
    clip-path: none;
}

/* Labels et Messages de statut */
.field-label {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.form-status-msg {
    font-family: monospace;
    font-size: 0.75rem;
    text-align: center;
    margin-top: 10px;
}

/* Prompt d'authentification (Accès Refusé) */
.auth-denied-box {
    border: 1px solid var(--danger);
    padding: 20px;
    background: rgba(255, 0, 85, 0.05);
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.cyan-link {
    color: var(--cyan);
    text-decoration: underline;
    font-weight: bold;
}

/* Ajustement pour l'alignement Etoiles + Label */
.form-row-align {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
}
.video-card-container {
    position: relative;
    background: #000;
    border: 1px solid var(--steel);
}

.fullscreen-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 242, 255, 0.7);
    color: #000;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 5;
    font-weight: bold;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: 0.3s;
}

.fullscreen-trigger:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--cyan);
}
#pano-viewer {
    width: 100%;
    height: 100%;
    background-color: #000; /* Fond noir en attendant l'image */
}

/* On s'assure que la modale laisse de la place */
#modal-pano .modal-content {
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
}
#modal-pano .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 99999 !important; /* Force le passage au premier plan */
    color: white;
    font-size: 40px;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(0,0,0,0.8); /* Pour qu'on le voie sur une image claire */
}
.video-card-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid rgba(0,242,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}
.video-card-container iframe {
    width: 100%;
    height: 100%;
}
/* Agrandissement de la grille dans la modale */
/* Grille de la modale agrandie */
.mini-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; 
    gap: 20px !important;
    padding: 10px 0;
}

/* Style de la carte photo */
.photo-card-mini {
      width: 100%;
    aspect-ratio: 16 / 9 !important; /* Format 16:9 parfait */
    height: auto !important; /* Supprime la hauteur fixe qui coupait la photo */
    border: 1px solid var(--steel-gray);
    overflow: hidden;
    background: #000;
    transition: 0.3s;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}


.photo-card-mini:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}
.photo-card-mini:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* --- FIX AFFICHAGE MODALES --- */
.modal-lab {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.95);
    backdrop-filter: blur(8px);
    z-index: 99999 !important; /* Passe au dessus de tout */
    justify-content: center;
    align-items: center;
}

/* La classe que le JS ajoute pour ouvrir */
.modal-lab.show {
    display: flex !important;
}

/* Ajustement de la boîte intérieure */
.modal-content {
    background: #0d1117;
    border: 1px solid var(--cyan);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
}

/* Le bouton fermer en haut à droite de la modale */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    color: var(--cyan);
    cursor: pointer;
    z-index: 1000;
}
/* Style de base forcé pour tous les parcs */
.hotspot {
    position: absolute;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    border: 2px solid #ffffff !important;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Couleur par défaut (Sécurité) */
    background-color: #ff0055 !important; 
    opacity: 1 !important;
    visibility: visible !important;
}

/* Couleurs spécifiques par type */
.type-attraction { 
    background-color: #ff0055 !important; 
    box-shadow: 0 0 15px #ff0055 !important;
}

.type-panorama { 
    background-color: #00f2ff !important; 
    box-shadow: 0 0 15px #00f2ff !important;
}

/* Effet au survol pour confirmer le clic */
.hotspot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 1000;
    border-color: #fff !important;
}
.briefing-text p {
    line-height: 1.7;
    color: #bdc5ce !important; /* Remplacement de #8b949e par un gris plus clair */
    font-size: 0.95rem;
    text-align: justify;
}
/* ============================================================= */
/*   OPTIMISATION MOBILE (A AJOUTER EN BAS DU FICHIER)           */
/* ============================================================= */

@media (max-width: 768px) {
    /* 1. Titre et Conteneur */
    .glitch-title { 
        font-size: 2.2rem !important; 
        margin-bottom: 20px;
        line-height: 1.1;
    }
    .lab-container { 
        padding: 0 15px; 
        margin: 20px auto; 
    }

    /* 2. Correction du Briefing (PHP Inline Override) */
    .sector-briefing-grid {
        grid-template-columns: 1fr !important; 
        gap: 20px !important;
    }
    .sector-stats {
        border-right: none !important;
        border-bottom: 1px solid var(--steel-gray);
        padding-right: 0 !important;
        padding-bottom: 20px;
    }

    /* 3. Grilles Photos et Vidéos en 1 colonne */
    .photo-gallery-grid { 
        grid-template-columns: 1fr !important; 
    }
    .video-grid, .video-row-grid, .mini-gallery { 
        grid-template-columns: 1fr !important; 
    }
    .photo-unit-box {
        height: 250px; 
    }

    /* 4. Carte Tactique plus petite */
    .map-wrapper { 
        height: 400px !important; 
    }

    /* 5. Modales en plein écran pour le confort */
    .modal-content {
        padding: 20px 15px;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        margin: 0 !important;
        clip-path: none !important; /* On gagne de la place */
    }
    .close-btn {
        top: 5px;
        right: 10px;
        font-size: 3rem;
    }
    .storm-btn-full {
        font-size: 1.2rem;
        padding: 15px;
    }

    /* 6. Navigation Carousel */
    .nav-arrow {
        font-size: 2.5rem;
        padding: 10px;
        background: rgba(0,0,0,0.4);
    }
    .nav-arrow.left { left: 5px; }
    .nav-arrow.right { right: 5px; }
}