/*
 * VAILS Design System
 * Charte Graphique Neuro-Symbolique
 * Version 1.1 - Novembre 2025
 */

/* ============================================
   1. VARIABLES CSS
   ============================================ */

:root {
    /* === COULEURS DE FOND === */
    --bg-darkest: #05050a;
    --bg-dark: #0a0a0f;
    --bg-sidebar: #0d0d14;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: rgba(30, 30, 45, 0.6);
    
    /* === COULEURS D'ACCENT === */
    --accent-magenta: #d946ef;
    --accent-magenta-dim: rgba(217, 70, 239, 0.15);
    --accent-cyan: #22d3ee;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;
    --accent-purple: #a855f7;
    
    /* === COULEURS DE TEXTE === */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* === BORDURES === */
    --border-subtle: rgba(217, 70, 239, 0.1);
    --border-glow: rgba(217, 70, 239, 0.3);
    
    /* === OMBRES === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    
    /* === LUEURS (GLOW) === */
    --glow-magenta: 0 0 20px rgba(217, 70, 239, 0.3);
    --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.3);
    
    /* === GRADIENTS === */
    --gradient-magenta: linear-gradient(135deg, #d946ef, #a855f7);
    --gradient-cyan: linear-gradient(135deg, #22d3ee, #3b82f6);
    --gradient-green: linear-gradient(135deg, #10b981, #059669);
    
    /* === TRANSITIONS & RADIUS === */
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-normal: 0.3s ease;
    
    /* === TYPOGRAPHIE === */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   2. RESET & BASE
   ============================================ */

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

body {
    background: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition-normal); }
ul { list-style: none; }

/* ============================================
   3. LAYOUT & NAVIGATION
   ============================================ */

.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span { color: var(--accent-magenta); }

.nav-links { display: flex; gap: 30px; }
.nav-links a { 
    font-size: 16px; 
    font-weight: 500; 
    color: var(--text-secondary); 
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-cyan); }

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

section { padding: 100px 0; position: relative; }

/* ============================================
   4. TYPOGRAPHY
   ============================================ */

h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 20px; }
h2 { font-size: 2.5rem; margin-bottom: 40px; text-align: center; }
h2 span { color: var(--accent-magenta); }

p.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
}

/* ============================================
   5. COMPONENTS
   ============================================ */

.btn {
    display: inline-flex;
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
}

.btn-primary {
    background: var(--gradient-magenta);
    color: white;
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 30px rgba(217, 70, 239, 0.5); }

.btn-secondary {
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}
.btn-secondary:hover { background: rgba(34, 211, 238, 0.1); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 30px;
    transition: var(--transition-normal);
}
.card:hover { border-color: var(--accent-magenta); transform: translateY(-5px); }

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); border: 1px solid rgba(34, 211, 238, 0.3); }

/* ============================================
   6. EFFECTS & ANIMATIONS
   ============================================ */

.bg-effects {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
}
.bg-grid {
    width: 100%; height: 100%;
    background-image: radial-gradient(circle, rgba(217, 70, 239, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15; }
.orb-1 { width: 500px; height: 500px; background: var(--accent-magenta); top: -100px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--accent-cyan); bottom: -100px; left: -100px; }

/* Code Block Styling */
.code-block {
    background: #000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    color: #fff;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.code-header {
    display: flex; gap: 8px; margin-bottom: 0; padding: 15px 20px;
    background: #111;
    border-bottom: 1px solid #222;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ef4444; } .dot-y { background: #eab308; } .dot-g { background: #10b981; }

/* Code Editor Layout */
.code-editor {
    display: flex;
    font-family: var(--font-mono);
    line-height: 1.5;
}

.line-numbers {
    text-align: right;
    padding: 20px 10px 20px 15px;
    color: #444;
    user-select: none;
    border-right: 1px solid #222;
    background: #0a0a0a;
}
.line-numbers span { display: block; }

.code-content {
    padding: 20px;
    white-space: pre-wrap; /* Modification pour le wrap */
    word-break: break-all; /* Assure que les longues chaînes cassent si nécessaire */
}

.syntax-kwd { color: var(--accent-magenta); }
.syntax-str { color: var(--accent-green); }
.syntax-fn { color: var(--accent-cyan); }
.syntax-var { color: var(--accent-yellow); }
.syntax-comment { color: #666; font-style: italic; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

@media (max-width: 900px) {
    h1 { font-size: 3rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .navbar { padding: 20px; }
    .nav-links { display: none; } /* Simplified for MVP */
}

/* ============================================
   17. DOCUMENTATION LAYOUT (NOUVEAU)
   ============================================ */

.doc-wrapper {
    display: flex;
    padding-top: 80px; /* Hauteur navbar */
    min-height: 100vh;
}

.doc-sidebar {
    width: 280px;
    background: rgba(13, 13, 20, 0.95);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: 80px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 30px 20px;
    backdrop-filter: blur(10px);
    z-index: 100;
}

/* Scrollbar fine pour la sidebar */
.doc-sidebar::-webkit-scrollbar {
    width: 6px;
}
.doc-sidebar::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
.doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-subtle); 
    border-radius: 3px;
}

.doc-content {
    flex: 1;
    margin-left: 280px; /* Largeur sidebar */
    padding: 40px 60px;
    max-width: 1200px;
}

.doc-menu-category {
    font-family: var(--font-display);
    color: var(--accent-magenta);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 30px;
}
.doc-menu-category:first-child { margin-top: 0; }

.doc-menu-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    transition: var(--transition-normal);
}

.doc-menu-link:hover, .doc-menu-link.active {
    background: rgba(217, 70, 239, 0.1);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-magenta);
}

.api-method {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
}

/* Langue Selector */
.lang-selector {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    margin-left: 15px;
}
.lang-selector:hover { 
    border-color: var(--accent-cyan); 
    color: var(--accent-cyan); 
}

/* Responsive pour la doc */
@media (max-width: 900px) {
    .doc-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .doc-sidebar.open { transform: translateX(0); }
    .doc-content { margin-left: 0; padding: 20px; }
}