@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* --- PALETTE "KOTHAN ROMEO" (Appliquée à la structure) --- */
    --bg-body: #111111;          /* Noir mat */
    --bg-card: #161616;          /* Fond des cartes */
    --bg-card-hover: #1d1d1d;    /* Fond au survol */
    
    --primary: #ffffff;          /* Accent principal (Blanc pur au lieu du bleu) */
    --text-main: #EDEDED;        /* Texte principal (Blanc cassé) */
    --text-muted: #888888;       /* Texte secondaire (Gris) */
    
    --border: 1px solid #333333; /* Bordures subtiles (Faint) */
    --border-hover: #555555;     
    
    --font-main: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

/* LAYOUT PRINCIPAL (Sticky Footer Fix) */

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main); /* Uniformisation de la police */
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.main-content { flex: 1; display: flex; flex-direction: column; }
.margin-top { margin-top: 40px; }

/* NAVBAR (Adaptée au style Matte) */

.navbar {
    height: 72px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2000;
    background: rgba(17, 17, 17, 0.95); /* Noir mat translucide */
    backdrop-filter: blur(16px);
    border-bottom: var(--border);
}

.navbar-left { flex: 1; display: flex; justify-content: flex-start; }
.navbar-center { flex: 1; display: flex; justify-content: center; }
.navbar-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 15px; }

.logo {
    font-family: var(--font-main);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.3s;
    letter-spacing: -0.02em;
}

.logo:hover { text-shadow: 0 0 15px rgba(255, 255, 255, 0.3); } /* Glow blanc discret */
.logo i { color: var(--text-main); }

/* MENU PC */

.desktop-menu { display: flex; align-items: center; gap: 8px; }
.nav-group { position: relative; height: 100%; display: flex; align-items: center; }

.nav-btn {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 99px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}
.nav-btn:hover i { color: var(--primary); transform: translateY(-1px); }

.nav-btn.active {
    background: #222;
    color: var(--primary);
    border: 1px solid #444;
}
.nav-btn.active i { color: var(--primary); }

.dropdown-menu {
    position: absolute;
    width: 280px;
    background: var(--bg-card);
    border: var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 5000;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    margin-top: 5px;
}

.nav-group:hover > .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.folder-item {
    position: relative;
    padding: 10px 12px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.folder-item > .dropdown-menu { top: -5px; left: 100%; margin-left: 10px; margin-top: 0; transform: none !important; }
.folder-item:hover > .dropdown-menu { opacity: 1; visibility: visible; }

.folder-item:hover { background: var(--bg-card-hover); color: #fff; }
.folder-item i { color: var(--text-muted); }

.file-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: 0.2s;
}

.file-item:hover {
    color: var(--bg-body);
    background: var(--primary); /* Fond blanc au survol */
    transform: translateX(3px);
}
.file-item i { margin-right: 10px; opacity: 0.7; width: 14px; text-align: center; }

.menu-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 12px 4px 12px;
}

.dropdown-divider { height: 1px; background: #333; margin: 6px 0; }

/* HERO DASHBOARD (Style Minimaliste) */

/* HERO DASHBOARD - Style "Kothan Romeo" (Noir Mat Uni) */

.hero-wrapper {
    position: relative;
    /* Couleur de fond unie du thème Kothan (#111111) */
    background-color: var(--bg-body); 
    
    /* SUPPRESSION TOTALE DE LA GRILLE ICI (background-image: none) */
    background-image: none;
    
    padding: 80px 20px;
    border-bottom: var(--border); /* Bordure subtile définie dans le :root */
    overflow: hidden;
    text-align: center;
    margin-bottom: 40px;
}

/* Le halo lumineux (Glow) adapté en monochrome pour rester dans le thème */
.hero-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    /* On remplace le bleu par une lueur blanche très faible (3%) pour donner juste un peu de profondeur */
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(17, 17, 17, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-title {
    font-family: var(--font-main);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; font-weight: 400; }

/* STATS */

.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 40px; }

.stat-box {
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    transition: transform 0.3s, border-color 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 40px; height: 40px;
    background: #222;
    color: var(--text-main);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 15px;
    border: 1px solid #333;
}

.stat-number {
    display: block;
    font-family: var(--font-main);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 1px; }

/* LISTE RÉCENTS */

.recent-section { max-width: 1000px; margin: 0 auto; }

.recent-list-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: 0.2s;
}

.recent-list-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    padding-left: 25px;
}

.recent-meta { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 6px; }

/* SEPARATEUR */

.section-divider { display: flex; align-items: center; gap: 15px; margin: 40px 0 30px 0; }
.section-divider span { font-family: var(--font-main); font-size: 1.2rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.01em; }
.section-line { flex: 1; height: 1px; background: #333; }

/* CARTES (GRID) */

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

.grid-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-bottom: 80px; }

.card {
    position: relative;
    display: flex; flex-direction: column; justify-content: flex-end;
    min-height: 220px;
    padding: 25px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    background: var(--bg-card);
    border: var(--border);
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1; opacity: 0.6; /* Assombri pour le thème */
    transition: transform 0.5s ease, opacity 0.5s;
}

.card-content { position: relative; z-index: 3; display: flex; flex-direction: column; }

.card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(17,17,17,1) 10%, rgba(17,17,17,0.2) 100%);
    z-index: 2;
}

.card:hover { transform: translateY(-5px); border-color: var(--border-hover); }
.card:hover .card-img { transform: scale(1.05); opacity: 0.4; }

.card-tag {
    font-size: 0.7rem; text-transform: uppercase;
    color: var(--bg-body); font-weight: 700;
    background: var(--text-main); /* Tag Blanc */
    padding: 4px 10px; border-radius: 4px;
    width: fit-content; margin-bottom: auto;
}

.card-title {
    font-family: var(--font-main);
    font-size: 1.2rem;
    color: #fff;
    margin: 10px 0 0 0;
    font-weight: 600;
}

/* DIVERS & SEARCH */

.search-form { position: relative; display: flex; align-items: center; }

.search-input {
    background: var(--bg-card);
    border: var(--border);
    color: var(--text-main);
    height: 40px;
    padding: 0 15px 0 42px;
    border-radius: 99px;
    outline: none;
    width: 220px;
    transition: all 0.3s;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.search-input:focus {
    border-color: var(--text-muted);
    width: 280px;
    background: var(--bg-card-hover);
}

.search-icon { position: absolute; left: 16px; color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }

.section-header { margin-bottom: 30px; border-left: 3px solid var(--primary); padding-left: 20px; }
.section-title { font-family: var(--font-main); font-size: 1.8rem; margin: 0; color: var(--text-main); font-weight: 700; }

.article-box { background: var(--bg-card); border: var(--border); border-radius: 12px; padding: 40px; margin-bottom: 40px; }

.breadcrumb {
    background: var(--bg-card);
    padding: 10px 15px; border-radius: 6px;
    display: inline-flex; gap: 10px; margin-bottom: 20px;
    font-size: 0.85rem; border: var(--border);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-main); }

pre {
    position: relative;
    background: #000;
    padding: 20px;
    border-radius: 8px;
    border: var(--border);
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: #222; color: #ccc;
    border: 1px solid #444;
    padding: 5px 10px; border-radius: 4px;
    cursor: pointer; font-size: 0.8rem;
}
.copy-btn:hover { background: #333; color: #fff; }

.site-footer {
    padding: 40px 20px;
    text-align: center;
    border-top: var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-body);
    margin-top: auto;
}

/* MOBILE */

.mobile-toggle { display: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; padding: 5px; }

@media (max-width: 1024px) {
    .desktop-menu, .search-form { display: none; }
    .mobile-toggle { display: block; }
    .hero-title { font-size: 2.2rem; }
}

.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg-body); padding: 20px 0; overflow-y: auto;
    z-index: 9999; transform: translateX(100%); transition: 0.3s;
}

.mobile-overlay.active { transform: translateX(0); }
.mobile-top-bar { padding: 0 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.mobile-folder-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; color: var(--text-main);
    font-weight: 500; cursor: pointer; transition: 0.2s;
    border-bottom: 1px solid #222;
}

.mobile-folder-header.open i.icon-folder { color: var(--primary); }

.mobile-file {
    display: flex; align-items: center;
    padding: 12px 15px 12px 20px;
    color: var(--text-muted); text-decoration: none;
    font-size: 0.95rem; position: relative; transition: 0.2s;
}
.mobile-file:hover { color: var(--text-main); background: #222; }
.mobile-file.active { color: var(--text-main); border-left: 2px solid var(--primary); background: #222; }
/* --- BLOCS D'INFORMATION (ADMONITIONS) --- */

/* Style de base commun */
.admonition {
    position: relative;
    padding: 16px 20px;
    margin: 25px 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08); /* Bordure subtile globale */
    background-color: var(--bg-card); /* Fond noir #161616 */
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.admonition:hover {
    transform: translateX(4px); /* Petit effet de mouvement au survol */
}

/* Titre en gras */
.admonition strong {
    display: block;
    color: var(--text-main); /* Blanc */
    margin-bottom: 4px;
    font-size: 1rem;
}

/* L'icône */
.admonition i {
    font-size: 1.2rem;
    margin-top: 3px;
    flex-shrink: 0;
}

/* --- VARIANTE : NOTE / INFO (Bleu) --- */
.admonition.info {
    border-left: 3px solid #3b82f6;
    /* Dégradé très léger bleu vers transparent */
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 100%);
}
.admonition.info i { color: #3b82f6; }

/* --- VARIANTE : ATTENTION / WARNING (Jaune/Orange) --- */
.admonition.warning {
    border-left: 3px solid #eab308;
    /* Dégradé très léger orange vers transparent */
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.08) 0%, var(--bg-card) 100%);
}
.admonition.warning i { color: #eab308; }

/* --- VARIANTE : DANGER (Rouge) --- */
.admonition.danger {
    border-left: 3px solid #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-card) 100%);
}
.admonition.danger i { color: #ef4444; }
/* --- LAYOUT EN-TÊTE D'ARTICLE (Titre + Sommaire) --- */
.article-head {
    display: grid;
    /* 1ère colonne : le texte (prend tout l'espace restant)
       2ème colonne : le sommaire (fixe à 300px) */
    grid-template-columns: 1fr 300px;
    gap: 40px; /* Espace entre le texte et le sommaire */
    align-items: start; /* Aligne tout en haut */
    margin-bottom: 40px; /* Espace avant que l'article commence vraiment */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Séparateur subtil */
    padding-bottom: 30px;
}

/* Le style visuel du sommaire */
.toc-container {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
    width: 100%; /* Il remplit sa colonne de 300px */
}

.toc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 6px; font-size: 0.9rem; }
.toc-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toc-list a:hover { color: #fff; transform: translateX(3px); }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 900px) {
    .article-head {
        display: flex;
        flex-direction: column-reverse; /* Le titre passe au dessus du sommaire */
        gap: 20px;
    }
    .toc-container { width: 100%; }
}
/* Conteneur de la grille de règles */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Carte individuelle */
.rule-card {
    background: rgba(30, 41, 59, 0.4); /* Fond sombre transparent */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}

.rule-card:hover {
    border-color: var(--primary); /* Couleur au survol */
    transform: translateY(-2px);
}

/* Numéro de la règle (01, 02...) */
.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.rule-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary); /* Cyan/Bleu */
    opacity: 0.8;
}

.rule-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Contenu de la règle */
.rule-body {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.rule-body strong {
    color: #fff;
    display: block; /* Titre sur une nouvelle ligne */
    margin-bottom: 4px;
}

/* Mise en valeur spécifique */
.highlight-warn { color: #facc15; font-style: italic; }
.highlight-code { 
    background: rgba(0,0,0,0.3); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: 'Courier New', monospace; 
    color: #e2e8f0;
}
/* --- CSS MENU MOBILE --- */

/* L'overlay qui couvre tout l'écran */
.mobile-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: #0f172a; /* Fond bleu nuit */
    z-index: 10000; /* Très important : doit être au dessus de tout */
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%); /* Caché par défaut vers la droite */
    transition: transform 0.3s ease-in-out;
    display: block; /* Toujours block, on joue sur transform */
}

/* Quand le menu est ouvert via JS */
.mobile-overlay.active {
    transform: translateX(0);
}

/* Header des dossiers (bouton cliquable) */
.mobile-folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: #e2e8f0;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 500;
}

/* La flèche qui tourne */
.mobile-folder-header .chevron {
    transition: transform 0.2s;
    font-size: 0.8rem;
    opacity: 0.7;
}
.mobile-folder-header.open .chevron {
    transform: rotate(90deg);
    color: #3b82f6;
}

/* Contenu caché (sous-dossiers) */
.mobile-sub-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 15px; /* Décalage vers la droite */
    border-left: 1px solid rgba(255,255,255,0.1);
}

/* Liens des fichiers */
.mobile-file {
    display: block;
    padding: 10px 0;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
}
.mobile-file:hover, .mobile-file.active {
    color: #3b82f6;
    padding-left: 5px;
}

/* Titres des sections principales (LINUX, WINDOWS...) */
.mobile-section-title {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 1px;
}



/* --- PAGE 404 --- */
.error-container {
    text-align: center;
    padding: 60px 20px;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.4); /* Fond léger */
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.error-code {
    font-family: 'Outfit', sans-serif; /* Ou votre police titre */
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    margin: 10px 0;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
}

.error-icon {
    font-size: 4rem;
    color: #eab308;
    margin-bottom: 10px;
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}

.error-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 700;
}

.error-desc {
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1.6;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #3b82f6;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-home:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
/* Style pour l'image du logo */
.site-logo-img {
    height: 30px;        /* Hauteur adaptée à la barre */
    width: auto;         /* Largeur automatique */
    vertical-align: middle; /* Bien aligné avec le texte */
    margin-right: 10px;  /* Espace entre l'image et le texte "WikiDoc" */
    border-radius: 4px;  /* Optionnel : coins légèrement arrondis */
}