/* --- Global Styles : Version Immersive "Once Human" --- */

/* 1. Configuration de base et Typographie */
html {
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    margin: 0;
    font-size: 16px;
    
    /* RETOUR A LA POLICE DU JEU PARTOUT */
    font-family: 'h73light', sans-serif;
    letter-spacing: 0.8px; /* Un peu d'espacement pour améliorer la lisibilité de cette police */
    
    background-image: url("../images/Wallpaper.jpg"); /* Fallback si le dégradé ne charge pas */
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    
    color: #e0e0e0; 
    overflow-x: hidden;
}

*, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* On force la police sur les éléments de formulaire qui ne l'héritent pas toujours */
input, button, textarea, select {
    font-family: 'h73light', sans-serif;
}

/* Style spécifique pour les titres (plus d'espacement et majuscules) */
h1, h2, h3, h4, h5, h6, .titrepage, .nav-item-title {
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: normal; /* h73light est déjà "gras" visuellement */
}

/* 2. Le Fond d'écran (Background) */
body {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;

    /* Fond sombre profond avec nuances colorées (Support pour l'animation particules) */
    background-color: #050507; 
    background-image: 
        radial-gradient(circle at 85% 80%, rgba(104, 253, 214, 0.12) 0%, transparent 50%), /* Touche Cyan */
        radial-gradient(circle at 20% 20%, rgba(90, 55, 140, 0.15) 0%, transparent 50%), /* Touche Violet */
        radial-gradient(circle at 50% 50%, rgba(150, 50, 50, 0.08) 0%, transparent 60%); /* Touche Rouge subtile */
    
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 3. Canvas pour les Particules (Animation JS) */
#tech-background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Ne bloque pas les clics */
}

/* 4. Scrollbar Styles (WebKit) - Style Tech */
::-webkit-scrollbar {
    width: 10px;
    background-color: rgba(15, 20, 25, 0.8);
    transition: width 0.3s ease;
}

::-webkit-scrollbar-track {
    background-color: rgba(104, 253, 214, 0.05);
}

::-webkit-scrollbar-thumb {
    background-color: #4a9e86; /* Cyan plus sombre */
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #68fdd6; /* Cyan vif au survol */
    box-shadow: 0 0 10px rgba(104, 253, 214, 0.5);
}

.table-container::-webkit-scrollbar {
    width: 6px; /* Plus fin pour les tableaux */
    height: 6px;
    background: transparent;
}

/* 5. Inputs & Forms : Effet Focus Néon */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #68fdd6 !important;
    box-shadow: 
        0 0 10px rgba(104, 253, 214, 0.3), 
        inset 0 0 5px rgba(104, 253, 214, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 6. UTILITIES : Conteneurs High-Tech */

/* A. Glass Panel (Pour les petits éléments flottants : menus, tooltips) */
.glass-panel {
    background: rgba(15, 20, 25, 0.85);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid rgba(104, 253, 214, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* B. Opaque Panel (POUR LE CONTENU PRINCIPAL) */
/* Utiliser ceci pour les sections de contenu, le builder, les tableaux */
/* Cela garantit la lisibilité par-dessus le fond animé */
.main-container, .content-box, .opaque-panel {
    background: rgba(18, 18, 22, 0.96) !important; /* Presque opaque */
    border: 1px solid rgba(104, 253, 214, 0.15);
    border-top: 1px solid rgba(104, 253, 214, 0.3); /* Lumière du haut */
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    backdrop-filter: none; /* Pas de flou pour la performance et la netteté */
}

/* C. Interactivité */
.glass-panel-interactive {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.glass-panel-interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(104, 253, 214, 0.6);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.7),
        inset 0 0 15px rgba(104, 253, 214, 0.05);
}

/* ========================================== */
/* OVERLAY DE TRANSITION & STARDUST ANOMALY   */
/* ========================================== */

/* 1. L'écran noir qui recouvre tout */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #050507;
    z-index: 999999;
    opacity: 1; /* Complètement opaque par défaut */
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all; /* Bloque les clics pendant le chargement */
}

/* 2. La classe ajoutée par JS pour dissiper l'écran */
.page-transition-overlay.is-loaded {
    opacity: 0;
    pointer-events: none; /* Laisse passer les clics une fois invisible */
}

/* 3. Conteneur principal du loader Stardust */
.stardust-loader {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

/* 4. Le coeur d'énergie Stardust */
.stardust-core {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #68fdd6; /* Ton cyan */
    border-radius: 50%;
    box-shadow: 
        0 0 15px 5px rgba(104, 253, 214, 0.8),
        0 0 40px 15px rgba(90, 55, 140, 0.6); /* Halo violet Stardust */
    animation: pulseStardust 1.5s ease-in-out infinite alternate;
}

/* 5. Particules flottantes (créées sans JS grâce aux box-shadows !) */
.stardust-motes {
    position: absolute;
    width: 3px;
    height: 3px;
    background: transparent;
    border-radius: 50%;
    /* Chaque ombre est une particule de stardust */
    box-shadow: 
        25px -25px 0 #68fdd6,
        -35px 15px 0 rgba(90, 55, 140, 0.9),
        15px 35px 0 #68fdd6,
        -20px -30px 0 rgba(104, 253, 214, 0.6),
        40px 5px 0 rgba(90, 55, 140, 0.7);
    animation: orbitMotes 6s linear infinite;
}

/* 6. Anneaux technologiques d'anomalie */
.particle-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
    animation: spinRing linear infinite;
}

.particle-ring:nth-child(1) {
    width: 50px; height: 50px;
    border-top: 1px dashed rgba(104, 253, 214, 0.8);
    border-bottom: 1px dashed rgba(90, 55, 140, 0.8);
    animation-duration: 3s;
}

.particle-ring:nth-child(2) {
    width: 80px; height: 80px;
    border-left: 2px dotted rgba(104, 253, 214, 0.4);
    animation-duration: 5s;
    animation-direction: reverse;
}

.particle-ring:nth-child(3) {
    width: 110px; height: 110px;
    border-right: 1px dashed rgba(150, 50, 50, 0.3); /* Ta touche de rouge */
    animation-duration: 7s;
}

/* Animations Clés */
@keyframes pulseStardust {
    0% { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(1.3); opacity: 1; }
}

@keyframes orbitMotes {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinRing {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Dissipation du loader en douceur quand la page arrive */
.page-transition-overlay.is-loaded .stardust-loader {
    opacity: 0;
    transform: scale(0.3); /* Le cœur s'effondre sur lui-même */
}

/* Animation d'entrée du contenu de la page */
.content, .main-container, .opaque-panel {
    opacity: 0;
    animation: techMaterialize 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.2s; 
}

@keyframes techMaterialize {
    0% { opacity: 0; transform: translateY(15px); filter: blur(2px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}