/* =========================================
   0. IMPORTS & FONTS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Rajdhani:wght@500;600;700&display=swap');

/* =========================================
   1. VARIABLES & CONFIGURATION
   ========================================= */
:root {
    /* --- Couleurs de Fond & Structure --- */
    --bg-deep: #050608;          /* Noir profond */
    --bg-body-gradient: radial-gradient(circle at top right, #1a1f2e 0%, #050608 60%);
    
    /* --- Glassmorphism (Effet Verre) --- */
    --glass-panel: rgba(22, 27, 34, 0.70);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    
    /* --- Palette Néon (Accents) --- */
    --primary: #ff6b05;          /* Orange signature */
    --primary-glow: rgba(255, 107, 5, 0.5);
    
    --secondary: #00f2ff;        /* Cyan électrique */
    --secondary-glow: rgba(0, 242, 255, 0.4);
    
    --success: #00e676;
    --danger: #ff1744;
    --rare: #d500f9;
    --legendary: #ffab00;

    /* --- Typographie --- */
    --font-head: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --text-light: #f0f6fc;
    --text-dim: #8b949e;

    /* --- Dimensions --- */
    --sidebar-w: 300px;
    --header-h: 90px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    
    /* --- Animations --- */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --anim-fast: 0.2s var(--ease-out);
    --anim-slow: 0.4s var(--ease-out);
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-deep);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        var(--bg-body-gradient);
    background-size: 40px 40px, 40px 40px, 100% 100%; /* Effet grille subtil */
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

/* Scrollbars Stylisées */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =========================================
   3. LAYOUT GLOBAL
   ========================================= */
.wiki-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* --- Sidebar (Menu Gauche) --- */
.sidebar {
    width: var(--sidebar-w);
    background: rgba(10, 11, 16, 0.95);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.logo-area {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255,107,5,0.08), transparent);
}

.logo-area h1 {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 15px var(--primary-glow);
}
.logo-area .version {
    font-size: 0.8rem;
    background: var(--primary);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    vertical-align: middle;
    margin-left: 10px;
}

#wiki-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: var(--anim-fast);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid transparent;
}

.nav-item i { 
    width: 24px; 
    text-align: center; 
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

/* Hover State */
.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Active State */
.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 107, 5, 0.15), transparent);
    color: var(--primary);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: inset 10px 0 20px -10px var(--primary-glow);
}
.nav-item.active i {
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--primary);
}

/* --- Zone Principale --- */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header */
header {
    height: var(--header-h);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5, 6, 8, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

#page-title {
    font-family: var(--font-head);
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 5px;
}
/* Petite barre sous le titre */
#page-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary-glow);
}

/* Barre de Recherche Futuriste */
.search-box {
    position: relative;
    width: 380px;
}
.search-box i {
    position: absolute;
    left: 15px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    transition: var(--anim-fast);
}
.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px 15px 12px 45px;
    border-radius: 50px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--anim-slow);
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: #000;
    box-shadow: 0 0 20px var(--primary-glow);
}
.search-box input:focus + i { color: var(--primary); }

/* Zone de Contenu Défilante */
.content-display {
    padding: 40px 50px; /* Plus d'espace sur les côtés */
    overflow-y: auto;
    scroll-behavior: smooth;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
   4. COMPOSANTS : CARTES (Card Grid)
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* Plus large */
    gap: 30px; /* Plus d'espace entre les cartes */
    padding-bottom: 50px;
}

.wiki-card {
    background: var(--glass-panel);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    transition: var(--anim-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Effet de brillance en haut de la carte */
.wiki-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* Animation et Hover */
.wiki-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border-color: rgba(255, 255, 255, 0.2);
}
.wiki-card:hover h4 { color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }

/* Contenu Carte */
.wiki-card h4 {
    font-family: var(--font-head);
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: #fff;
    transition: var(--anim-fast);
}

.wiki-card .subtitle {
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    display: inline-block;
    opacity: 0.8;
}

/* Lignes de statistiques */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-row:last-child { border-bottom: none; }

.stat-row span:first-child {
    color: var(--text-dim);
    font-size: 0.95rem;
}
.stat-row .value {
    color: #fff;
    font-weight: 600;
    font-family: var(--font-head);
    font-size: 1.1rem;
}

/* Images dans les cartes */
.wiki-card img {
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
    filter: brightness(0.9);
}

/* =========================================
   5. COMPOSANTS : TABLEAUX (Data Table)
   ========================================= */
h3 {
    font-family: var(--font-head);
    color: var(--text-light);
    font-size: 1.8rem;
    margin: 40px 0 25px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
h3::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 40px;
    background: rgba(22, 27, 34, 0.4); /* Plus transparent que les cartes */
    backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.data-table th {
    background: rgba(30, 35, 45, 0.9);
    color: var(--secondary);
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 25px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
}

.data-table td {
    padding: 18px 25px; /* Beaucoup d'espace */
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-size: 1rem;
    vertical-align: middle;
}

.data-table tr { transition: background 0.2s; }
.data-table tr:hover { background: rgba(255, 255, 255, 0.03); }
.data-table tr:hover td { color: #fff; }
.data-table tr:last-child td { border-bottom: none; }

/* Icônes dans le tableau */
.data-table i { color: var(--text-dim); font-size: 1.2rem; }
.data-table tr:hover i { color: #fff; }

/* =========================================
   6. ÉLÉMENTS SPÉCIAUX (Notes & Couleurs)
   ========================================= */
   
/* Note Box (extraInfo) */
/* Ciblée via l'attribut style généré par le JS, 
   mais on surcharge pour le style */
div[style*="background-color: rgba(0, 229, 255, 0.1)"] {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.05) 0%, transparent 100%) !important;
    border-left: 4px solid var(--secondary) !important;
    color: var(--text-light);
    padding: 25px !important;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin-top: 40px !important;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Classes utilitaires pour le JS si besoin, ou auto-détectées */
.cost { color: var(--danger); font-weight: 700; }
.buff { color: var(--success); font-weight: 700; }

/* Animation d'apparition du contenu */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Appliquer l'animation aux conteneurs principaux */
.card-grid, .data-table, div[style*="background-color"] {
    animation: fadeSlideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* =========================================
   7. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
    .sidebar { width: 260px; }
    .content-display { padding: 30px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
    .wiki-container { flex-direction: column; height: auto; overflow: visible; }
    body { overflow-y: auto; }
    
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    
    #wiki-nav { 
        flex-direction: row; 
        overflow-x: auto; 
        padding: 15px;
    }
    .nav-item { white-space: nowrap; padding: 10px 15px; font-size: 0.9rem; }
    
    header { 
        flex-direction: column; 
        height: auto; 
        padding: 20px; 
        gap: 15px;
        background: var(--bg-deep);
        position: relative;
    }
    .search-box { width: 100%; }
    
    .content-area { overflow: visible; }
    .content-display { padding: 20px; }
}

/* =========================================
   8. ICÔNES DE STATS & COULEURS
   ========================================= */

/* Groupe de stats (ex: 10 PV / 5 ATK) */
.stat-group {
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-group span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-family: var(--font-head);
    font-size: 1.1em;
}

/* Couleurs spécifiques aux stats */
.icon-hp   { color: #ff4757; } /* Rouge vie */
.icon-atk  { color: #ffa502; } /* Orange attaque */
.icon-def  { color: #00a8ff; } /* Bleu défense */
.icon-spd  { color: #2ed573; } /* Vert vitesse */
.icon-time { color: #ced6e0; } /* Gris temps */

/* Couleurs ressources */
.icon-rat  { color: #ff6b6b; } /* Rations */
.icon-fer  { color: #a4b0be; } /* Ferraille */
.icon-jz   { color: #e056fd; } /* Jetons Z */
.icon-ht   { color: #00d2d3; } /* High-Tech (Nouveau cyan) */