:root {
    --primary-red: #E8192C;
    --primary-red-dim: rgba(232, 25, 44, 0.15);
    --bg-dark: #070708;
    --bg-panel: rgba(245, 245, 247, 0.03);
    --border-light: rgba(245, 245, 247, 0.08);
    --text-white: #F5F5F7;
    --text-dim: rgba(245, 245, 247, 0.6);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    overflow: hidden; /* Prevent body scroll, handle scroll in content area */
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

.text-gradient {
    background: linear-gradient(90deg, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(245, 245, 247, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}

/* Sidebar Navigation */
.nav-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: rgba(245, 245, 247, 0.05);
}
.nav-item.active {
    background: var(--primary-red-dim);
    border-left-color: var(--primary-red);
    color: var(--text-white);
}

/* Content Area - Scroll-telling */
.content-fade-in {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* Interactive Glossary Tooltip */
.glossary-term {
    border-bottom: 1px dashed var(--primary-red);
    cursor: help;
    position: relative;
    color: var(--primary-red);
    font-weight: 600;
}

/* Prompt Playground */
.prompt-playground {
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.prompt-playground textarea {
    width: 100%;
    background: transparent;
    color: #a6e22e; /* Hacker green */
    border: none;
    padding: 16px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
}
.prompt-playground textarea:focus {
    outline: none;
}

.score-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary-red);
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 20px;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.score-badge.show {
    transform: scale(1);
}

/* Buttons */
.btn-primary {
    background: var(--primary-red);
    color: white;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: #c41525;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-red-dim);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Markdown Content Styling within #lesson-content */
.markdown-body h2 {
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}
.markdown-body h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.markdown-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-dim);
}
.markdown-body ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dim);
}
.markdown-body li {
    margin-bottom: 0.5rem;
}
.markdown-body blockquote {
    border-left: 4px solid var(--primary-red);
    padding: 1rem;
    background: rgba(232, 25, 44, 0.05);
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.markdown-body img { max-width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin-bottom: 2rem; border: 1px solid var(--border-light); }
