/* =====================================================
   COURS MEMO - STYLESHEET
   Créé par Antigravity - 2025
   ===================================================== */

:root {
    --primary: #68a063;
    /* Default Green - To be customized per course */
    --primary-bright: #83cd29;
    --secondary: #303030;
    --accent: #ffffff;
    --bg: #222222;
    --bg2: #2b2b2b;
    --card: #303030;
    --text: #f0f0f0;
    --muted: #a0a0a0;
    --border: #444444;

    /* Syntax Highlighting */
    --kw: #c792ea;
    --fn: #82aaff;
    --str: #c3e88d;
    --num: #f78c6c;
    --c: #546e7a;
    --var: #ffcb6b;

    /* Technical Modules Colors */
    --tech-data: #3ECF8E;
    --tech-api: #0984e3;
    --tech-ux: #e17055;
    --tech-code: #fd79a8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === HEADER === */
header {
    position: sticky;
    top: 0;
    background: rgba(34, 34, 34, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 16px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-bright);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--primary-bright);
    border: 2px solid var(--primary-bright);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--bg2);
    color: var(--primary-bright);
}

/* === MOBILE MENU BTN === */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 110;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary-bright);
    transition: 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.close-menu-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--primary-bright);
    font-size: 2rem;
    cursor: pointer;
}

/* === HERO === */
.hero {
    padding: 70px 0 50px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(circle at center, rgba(104, 160, 99, 0.1) 0%, transparent 60%);
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-bright);
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(104, 160, 99, 0.3);
}

.hero p {
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* === INFO BOXES === */
.intro-box {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 30px 0;
}

.intro-box h3 {
    margin-top: 0;
    color: var(--primary-bright);
}

/* === TOC === */
.toc {
    padding: 35px 0;
    border-bottom: 1px solid var(--border);
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
    transition: all 0.2s;
}

.toc-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    background: rgba(104, 160, 99, 0.1);
}

.toc-num {
    width: 26px;
    height: 26px;
    background: rgba(104, 160, 99, 0.15);
    color: var(--primary-bright);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid rgba(104, 160, 99, 0.3);
}

/* === SECTIONS === */
section {
    padding: 55px 0;
    border-bottom: 1px solid var(--border);
}

.sec-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
}

.sec-num {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), #3e6e39);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(104, 160, 99, 0.2);
}

.sec-title {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-bright);
}

.sec-sub {
    color: var(--muted);
    font-size: 0.95rem;
}

/* === DETAILS === */
details {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 14px 0;
    overflow: hidden;
}

summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-bright);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

summary:hover {
    background: rgba(131, 205, 41, 0.05);
}

summary::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--muted);
    transition: transform 0.2s;
}

details[open] summary::after {
    transform: rotate(45deg);
}

.details-content {
    padding: 16px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* === CODE === */
.code {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 14px 0;
    overflow: hidden;
}

.code-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #252526;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.r {
    background: #ff5f56;
}

.dot.y {
    background: #ffbd2e;
}

.dot.g {
    background: #27ca40;
}

pre {
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    overflow-x: auto;
    color: #abb2bf;
}

.kw {
    color: var(--kw);
}

.fn {
    color: var(--fn);
}

.str {
    color: var(--str);
}

.num {
    color: var(--num);
}

.c {
    color: var(--c);
    font-style: italic;
}

.var {
    color: var(--var);
}

/* === UTILS === */
.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tip,
.info,
.warning {
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    margin: 14px 0;
    font-size: 0.95rem;
}

.tip {
    background: rgba(104, 160, 99, 0.1);
    border-left: 3px solid var(--primary);
}

.warning {
    background: rgba(247, 140, 108, 0.1);
    border-left: 3px solid var(--num);
}

.tip strong,
.warning strong {
    color: var(--primary-bright);
}

/* === FOOTER === */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(20, 20, 23, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 105;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
        width: 80%;
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .close-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .sec-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sec-num {
        margin-bottom: 10px;
    }
}

/* === INTERACTIVE VOCAB === */
.vocab-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.vocab-chip:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.vocab-chip::after {
    content: '?';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-left: 8px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* === TOAST NOTIFICATION === */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 23, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-bright);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
    width: 400px;
    pointer-events: none;
}

.toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-title {
    color: var(--primary-bright);
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-body {
    color: #dfe6e9;
    font-size: 0.9rem;
    line-height: 1.5;
}