@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #00b336;
    --primary-dark: #008f2b;
    --primary-glow: rgba(0, 179, 54, 0.3);
    --bg-dark: #0a0e14;
    --bg-card: #111923;
    --bg-card-hover: #182030;
    --bg-nav: rgba(10, 14, 20, 0.95);
    --text: #e0e6ed;
    --text-muted: #8892a4;
    --border: #1e2a3a;
    --danger: #ff4757;
    --warning: #ffa502;
    --info: #3498db;
    --success: #00b336;
    --gradient: linear-gradient(135deg, #00b336, #0099cc);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
}
.logo-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0,179,54,0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
}
.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(0,179,54,0.08);
}
.nav-dropdown { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: var(--shadow);
}
.nav-dropdown:hover .dropdown-content { display: block; }
.dropdown-content a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.9rem;
}
.dropdown-content a:hover {
    background: rgba(0,179,54,0.1);
    color: var(--primary);
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

/* HERO */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(0,179,54,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(0,153,204,0.06) 0%, transparent 60%);
}
.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,179,54,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,179,54,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
}
.hero-badge {
    display: inline-block;
    background: rgba(0,179,54,0.1);
    border: 1px solid rgba(0,179,54,0.3);
    color: var(--primary);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}
.hero-title .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
}
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}
.stat-item {
    text-align: center;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0,179,54,0.05);
}

/* SECTIONS */
.section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}
.section-badge {
    display: inline-block;
    background: rgba(0,179,54,0.1);
    border: 1px solid rgba(0,179,54,0.2);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.section-subtitle {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
}

/* COURSE CARDS */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}
.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.course-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,179,54,0.15);
    background: var(--bg-card-hover);
}
.course-card:hover::before { opacity: 1; }
.course-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    background: rgba(0,179,54,0.1);
    border: 1px solid rgba(0,179,54,0.2);
}
.course-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.course-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}
.course-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.course-level {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.level-debutant { background: rgba(0,179,54,0.15); color: #00e63f; }
.level-intermediaire { background: rgba(255,165,2,0.15); color: #ffa502; }
.level-expert { background: rgba(255,71,87,0.15); color: #ff4757; }

/* COURSE LIST (inside detail pages) */
.course-list {
    list-style: none;
    padding: 0;
}
.course-list li {
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    cursor: default;
}
.course-list li:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}
.course-list .lesson-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,179,54,0.1);
    border-radius: 8px;
}
.course-list .lesson-title { font-weight: 600; flex: 1; }
.course-list .lesson-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.course-list .lesson-content {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}
.course-list li.expanded .lesson-content { display: block; }
.course-list li .toggle-icon {
    transition: transform 0.3s;
    color: var(--text-muted);
}
.course-list li.expanded .toggle-icon { transform: rotate(90deg); }

/* PAGE HEADER */
.page-header {
    padding: 8rem 2rem 3rem;
    text-align: center;
    position: relative;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* QUIZ */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}
.quiz-question {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.quiz-question h3 {
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    display: flex;
    gap: 0.8rem;
}
.quiz-question h3 .q-num {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.quiz-option {
    padding: 0.9rem 1.2rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}
.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(0,179,54,0.05);
}
.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(0,179,54,0.1);
}
.quiz-option.correct {
    border-color: var(--success);
    background: rgba(0,179,54,0.15);
    color: var(--success);
}
.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(255,71,87,0.15);
    color: var(--danger);
}
.quiz-option.disabled { pointer-events: none; }
.quiz-result {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: none;
}
.quiz-result.show { display: block; }
.quiz-score {
    font-size: 3rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}
.quiz-explanation {
    margin-top: 0.8rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}
.quiz-option.correct + .quiz-explanation,
.quiz-option.incorrect + .quiz-explanation {
    display: block;
}

/* TERMINAL */
.terminal-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}
.terminal-window {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: #161b22;
    border-bottom: 1px solid var(--border);
}
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }
.terminal-title {
    margin-left: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.terminal-output {
    padding: 1rem 1.5rem;
    height: 500px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #e6e6e6;
}
.terminal-output .prompt {
    color: var(--primary);
}
.terminal-output .cmd-text {
    color: #fff;
}
.terminal-output .output-text {
    color: #8892a4;
}
.terminal-output .error-text {
    color: var(--danger);
}
.terminal-output .success-text {
    color: var(--success);
}
.terminal-output .warning-text {
    color: var(--warning);
}
.terminal-output .info-text {
    color: var(--info);
}
.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem 1rem;
    gap: 0.5rem;
}
.terminal-input-line .prompt {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
}
#terminalInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
    caret-color: var(--primary);
}

/* FOOTER */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    margin-top: 4rem;
}
.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}
.footer-links a:hover { color: var(--primary); }

/* TABS */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}
.tab-btn:hover, .tab-btn.active {
    background: rgba(0,179,54,0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* INFO BOXES */
.info-box {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid;
    background: var(--bg-card);
}
.info-box.tip { border-color: var(--primary); }
.info-box.warning { border-color: var(--warning); }
.info-box.danger { border-color: var(--danger); }
.info-box.info { border-color: var(--info); }
.info-box h4 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.info-box p, .info-box ul {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.info-box ul {
    list-style: none;
    padding: 0;
}
.info-box ul li::before {
    content: '▸ ';
    color: var(--primary);
}

/* PROGRESS BAR */
.progress-container {
    margin: 2rem 0;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.open { display: flex; }
    .hamburger { display: flex; }
    .hero-stats { gap: 1.5rem; }
    .courses-grid { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; text-align: center; }
}


/* ===== BOUTON RETOUR MENU PRINCIPAL (Horizon 5) ===== */
.nav-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-right: 10px; flex-shrink: 0;
    border-radius: 10px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14); color: #fff;
    text-decoration: none; font-size: 1.3rem; font-weight: 700; line-height: 1;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.nav-back:hover {
    background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); transform: translateX(-2px);
}

/* ===== HARMONISATION VISUELLE HORIZON 5 (audit septembre 2026) ===== */
/* Bloc additif : uniformise sans changer l'accent de la formation. */
/* Correspondance des noms de variables (cette formation utilise --primary/--text). */
:root {
    --accent: var(--primary);
    --accent-dim: var(--primary-dark);
    --accent-glow: var(--primary-glow);
    --text-primary: var(--text);
    --text-secondary: var(--text-muted);
    --radius: 12px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
}
/* Boutons : paddings et radius unifies, transition 0.25s */
.btn { padding: 0.8rem 1.8rem; border-radius: 10px; transition: all 0.25s ease; }
/* Cartes : radius 12px, transition 0.25s */
.course-card, .module, .modal, .memo-card, .install-card, .quiz-q, .flash-card, .schema-card, .first-steps-box, .coach-zone { border-radius: 12px; transition: all 0.25s ease; }
/* Focus clavier visible */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.nav-back:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* Details et summary : curseur pointeur et espacement */
details summary { cursor: pointer; margin: 4px 0; }
/* Composants communs */
.disclaimer { margin-top: 8px; font-size: 0.85em; color: var(--text-muted); line-height: 1.6; }
.course-section { margin-top: 24px; }
.course-section h4 { margin-bottom: 10px; font-size: 1.1rem; }
.course-section p { margin-bottom: 12px; font-size: 0.95rem; color: var(--text-muted); }
.course-section ul { margin: 0 0 12px 20px; }
.course-section ul li { margin-bottom: 6px; font-size: 0.93rem; }
.course-code { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; padding: 2px 6px; border-radius: 4px; }
.course-note { border-radius: 8px; padding: 14px 16px; margin: 14px 0; font-size: 0.9rem; }
/* Tableaux : defilement horizontal sur petit ecran */
.table-responsive { overflow-x: auto; }
/* Responsive minimal : hamburger, grilles en 1 colonne, tableaux scrollables */
@media (max-width: 768px) {
    .course-grid, .install-grid, .memo-grid, .level-grid, .courses-grid, .footer-grid { grid-template-columns: 1fr; }
    table.memo, .cmd-table, .exam-table { display: block; width: 100%; overflow-x: auto; }
    .hero { padding: 100px 16px 60px; }
    .section { padding: 60px 16px; }
    .nav-menu.open, .nav-menu.active { display: flex; }
}
