/* =====================================================
   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;

    /* Semantic Palette */
    --color-red: #ff7675;
    --color-red-dark: #d63031;
    --color-blue: #74b9ff;
    --color-blue-dark: #0984e3;
    --color-green: #55efc4;
    --color-green-dark: #00b894;
    --color-yellow: #ffeaa7;
    --color-orange: #fdcb6e;
    --color-purple: #a29bfe;
    --color-purple-dark: #6c5ce7;
    --color-cyan: #81ecec;
    --color-pink: #e84393;
}

/* Color Utilities */
.text-red {
    color: var(--color-red);
}

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

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

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

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

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

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

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

.text-primary {
    color: var(--primary-bright);
}

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

.bg-red-soft {
    background: rgba(255, 118, 117, 0.1);
    border-color: var(--color-red);
}

.bg-blue-soft {
    background: rgba(116, 185, 255, 0.1);
    border-color: var(--color-blue);
}

.bg-green-soft {
    background: rgba(85, 239, 196, 0.1);
    border-color: var(--color-green);
}

.bg-purple-soft {
    background: rgba(162, 155, 254, 0.1);
    border-color: var(--color-purple);
}

.bg-orange-soft {
    background: rgba(253, 203, 110, 0.1);
    border-color: var(--color-orange);
}

.border-left-red {
    border-left: 4px solid var(--color-red);
}

.border-left-blue {
    border-left: 4px solid var(--color-blue);
}

.border-left-green {
    border-left: 4px solid var(--color-green);
}

.border-left-purple {
    border-left: 4px solid var(--color-purple);
}

.border-left-orange {
    border-left: 4px solid var(--color-orange);
}

.gradient-text-00 {
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

* {
    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;
    width: 100%;
    /* Ensure fluid width */
}

img {
    max-width: 100%;
    /* Prevent overflow */
    height: auto;
}

/* === 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-menu {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg2);
    color: var(--primary-bright);
}

.hamburger {
    display: none;
    /* Hidden on Desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* === PREMIUM UTILITIES & DESIGN SYSTEM === */

/* Glassmorphism */
.glass-panel {
    background: rgba(48, 48, 48, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-header {
    background: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modern Cards */
.card-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Gradients & Text */
.gradient-text-primary {
    background: linear-gradient(135deg, #83cd29, #68a063);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-hero {
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Module Grid Premium */
.module-card {
    background: linear-gradient(145deg, var(--bg2), #252525);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.module-card:: sebelum {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border-color, var(--border));
    opacity: 0.7;
}

.module-card:hover {
    background: linear-gradient(145deg, #2f2f2f, #2a2a2a);
    border-color: var(--border-color, var(--primary));
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.module-num {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.4;
    font-weight: 700;
}

/* Interactive Elements */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5a8f55);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(104, 160, 99, 0.3);
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(104, 160, 99, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.2s;
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text);
}

/* Layout Refinements */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

.mt-25 {
    margin-top: 25px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

.text-center {
    text-align: center;
}

.h-100 {
    height: 100%;
}

.block {
    display: block;
}


.caesar-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.caesar-display {
    font-family: 'JetBrains Mono', monospace;
    background: #000;
    color: #55efc4;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-align: center;
    border: 1px dashed #55efc4;
}

input[type="range"] {
    accent-color: #6c5ce7;
    cursor: pointer;
}

.hash-output-fancy {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #fab1a0;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Image Containers */
.img-container-premium {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.img-container-premium img {
    max-width: 50%;
    margin: 0 auto;
    display: block;
    transition: transform 0.3s ease;
}

.img-container-premium:hover img {
    transform: scale(1.02);
}

.img-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px;
    color: #fff;
    font-size: 0.9rem;
}

/* Timeline for Case Studies */
.timeline-item {
    border-left: 2px solid var(--primary);
    padding-left: 20px;
    margin-bottom: 25px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--primary-bright);
    margin-bottom: 5px;
    font-weight: bold;
}

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

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

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

        /* Hide the MENU links, not the Navbar container */
        .nav-menu {
            display: none;
            flex-direction: column;
            position: absolute;
            top: 100%;
            /* Height of header */
            left: 0;
            width: 100%;
            background: rgba(34, 34, 34, 0.98);
            border-bottom: 1px solid var(--border);
            padding: 20px;
            gap: 15px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
            z-index: 1000;
            backdrop-filter: blur(10px);
        }

        /* When active class is added by JS */
        .nav-menu.active {
            display: flex;
        }

        .hamburger {
            display: flex;
        }

        .sec-header {
            flex-direction: column;
        }

        .grid2,
        .grid3 {
            grid-template-columns: 1fr;
        }
    }

    /* === NEW ENRICHMENT STYLES === */

    /* Vocabulary Interactive */
    .vocab-term {
        border-bottom: 2px dashed rgba(131, 205, 41, 0.4);
        cursor: help;
        transition: all 0.2s;
        position: relative;
    }

    .vocab-term:hover {
        border-bottom-color: var(--primary-bright);
        background: rgba(131, 205, 41, 0.1);
        color: var(--primary-bright);
    }

    /* Analogy Box */
    .analogy-box {
        background: var(--bg2);
        border-left: 4px solid var(--num);
        padding: 20px;
        border-radius: 0 8px 8px 0;
        margin: 25px 0;
        position: relative;
    }

    .analogy-box h4 {
        color: var(--num);
        margin-bottom: 10px;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Command Table */
    .cmd-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        font-size: 0.9rem;
        background: var(--bg2);
        border-radius: 8px;
        overflow: hidden;
    }

    .cmd-table th {
        background: rgba(0, 0, 0, 0.2);
        text-align: left;
        padding: 12px 16px;
        color: var(--primary-bright);
        border-bottom: 2px solid var(--border);
    }

    .cmd-table td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        color: var(--muted);
    }

    .cmd-table tr:last-child td {
        border-bottom: none;
    }

    .cmd-table code {
        background: rgba(0, 0, 0, 0.3);
        padding: 4px 8px;
        border-radius: 4px;
        color: var(--str);
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.85rem;
    }

    /* Network Flow / Diagrams */
    .net-flow {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 20px 0;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .net-node {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 15px;
        min-width: 140px;
        text-align: center;
        position: relative;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .net-arrow {
        font-size: 1.5rem;
        color: var(--muted);
        font-weight: bold;
    }

    .net-icon {
        font-size: 2rem;
        margin-bottom: 8px;
        display: block;
    }

    .net-label {
        font-weight: 600;
        color: var(--text);
        font-size: 0.9rem;
    }

    .net-sub {
        font-size: 0.75rem;
        color: var(--muted);
        margin-top: 4px;
    }

    /* Attack Card */
    .attack-card {
        border: 1px solid #ff5f56;
        background: rgba(255, 95, 86, 0.05);
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
    }

    .attack-title {
        color: #ff5f56;
        font-weight: 700;
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    .remediation-box {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed rgba(255, 95, 86, 0.3);
        font-size: 0.9rem;
        color: #a0a0a0;
    }

    .remediation-box strong {
        color: var(--primary-bright);
    }