/* ==========================================================================
   1. VARIABLES GLOBALES & RESET
   ========================================================================== */
:root {
    /* Palette LDLC / Rétro */
    --ldlc-dark: #001b3d;          /* Bleu nuit header */
    --ldlc-cyan: #00a1d9;          /* Bleu cyan / hover */
    --win-grey: #c0c0c0;           /* Gris Windows 95 */
    --win-blue: #363636;           /* Gris foncé barres de titre */
    --win-blue-classic: #000080;   /* Bleu classique Windows */
    
    /* Palette ANVLS / Terminal */
    --terminal-green: #33ff33;     /* Vert Matrix */
    --terminal-bg: #000000;        /* Fond noir pur */
    --amber: #ffb000;              /* Orange/Ambre CRT */
    --anvls-orange: #ff6600;       /* Orange logo ANVLS */
    --bg-cream: #fdf6e3;           /* Fond crème rétro */
    
    /* Sidebar */
    --sidebar-bg: #333333;         /* Gris foncé sidebar */
    --btn-border-blue: #00a1d9;    /* Bordure néon */
}

body {
    margin: 0;
    background-color: var(--bg-cream);
    color: #000000;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ==========================================================================
   2. BARRE DE NAVIGATION (RUBAN RÉTRO)
   ========================================================================== */
.nav-retro {
    display: flex;
    align-items: stretch;
    background-color: #2b2b2b;
    height: 60px;
    border-bottom: 2px solid #1a1a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.logo-nav {
    display: flex;
    align-items: center;
    padding: 0 25px;
    background-color: rgba(0, 0, 0, 0.2);
    font-family: 'VT323', monospace;
    font-size: 1.8rem;
    letter-spacing: 1px;
    color: #ffffff;
}

.logo-nav span {
    color: var(--amber);
    margin-left: 5px;
}

.nav-item-retro {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-bottom: none;
}

.nav-item-retro img {
    height: 24px;
    width: auto;
    margin-right: 12px;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    image-rendering: pixelated;
}

.nav-item-retro:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--ldlc-cyan);
    box-shadow: inset 0 -3px 0 var(--ldlc-cyan);
}

.nav-item-retro:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(0, 161, 217, 0.5));
}

/* ==========================================================================
   3. CONTENEUR PRINCIPAL & HERO CARD (ACCUEIL)
   ========================================================================== */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.hero-card {
    background: var(--terminal-bg);
    border: 2px solid #ffffff;
    padding: 2px;
    margin-bottom: 30px;
}

/* Hauteur dynamique : s'ajuste au texte sans déborder */
.card-content { 
    background: #000000; 
    height: auto;
    padding: 30px; 
    border: 3px inset #ffffff; 
    color: var(--amber); 
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo-text {
    font-family: 'VT323', monospace;
    font-size: 2rem;
    margin: 0;
    color: #ffffff;
}

.logo-text span {
    color: var(--anvls-orange);
}

.home-nav {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
}

.home-nav a {
    color: var(--terminal-green);
    text-decoration: none;
    margin: 0 5px;
}

.home-nav a:hover {
    text-decoration: underline;
}

.welcome-title {
    font-family: 'VT323', monospace;
    color: var(--amber);
    text-align: center;
    font-size: 3rem;
    margin: 20px 0;
}

.terminal-container p {
    color: var(--amber);
    font-size: 1.1rem;
    line-height: 1.4;
}

/* ==========================================================================
   4. FENÊTRE TERMINAL COMMUNAUTAIRE
   ========================================================================== */
.window {
    background: var(--win-grey);
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    margin-top: 30px;
}

.window-title {
    background: var(--win-blue);
    color: #ffffff;
    padding: 4px 10px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.window-body {
    background: #050505;
    color: var(--terminal-green);
    padding: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    border: 2px inset #ffffff;
}

/* Tags de log */
.tag-retro { color: var(--amber); }
.tag-tech  { color: #00d4ff; }
.tag-video { color: #ff4444; font-weight: bold; }

.pulse {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ==========================================================================
   5. SECTIONS VIDÉOS (GRILLE RÉTRO WINDOWS 95)
   ========================================================================== */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.video-card {
    background: var(--win-grey);
    border: 2px solid #ffffff;
    border-right-color: #444444;
    border-bottom-color: #444444;
    padding: 3px;
    overflow-y: auto;
}

.video-body {
    background: #000000;
    border: 2px inset #ffffff;
    padding: 15px;
    color: var(--amber);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 15px;
}

.video-container iframe,
.video-container img.img-retro-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #444444;
}

.retro-btn {
    display: inline-block;
    background: var(--win-grey);
    border: 2px solid #ffffff;
    border-right-color: #000000;
    border-bottom-color: #000000;
    padding: 8px 15px;
    color: #000000;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    margin-top: 10px;
}

.retro-btn:active {
    border: 2px inset #ffffff;
}

.text-title-vert {
    font-family: 'VT323', monospace;
    color: var(--terminal-green);
    text-align: center;
    font-size: 2rem;
    margin: 20px 0;
}

/* ==========================================================================
   6. PAGE VIDÉOS YOUTUBE (SIDEBAR + GRILLE DÉDIÉE)
   ========================================================================== */
.youtube-page-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
}

.youtube-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 3px solid #222222;
    position: sticky;
    top: 60px; 
    height: calc(100vh - 60px);
    box-sizing: border-box;
}

.sidebar-header-title {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #555555;
    padding-bottom: 8px;
}

.sidebar-main-title {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.sidebar-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.yt-cat-btn {
    display: flex;
    align-items: center;
    background-color: #222222;
    border: 2px solid var(--btn-border-blue);
    border-radius: 8px;
    padding: 12px 15px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(0, 161, 217, 0.3);
}

.yt-cat-btn img {
    width: 26px;
    height: auto;
    margin-right: 15px;
    image-rendering: pixelated;
}

.yt-cat-btn span {
    font-weight: bold;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.yt-cat-btn:hover {
    background-color: var(--btn-border-blue);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 161, 217, 0.8);
    transform: translateX(5px);
}

.yt-cat-btn.active {
    background-color: var(--btn-border-blue);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 161, 217, 0.8);
    border-color: #ffffff;
    pointer-events: none;
}

.youtube-main-content {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-cream);
}

.youtube-banner {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid #222222;
}

/* Fenêtre d'instructions */
.welcome-app-window {
    width: 100%;
    max-width: 700px;
    background: #ffffff;
    border: 3px solid var(--win-blue-classic);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    align-self: flex-start;
}

.app-window-header {
    background: var(--win-blue-classic);
    color: #ffffff;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.95rem;
}

.app-window-controls span {
    margin-left: 10px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
}

.close-btn {
    color: #ff4444;
}

.app-window-body {
    padding: 30px;
    color: #000000;
    background: #ffffff;
}

.welcome-heading {
    color: var(--anvls-orange);
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

.welcome-subheading {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333333;
}

.welcome-instructions {
    padding-left: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0;
}

.welcome-instructions li {
    list-style-type: square;
    line-height: 1.6;
}

.youtube-theme-title {
    color: #ffffff;
    background-color: #222222;
    padding: 10px 20px;
    font-size: 1.4rem;
    font-weight: bold;
    border-left: 5px solid var(--btn-border-blue);
    align-self: flex-start;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15);
}

.youtube-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1200px;
}

.yt-video-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 2px solid #333333;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.yt-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 6px 0px rgba(0, 161, 217, 0.4);
    border-color: var(--btn-border-blue);
}

.yt-video-launcher {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: #000000;
}

.yt-video-launcher iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-video-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.yt-video-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #111111;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-video-description {
    font-size: 0.9rem;
    color: #555555;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   7. RESPONSIVE / MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
    
    .youtube-page-wrapper {
        flex-direction: column;
    }
    
    .youtube-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 3px solid #222222;
    }
}