/* Variables de couleurs Cyberpunk perfectionnées */
:root {
    --bg-dark: #030407;
    --term-bg: rgba(6, 10, 15, 0.85);
    --neon-green: #00ff66;
    --neon-blue: #00f0ff;
    --neon-gold: #ffd700;
    --text-main: #c8d1d9;
    --border-glow: rgba(0, 240, 255, 0.5);
}

/* Scrollbar Cyberpunk personnalisée */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-left: 1px solid rgba(0, 240, 255, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.4);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fira Code', monospace;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: background-color 1s ease;
}

/* Arrière-plan grille animée */
.cyber-grid {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px);
    animation: gridMove 15s linear infinite;
    z-index: 1;
    transition: all 1s ease;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

/* Effets de moniteur rétro */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

.crt-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    opacity: 0;
    pointer-events: none;
    z-index: 11;
    animation: flicker 0.12s infinite;
}

@keyframes flicker {
    0% { opacity: 0.01; }
    50% { opacity: 0.05; }
    100% { opacity: 0.01; }
}

/* Fenêtre du terminal */
.terminal-container {
    width: 90%;
    max-width: 1050px;
    background: var(--term-bg);
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.1);
    animation: 
        bootUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        neonPulse 4s infinite alternate,
        float 6s ease-in-out infinite;
    transition: all 0.5s ease;
}

@keyframes bootUp {
    0% { transform: scale(0.8) translateY(50px); opacity: 0; filter: blur(10px); }
    100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes neonPulse {
    0% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.1); }
    100% { box-shadow: 0 0 40px rgba(0, 240, 255, 0.5), inset 0 0 20px rgba(0, 240, 255, 0.2); border-color: #fff; }
}

/* En-tête de la fenêtre */
.terminal-header {
    background: rgba(3, 4, 7, 0.9);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.5);
    transition: all 0.5s ease;
}

.header-title {
    color: var(--neon-green);
    font-size: 0.95em;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 8px var(--neon-green);
}

.blink-fast {
    animation: blink 0.5s step-end infinite;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.header-buttons span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    color: var(--neon-blue);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.05);
    border-radius: 4px;
}

.header-buttons span:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 12px var(--neon-blue);
    transform: translateY(-2px);
}

.header-buttons .close-btn:hover {
    color: #fff;
    border-color: #ff003c;
    background: rgba(255, 0, 60, 0.5);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.8);
}

.terminal-body {
    padding: 40px 50px;
    min-height: 450px;
    max-height: 75vh;
    overflow-y: auto;
}

/* Écran de chargement */
#boot-screen p {
    font-size: 1.1em;
    margin-bottom: 10px;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

/* Titre principal */
.typing-effect {
    font-size: 2.4em;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    font-weight: 700;
}

.cursor {
    display: inline-block;
    width: 15px;
    animation: blink 1s step-end infinite;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.subtitle {
    font-size: 1.2em;
    color: var(--neon-green);
    margin-bottom: 40px;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.5);
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 0.5s;
}

.fade-in-delayed {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 1s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Grille pour les liens */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Style des boutons avec HAUTEUR FIXE */
.cyber-button {
    display: flex;
    align-items: center;
    background: rgba(0, 240, 255, 0.03);
    color: var(--neon-blue);
    text-decoration: none;
    padding: 0 25px;
    height: 75px; 
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 6px;
    font-size: 1.2em;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 1;
}

.cyber-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--neon-green);
    border-right: 2px solid var(--neon-green);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.cyber-button .icon {
    color: var(--neon-green);
    margin-right: 15px;
    font-weight: bold;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    text-shadow: 0 0 8px var(--neon-green);
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
    transition: left 0.6s ease;
    z-index: -1;
}

.cyber-button:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.2);
    border-color: #fff;
    transform: translateY(-4px);
    color: #ffffff;
    background: rgba(0, 240, 255, 0.1);
    text-shadow: 0 0 8px #fff;
}

.cyber-button:hover .icon {
    transform: translateX(5px);
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

.cyber-button:hover::before {
    left: 100%;
}

.cyber-button:hover::after {
    width: 100%;
    height: 100%;
    opacity: 0.1;
    border-color: var(--neon-blue);
}

.cyber-button:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

/* STYLES SPÉCIFIQUES POUR LA CASE CRÉDITS */
.credits-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: center;
}

.credits-main {
    display: flex;
    align-items: center;
}

.credits-sub {
    font-size: 0.55em;
    text-transform: none;
    color: var(--text-main);
    margin-top: 2px;
    margin-left: 35px;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.cyber-button:hover .credits-sub {
    opacity: 1;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* WIDGET VIDÉO */
.video-widget {
    position: relative;
    width: 100%;
    min-height: 150px;
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 6px;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    display: flex;
    transition: all 0.4s ease;
    grid-column: 1 / -1; 
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none; 
    z-index: 5;
}

.video-widget:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
    border-color: #fff;
    transform: scale(1.01);
}

.video-widget iframe {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border: none;
    z-index: 1;
}

/* SECTION NOTES DE COURS */
.doc-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px dashed rgba(255, 215, 0, 0.4);
    text-align: center;
    position: relative;
}

.doc-section::before {
    content: '/// SYSTEM.DOCS ///';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--term-bg);
    padding: 0 15px;
    color: var(--neon-gold);
    font-size: 0.8em;
    letter-spacing: 2px;
}

.doc-button {
    color: var(--neon-gold);
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.05);
    display: inline-flex;
    font-size: 1.1em;
    padding: 0 40px;
    height: 75px;
}

.doc-button::after {
    border-color: var(--neon-gold);
}

.doc-button .icon {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.doc-button::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
}

.doc-button:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), inset 0 0 15px rgba(255, 215, 0, 0.2);
    border-color: #fff;
    background: rgba(255, 215, 0, 0.15);
    color: #fff;
}

/* Responsivité */
@media (max-width: 768px) {
    .typing-effect { font-size: 1.6em; }
    .terminal-body { padding: 30px 20px; min-height: 350px; }
    .cyber-button { font-size: 1.1em; padding: 0 15px; height: 65px; }
    .doc-button { font-size: 1rem; width: 100%; justify-content: center; }
    .links-grid { grid-template-columns: 1fr; }
    .video-widget iframe { min-height: 200px; }
}


/* =========================================
   /// EASTER EGGS STYLES (HIDDEN) ///
   ========================================= */

/* Surcharge Glitch Système (DedSec) */
.system-glitch {
    animation: extremeGlitch 0.2s linear infinite, invertColors 0.5s step-end infinite;
    pointer-events: none;
}
.system-glitch .terminal-container {
    box-shadow: 0 0 50px #ff003c, inset 0 0 30px #ff003c;
    border-color: #ff003c;
}
@keyframes extremeGlitch {
    0% { transform: translate(0) skew(0deg); filter: hue-rotate(0deg); }
    20% { transform: translate(-10px, 5px) skew(-10deg); filter: hue-rotate(90deg); }
    40% { transform: translate(10px, -5px) skew(10deg); filter: hue-rotate(-90deg); }
    60% { transform: translate(-5px, 10px) skew(-5deg); filter: hue-rotate(180deg); }
    80% { transform: translate(5px, -10px) skew(5deg); filter: hue-rotate(-180deg); }
    100% { transform: translate(0) skew(0deg); filter: hue-rotate(0deg); }
}
@keyframes invertColors {
    0%, 100% { filter: invert(0); }
    50% { filter: invert(1) hue-rotate(180deg); }
}

/* Thème Pandora (Avatar) */
body.theme-pandora {
    --bg-dark: #000c1a;
    --term-bg: rgba(0, 20, 50, 0.85);
    --neon-green: #00ffff; 
    --neon-blue: #a200ff; 
    --border-glow: rgba(162, 0, 255, 0.5);
    --text-main: #e6f2ff;
}
body.theme-pandora .cyber-grid {
    background-image: 
        linear-gradient(rgba(162, 0, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(162, 0, 255, 0.1) 1px, transparent 1px);
}

/* Thème Sith (Star Wars) */
body.theme-sith {
    --bg-dark: #120000;
    --term-bg: rgba(25, 0, 0, 0.9);
    --neon-green: #ff0000; 
    --neon-blue: #ff3333; 
    --border-glow: rgba(255, 0, 0, 0.6);
    --text-main: #ffcccc;
}
body.theme-sith .cyber-grid {
    background-image: 
        linear-gradient(rgba(255, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 0, 0.1) 1px, transparent 1px);
}
body.theme-sith .terminal-header {
    border-bottom: 1px solid #ff0000;
}

/* Animation Code Konami */
.barrel-roll {
    animation: barrelRoll 2s ease-in-out forwards;
}
@keyframes barrelRoll {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.6); }
    100% { transform: rotate(360deg) scale(1); }
}