/* ═══════════════════════════════════════════════════════════════════
   NETLEARN - Plateforme de Formation IT Gamifiée
   Design: Modern Glassmorphism / Premium Dark
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;

    /* Backgrounds - Deep Navy */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-solid: #1e293b;
    --bg-card-hover: rgba(51, 65, 85, 0.8);
    --bg-terminal: #0c1222;
    --bg-glass: rgba(255, 255, 255, 0.05);

    /* Texte */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Glows - Softer */
    --glow-primary: 0 0 30px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.2);
    --glow-accent: 0 0 30px rgba(6, 182, 212, 0.4), 0 0 60px rgba(6, 182, 212, 0.2);
    --glow-success: 0 0 30px rgba(16, 185, 129, 0.4);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius - More Rounded */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    /* Legacy compatibility */
    --neon-cyan: var(--accent);
    --neon-magenta: var(--purple);
    --neon-green: var(--success);
    --neon-orange: var(--warning);
    --neon-yellow: #fbbf24;
    --gradient-cyber: var(--gradient-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fond avec blob gradient animé */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: blobMove 20s ease-in-out infinite;
}

@keyframes blobMove {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(2%, 2%) rotate(5deg);
    }

    50% {
        transform: translate(-1%, 3%) rotate(-3deg);
    }

    75% {
        transform: translate(3%, -2%) rotate(2deg);
    }
}

/* Subtle noise texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 100;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gradient-cyber);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-cyber);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    -webkit-text-fill-color: var(--bg-dark);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::before {
    content: '>';
    margin-right: var(--space-xs);
    color: var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    opacity: 1;
}

.user-stats {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.stat-badge .icon {
    font-size: 1rem;
}

.stat-badge.xp {
    border-color: rgba(57, 255, 20, 0.3);
}

.stat-badge.xp .value {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.stat-badge.level {
    border-color: rgba(255, 0, 255, 0.3);
}

.stat-badge.level .value {
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════════════ */

.main-container {
    padding-top: 90px;
    padding-bottom: var(--space-2xl);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* ═══════════════════════════════════════════════════════════════════
   HERO SECTION (Dashboard)
   ═══════════════════════════════════════════════════════════════════ */

.hero {
    text-align: center;
    padding: var(--space-2xl) 0;
    position: relative;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glitch 5s infinite;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        text-shadow: none;
    }

    92% {
        text-shadow: -2px 0 var(--neon-magenta), 2px 0 var(--neon-cyan);
    }

    94% {
        text-shadow: 2px 0 var(--neon-magenta), -2px 0 var(--neon-cyan);
    }

    96% {
        text-shadow: -1px 0 var(--neon-magenta), 1px 0 var(--neon-cyan);
    }
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.hero-subtitle .highlight {
    color: var(--neon-cyan);
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BAR (XP)
   ═══════════════════════════════════════════════════════════════════ */

.xp-progress-container {
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.xp-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
}

.xp-amount {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.xp-amount span {
    color: var(--neon-green);
}

.xp-bar {
    height: 12px;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 245, 255, 0.2);
    position: relative;
}

.xp-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 20px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: var(--glow-green);
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-cyber);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 245, 255, 0.1);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.stat-card .value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.completed .value {
    color: var(--neon-green);
}

.stat-card.progress .value {
    color: var(--neon-cyan);
}

.stat-card.quizzes .value {
    color: var(--neon-magenta);
}

.stat-card.streak .value {
    color: var(--neon-orange);
}

/* ═══════════════════════════════════════════════════════════════════
   MODULES GRID
   ═══════════════════════════════════════════════════════════════════ */

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-title::before {
    content: '[';
    color: var(--neon-cyan);
}

.section-title::after {
    content: ']';
    color: var(--neon-cyan);
}

.section-title .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-cyan), transparent);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.module-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-cyber);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.module-card:hover {
    transform: translateX(10px);
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.1);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card.locked {
    opacity: 0.5;
    pointer-events: none;
}

.module-card.locked::after {
    content: '🔒 VERROUILLÉ';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(10, 10, 15, 0.9);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.module-header {
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.module-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-terminal);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
}

.module-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    margin-bottom: var(--space-xs);
}

.module-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.module-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.module-footer {
    padding: var(--space-md) var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.module-progress-bar {
    width: 100px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
}

.module-progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.module-xp {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--neon-green);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════════════════
   COURSE PAGE
   ═══════════════════════════════════════════════════════════════════ */

.course-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    min-height: calc(100vh - 90px);
}

.course-sidebar {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.course-sidebar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    margin-bottom: var(--space-lg);
    color: var(--neon-cyan);
}

.lesson-list {
    list-style: none;
}

.lesson-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border: 1px solid transparent;
}

.lesson-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 245, 255, 0.2);
}

.lesson-item.active {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--neon-cyan);
}

.lesson-item.completed {
    border-color: rgba(57, 255, 20, 0.3);
}

.lesson-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.lesson-item.completed .lesson-status {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: var(--bg-dark);
}

.lesson-item.active .lesson-status {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.lesson-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lesson-item.active .lesson-title,
.lesson-item.completed .lesson-title {
    color: var(--text-primary);
}

.course-content {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.course-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.course-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Terminal Style Content */
.terminal-block {
    background: var(--bg-terminal);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    overflow: hidden;
}

.terminal-header {
    background: rgba(0, 245, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) {
    background: #ff5f56;
}

.terminal-dots span:nth-child(2) {
    background: #ffbd2e;
}

.terminal-dots span:nth-child(3) {
    background: #27ca3f;
}

.terminal-body {
    padding: var(--space-md);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    overflow-x: auto;
}

.terminal-body .prompt {
    color: var(--neon-green);
}

.terminal-body .command {
    color: var(--neon-cyan);
}

.terminal-body .output {
    color: var(--text-secondary);
}

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

/* Info Boxes */
.info-box {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    border-left: 4px solid;
}

.info-box.tip {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--neon-green);
}

.info-box.warning {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--neon-orange);
}

.info-box.info {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--neon-cyan);
}

.info-box-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.info-box.tip .info-box-title {
    color: var(--neon-green);
}

.info-box.warning .info-box-title {
    color: var(--neon-orange);
}

.info-box.info .info-box-title {
    color: var(--neon-cyan);
}

/* Course Navigation */
.course-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 245, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════
   QUIZ PAGE
   ═══════════════════════════════════════════════════════════════════ */

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.quiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.quiz-progress-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-cyan);
}

.quiz-progress-bar {
    width: 300px;
    height: 8px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--gradient-cyber);
    transition: width 0.5s ease;
}

.quiz-timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--neon-orange);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.quiz-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-magenta);
    margin-bottom: var(--space-md);
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.answers-grid {
    display: grid;
    gap: var(--space-md);
}

.answer-option {
    background: var(--bg-terminal);
    border: 2px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.answer-option:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.05);
}

.answer-option.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.answer-option.correct {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.1);
    box-shadow: var(--glow-green);
}

.answer-option.incorrect {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.answer-letter {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    flex-shrink: 0;
}

.answer-option.selected .answer-letter {
    background: var(--neon-cyan);
    color: var(--bg-dark);
}

.answer-option.correct .answer-letter {
    background: var(--neon-green);
    color: var(--bg-dark);
}

.answer-option.incorrect .answer-letter {
    background: #ff4444;
    color: white;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: var(--space-2xl);
}

.results-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
}

.results-score.excellent {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.results-score.good {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.results-score.average {
    color: var(--neon-orange);
}

.results-score.poor {
    color: #ff4444;
}

.results-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.results-xp {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-green);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   LEADERBOARD PAGE
   ═══════════════════════════════════════════════════════════════════ */

.leaderboard-container {
    max-width: 900px;
    margin: 0 auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl) 0;
}

.podium-place {
    text-align: center;
    transition: transform 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-10px);
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--space-md);
}

.podium-place.first .podium-avatar {
    width: 100px;
    height: 100px;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.podium-place.second .podium-avatar {
    border-color: #c0c0c0;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.podium-place.third .podium-avatar {
    border-color: #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

.podium-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.podium-xp {
    font-size: 0.9rem;
    color: var(--neon-green);
}

.podium-stand {
    width: 120px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
}

.podium-place.first .podium-stand {
    height: 120px;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.2), var(--bg-card));
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.podium-place.second .podium-stand {
    height: 90px;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.2), var(--bg-card));
    border-color: rgba(192, 192, 192, 0.3);
    color: #c0c0c0;
}

.podium-place.third .podium-stand {
    height: 60px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.2), var(--bg-card));
    border-color: rgba(205, 127, 50, 0.3);
    color: #cd7f32;
}

.leaderboard-table {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 1fr 120px 100px;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(0, 245, 255, 0.05);
    transition: all 0.3s ease;
}

.leaderboard-row:hover {
    background: var(--bg-card-hover);
}

.leaderboard-row.current-user {
    background: rgba(0, 245, 255, 0.1);
    border-left: 3px solid var(--neon-cyan);
}

.leaderboard-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-terminal);
    border: 2px solid rgba(0, 245, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.leaderboard-name {
    font-weight: 500;
}

.leaderboard-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    color: var(--neon-magenta);
}

.leaderboard-xp {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-green);
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-cyber);
    color: var(--bg-dark);
}

.btn-primary:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--bg-dark);
}

.btn-success:hover {
    box-shadow: var(--glow-green);
    transform: translateY(-2px);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES / ACHIEVEMENTS
   ═══════════════════════════════════════════════════════════════════ */

.badges-section {
    margin-top: var(--space-2xl);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
}

.badge-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.badge-card:hover {
    transform: scale(1.05);
    border-color: rgba(0, 245, 255, 0.3);
}

.badge-card.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.badge-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    margin-bottom: var(--space-xs);
}

.badge-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-terminal);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

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

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 var(--space-md);
    }

    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-place.first {
        order: -1;
    }

    .leaderboard-row {
        grid-template-columns: 50px 1fr 80px;
    }

    .leaderboard-level {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Notification Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--neon-green);
    border-radius: var(--radius-md);
    box-shadow: var(--glow-green);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideInRight 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    z-index: 1000;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    font-size: 0.9rem;
}

.toast-xp {
    color: var(--neon-green);
    font-family: 'Orbitron', sans-serif;
}

/* Level Up Animation */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.level-up-overlay.active {
    display: flex;
}

.level-up-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.level-up-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glitch 0.5s infinite;
}

.level-up-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 6rem;
    color: var(--neon-magenta);
    text-shadow: var(--glow-magenta);
    margin: var(--space-lg) 0;
}

.level-up-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.level-up-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

/* Badge Unlock Overlay */
.badge-unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.badge-unlock-overlay.active {
    display: flex;
}

.badge-unlock-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
}

.badge-unlock-icon {
    font-size: 5rem;
    margin-bottom: var(--space-md);
}

.badge-unlock-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
}

.badge-unlock-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-green);
    margin-bottom: var(--space-sm);
}

.badge-unlock-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* Username Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.5s ease;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.modal-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-terminal);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.modal-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

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

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast-container .toast {
    position: relative;
    bottom: auto;
    right: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════════════
   TERMINAL SIMULATOR
   ═══════════════════════════════════════════════════════════════════ */

.terminal-sim {
    background: var(--bg-terminal);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    margin: var(--space-xl) 0;
}

.terminal-sim-header {
    background: var(--bg-card);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.terminal-sim-header .terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-sim-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-sim-header .dot.red {
    background: #ff5f56;
}

.terminal-sim-header .dot.yellow {
    background: #ffbd2e;
}

.terminal-sim-header .dot.green {
    background: #27ca3f;
}

.terminal-sim-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.exercise-counter {
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    font-size: 0.9rem;
}

.terminal-sim-body {
    height: 350px;
    overflow-y: auto;
    padding: var(--space-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-sim-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-sim-body::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.terminal-sim-body::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 2px;
}

.terminal-line.system {
    color: var(--text-secondary);
    font-style: italic;
}

.terminal-line.command .prompt {
    color: var(--neon-green);
}

.terminal-line.command .command {
    color: var(--neon-cyan);
}

.terminal-line .error {
    color: #ff4444;
}

.terminal-line .success {
    color: var(--neon-green);
}

.terminal-line .highlight {
    color: var(--neon-yellow);
    background: rgba(240, 255, 0, 0.2);
    padding: 0 2px;
}

.terminal-line .dir {
    color: var(--neon-cyan);
    font-weight: 600;
}

.terminal-line .hint {
    color: var(--neon-orange);
}

.terminal-line .exercise-title {
    color: var(--neon-magenta);
    font-weight: 600;
    font-size: 1rem;
}

.terminal-line .exercise-desc {
    color: var(--text-primary);
    display: block;
    margin-top: 4px;
}

.terminal-sim-input-line {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 245, 255, 0.05);
    border-top: 1px solid rgba(0, 245, 255, 0.1);
}

.terminal-prompt {
    color: var(--neon-green);
    font-weight: 600;
    margin-right: var(--space-sm);
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: var(--neon-green);
}

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

/* Practice Section */
.practice-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(0, 245, 255, 0.1);
}

.practice-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.practice-icon {
    font-size: 2rem;
}

.practice-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.practice-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Exercise Progress */
.exercise-progress {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.exercise-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.exercise-dot.completed {
    background: var(--neon-green);
    box-shadow: var(--glow-green);
}

.exercise-dot.current {
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    animation: pulse 1s ease infinite;
}

/* Terminal Practice Results */
.practice-results {
    background: var(--bg-card);
    border: 1px solid rgba(57, 255, 20, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    margin-top: var(--space-lg);
}

.practice-results-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.practice-results-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-green);
    margin-bottom: var(--space-sm);
}

.practice-results-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.practice-results-xp {
    color: var(--neon-green);
    font-family: 'Orbitron', sans-serif;
}