/* ===== CSS Variables ===== */
:root {
    --primary-color: #3776ab;
    --secondary-color: #ffd43b;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --gradient-primary: linear-gradient(135deg, #3776ab 0%, #2c5f8a 100%);
    --gradient-secondary: linear-gradient(135deg, #ffd43b 0%, #f0c419 100%);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 10px;
    --transition: all 0.3s ease;
    
    /* Light theme specific */
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --card-border: #eee;
    --nav-bg: #1a1a2e;
    --code-bg: #1e1e1e;
}

/* Loading Skeleton */
.loading-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color, #f8f9fa);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
}

.loading-skeleton.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skeleton-header {
    height: 200px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 30px;
}

.skeleton-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 15px;
}

.skeleton-line.long { width: 100%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.short { width: 50%; }

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Confetti Effect */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Smooth Page Transitions */
.page-transition {
    animation: page-fade-in 0.3s ease forwards;
}

.page-fade-out {
    animation: page-fade-out 0.2s ease forwards;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Snake Animation */
.hero-cta {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.snake-animation {
    position: relative;
    width: 120px;
    height: 40px;
    overflow: visible;
}

.snake {
    display: flex;
    align-items: center;
    animation: snake-slither 3s ease-in-out infinite;
}

.snake-head {
    font-size: 1.8rem;
    animation: snake-head-bob 0.5s ease-in-out infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.snake-body {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border-radius: 50%;
    margin-left: -4px;
    animation: snake-body-wave 0.6s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.snake-body:nth-child(2) { animation-delay: 0.1s; }
.snake-body:nth-child(3) { animation-delay: 0.2s; }
.snake-body:nth-child(4) { animation-delay: 0.3s; }

.snake-tail {
    width: 0;
    height: 0;
    border-left: 10px solid #2E7D32;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-left: -4px;
    animation: snake-tail-wag 0.4s ease-in-out infinite alternate;
}

@keyframes snake-slither {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(10px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(-10px); }
}

@keyframes snake-head-bob {
    0% { transform: rotate(-5deg) translateY(-2px); }
    100% { transform: rotate(5deg) translateY(2px); }
}

@keyframes snake-body-wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes snake-tail-wag {
    0% { transform: rotate(-15deg); }
    100% { transform: rotate(15deg); }
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: var(--dark-color);
    padding: 10px 0;
    margin-top: 0px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #aaa;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
}

.breadcrumb-separator {
    color: #666;
    font-size: 0.7rem;
}

.breadcrumb-current {
    color: #fff;
    font-weight: 500;
}

/* Adjust unit-header when breadcrumb is present */
.breadcrumb + .unit-header {
    padding-top: 40px;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2c5f8a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

/* Fade-in animation for content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topic-section,
.unit-card,
.feature-card,
.comparison-card,
.error-card,
.theory-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--dark-color);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: #ccc;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-menu a.active {
    background: var(--primary-color);
    color: #fff;
}

/* Navigation Divider */
.nav-menu .nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 8px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* ===== Hero Section ===== */
.hero {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 50px;
    gap: 40px;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 280px;
    text-align: center;
    color: #fff;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-content h1 i {
    color: var(--secondary-color);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-animation {
    flex: 1;
    min-width: 280px;
    display: flex;
    justify-content: center;
}

.hero .code-block {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    max-width: 480px;
    width: 100%;
    border: 1px solid #333;
}

.hero .code-block pre {
    margin: 0;
    overflow-x: auto;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.btn-primary:hover {
    background: #e6c235;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--primary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #2c5f8a;
    transform: translateY(-2px);
}

/* ===== Section Styles ===== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ===== Units Section ===== */
.units-section {
    padding: 80px 0;
    background: #fff;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.unit-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid #eee;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.unit-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.unit-icon i {
    font-size: 2rem;
    color: #fff;
}

.unit-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.unit-card h4 {
    color: var(--dark-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.unit-card ul {
    text-align: left;
    margin-bottom: 20px;
    padding-left: 20px;
}

.unit-card ul li {
    color: var(--text-light);
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.unit-card ul li::before {
    content: '✓';
    color: var(--success-color);
    position: absolute;
    left: 0;
}

/* ===== Features Section ===== */
.features-section {
    padding: 80px 0;
    background: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    background: #fff;
    padding: 30px 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
}

.feature-card:hover {
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--dark-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== Unit Page Styles ===== */
.unit-header {
    background: var(--gradient-primary);
    padding: 40px 20px 30px;
    text-align: center;
    color: #fff;
}

.unit-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.unit-header h1 i {
    margin-right: 10px;
}

.unit-header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.unit-content {
    padding: 60px 0;
}

.topic-section {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.topic-section:hover {
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
}

.topic-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-section h2 i {
    color: var(--secondary-color);
}

.topic-section h3 {
    color: var(--dark-color);
    font-size: 1.4rem;
    margin: 25px 0 15px;
}

.topic-section p {
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.8;
}

.topic-section ul,
.topic-section ol {
    margin: 15px 0 15px 30px;
    color: var(--text-color);
}

.topic-section li {
    margin-bottom: 10px;
    line-height: 1.7;
}

/* ===== Code Blocks ===== */
.code-example {
    background: #1e1e1e;
    border-radius: 6px;
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid #333;
}

.code-header {
    background: #2d2d2d;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.code-header span {
    color: #aaa;
    font-size: 0.85rem;
}

.code-header span::before {
    content: '📄 ';
}

.code-header .copy-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.code-header .copy-btn:hover {
    background: #4a8bc2;
}

.code-example pre {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
}

.code-example code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===== Info Boxes ===== */
.info-box {
    padding: 18px 22px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid;
}

.info-box.note {
    background: #f0f7ff;
    border-color: var(--primary-color);
}

.info-box.tip {
    background: #f0f9f1;
    border-color: var(--success-color);
}

.info-box.warning {
    background: #fff8f0;
    border-color: var(--warning-color);
}

.info-box h4 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box.note h4 {
    color: var(--primary-color);
}

.info-box.tip h4 {
    color: var(--success-color);
}

.info-box.warning h4 {
    color: #e65100;
}

/* ===== Output Visual Styles ===== */
.output-visual {
    margin: 15px 0;
    text-align: center;
}

.output-visual svg {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.output-visual p {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.info-box .output-visual {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

/* ===== Table Styles ===== */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* ===== Navigation Buttons ===== */
.unit-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--dark-color);
    transform: translateX(5px);
}

.nav-btn.prev:hover {
    transform: translateX(-5px);
}

/* ===== Footer ===== */
.footer {
    background: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section p {
    color: #aaa;
    line-height: 1.7;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #aaa;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #888;
}

.footer-bottom i {
    color: #dc3545;
}

/* ===== MCQ Page Styles ===== */
.mcq-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    border: 1px solid var(--card-border, #eee);
    flex-wrap: wrap;
    gap: 15px;
}

.mcq-filter label {
    margin-right: 10px;
    font-weight: 500;
}

.mcq-filter select {
    padding: 8px 16px;
    border: 1px solid var(--card-border, #ddd);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--card-bg, #fff);
    color: var(--text-color);
}

.mcq-stats {
    color: var(--text-light);
    font-size: 0.9rem;
}

.mcq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mcq-item {
    background: var(--card-bg, #fff);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--card-border, #eee);
    position: relative;
}

.mcq-item.correct {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.05);
}

.mcq-item.incorrect {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.05);
}

.mcq-unit-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.mcq-question {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding-right: 80px;
    color: var(--text-color);
}

.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mcq-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--card-border, #ddd);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.mcq-option:hover {
    background: rgba(55, 118, 171, 0.05);
    border-color: var(--primary-color);
}

.mcq-option input {
    display: none;
}

.option-letter {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.mcq-option.selected {
    background: rgba(55, 118, 171, 0.1);
    border-color: var(--primary-color);
}

.mcq-option.correct-answer {
    background: rgba(40, 167, 69, 0.1);
    border-color: var(--success-color);
}

.mcq-option.correct-answer .option-letter {
    background: var(--success-color);
}

.mcq-feedback {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcq-feedback.correct {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.mcq-feedback.incorrect {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.mcq-score-panel {
    margin-top: 30px;
    padding: 25px;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    border: 1px solid var(--card-border, #eee);
    text-align: center;
}

.mcq-score-panel h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.score-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* ===== Sidebar Navigation ===== */
.page-layout {
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
    background: #fff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.sidebar-nav a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    border-radius: 5px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-color);
    color: #fff;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .container {
        padding: 0 20px;
    }

    .units-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--dark-color);
        flex-direction: column;
        padding: 15px;
        gap: 3px;
        max-height: 70vh;
        overflow-y: auto;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }

    .nav-menu a {
        padding: 12px 15px;
        width: 100%;
        text-align: left;
        border-radius: 4px;
    }

    .nav-menu a:hover {
        background: rgba(255,255,255,0.1);
    }

    .nav-toggle {
        display: block;
    }

    .hero {
        padding: 90px 20px 40px;
        min-height: auto;
    }

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

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .topic-section {
        padding: 20px;
    }

    .unit-header {
        padding: 80px 15px 35px;
    }

    .unit-header h1 {
        font-size: 1.6rem;
    }

    .unit-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .nav-btn {
        justify-content: center;
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .table-container {
        margin: 15px -10px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 8px;
    }

    .quiz-container {
        padding: 20px 15px;
    }

    .quiz-question {
        font-size: 1rem;
    }

    .quiz-options label {
        padding: 12px 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-section h3 {
        justify-content: center;
    }

    .code-example pre {
        padding: 12px;
    }

    .code-example code {
        font-size: 0.8rem;
    }

    .info-box {
        padding: 15px;
    }

    /* Practice and Theory pages */
    .practice-question,
    .theory-card {
        padding: 20px;
    }

    /* Comparison tables */
    .comparison-table {
        display: block;
        overflow-x: auto;
    }

    /* Error page */
    .error-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 12px 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero-content h1 {
        font-size: 1.6rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .unit-card {
        padding: 20px;
    }

    .unit-header {
        padding: 70px 15px 30px;
    }

    .unit-header h1 {
        font-size: 1.4rem;
    }

    .unit-header p {
        font-size: 0.9rem;
    }

    .topic-section h2 {
        font-size: 1.3rem;
    }

    .topic-section h3 {
        font-size: 1.1rem;
    }

    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .start-quiz-btn,
    .retry-btn,
    .review-btn {
        width: 100%;
        text-align: center;
    }

    .quiz-result-buttons {
        flex-direction: column;
    }
}

/* ===== Scroll to Top Button ===== */
.scroll-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #2c5f8a;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== Syntax Highlighting Custom ===== */
code[class*="language-"],
pre[class*="language-"] {
    text-shadow: none;
}

/* ===== Quiz Section Styles ===== */
.quiz-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    margin-top: 40px;
}

.quiz-section .section-title {
    color: #fff;
}

.quiz-section .section-title::after {
    background: #ffd43b;
}

.quiz-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.quiz-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.quiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

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

.progress-text {
    font-weight: 600;
    color: var(--text-light);
}

.question-card {
    margin-bottom: 25px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.question-card.answered-correct {
    border-left-color: var(--success-color);
    background: #e8f5e9;
}

.question-card.answered-wrong {
    border-left-color: var(--danger-color);
    background: #ffebee;
}

.question-number {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 20px;
    line-height: 1.6;
}

.question-text code {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: #d63384;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.option-item.selected {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.option-item.correct {
    border-color: var(--success-color);
    background: #e8f5e9;
}

.option-item.incorrect {
    border-color: var(--danger-color);
    background: #ffebee;
}

.option-item.disabled {
    pointer-events: none;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background: var(--primary-color);
    color: #fff;
}

.option-item.correct .option-letter {
    background: var(--success-color);
    color: #fff;
}

.option-item.incorrect .option-letter {
    background: var(--danger-color);
    color: #fff;
}

.option-text {
    flex: 1;
}

.option-icon {
    margin-left: 10px;
    font-size: 1.2rem;
}

.explanation {
    margin-top: 15px;
    padding: 15px;
    background: #fff3e0;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    display: none;
}

.explanation.show {
    display: block;
}

.explanation h5 {
    color: #e65100;
    margin-bottom: 8px;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.quiz-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-btn.prev-btn {
    background: #e0e0e0;
    color: var(--dark-color);
}

.quiz-btn.prev-btn:hover:not(:disabled) {
    background: #bdbdbd;
}

.quiz-btn.next-btn {
    background: var(--primary-color);
    color: #fff;
}

.quiz-btn.next-btn:hover:not(:disabled) {
    background: #2c5f8a;
}

.quiz-btn.submit-btn {
    background: var(--success-color);
    color: #fff;
}

.quiz-btn.submit-btn:hover {
    background: #218838;
}

.quiz-results {
    text-align: center;
    padding: 40px;
}

.results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.results-icon.excellent {
    color: var(--success-color);
}

.results-icon.good {
    color: var(--primary-color);
}

.results-icon.average {
    color: var(--warning-color);
}

.results-icon.poor {
    color: var(--danger-color);
}

.results-score {
    font-size: 3rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.results-message {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.results-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

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

.result-stat .number {
    font-size: 2rem;
    font-weight: bold;
}

.result-stat .label {
    color: var(--text-light);
}

.result-stat.correct .number {
    color: var(--success-color);
}

.result-stat.incorrect .number {
    color: var(--danger-color);
}

.quiz-topic-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.topic-btn {
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.topic-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.topic-btn.active {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.topic-btn h4 {
    color: var(--dark-color);
    margin-bottom: 5px;
}

.topic-btn p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.quiz-start-screen {
    text-align: center;
    padding: 20px;
}

.quiz-start-screen h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.quiz-start-screen p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.start-quiz-btn {
    padding: 12px 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.start-quiz-btn:hover {
    background: #2c5f8a;
}

.retry-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    margin: 5px;
}

.retry-btn:hover {
    background: #2c5f8a;
}

.review-btn {
    padding: 10px 24px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    margin: 5px;
}

.review-btn:hover {
    background: #5a6268;
}

/* ===== Cheat Sheet Styles ===== */
.cheatsheet-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 80px 20px 25px;
    text-align: center;
    color: #fff;
}

.cheatsheet-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.cheatsheet-header h1 i {
    margin-right: 8px;
    color: var(--secondary-color);
}

.cheatsheet-header p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.cheatsheet-search {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.cheatsheet-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cheatsheet-search input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cheatsheet-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #1a1a2e;
    font-size: 0.9rem;
}

.cheatsheet-section {
    padding: 15px 0 40px;
    background: #0d1117;
}

.cheatsheet-section .container {
    max-width: 1600px;
}

/* Quick Navigation */
.cheatsheet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #161b22;
    border-radius: 8px;
}

.cheatsheet-nav a {
    padding: 5px 12px;
    background: #21262d;
    color: #c9d1d9;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cheatsheet-nav a:hover {
    background: var(--primary-color);
    color: #fff;
}

.cheatsheet-nav a i {
    font-size: 0.75rem;
}

/* Cheat Sheet Grid - 3 columns */
.cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: start;
}

/* Cheat Cards - Dark theme compact */
.cheat-card {
    background: #161b22;
    border-radius: 8px;
    overflow: hidden;
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cheat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cheat-card.hidden {
    display: none;
}

/* Color-coded borders by concept type */
.cheat-card.cheat-blue { border-left-color: #58a6ff; }
.cheat-card.cheat-purple { border-left-color: #bc8cff; }
.cheat-card.cheat-green { border-left-color: #3fb950; }
.cheat-card.cheat-teal { border-left-color: #39c5cf; }
.cheat-card.cheat-orange { border-left-color: #f0883e; }
.cheat-card.cheat-red { border-left-color: #f85149; }
.cheat-card.cheat-cyan { border-left-color: #79c0ff; }
.cheat-card.cheat-grey { border-left-color: #8b949e; }
.cheat-card.cheat-pink { border-left-color: #ff7b72; }
.cheat-card.cheat-yellow { border-left-color: #d29922; }

.cheat-card-header {
    padding: 8px 12px;
    background: #21262d;
}

.cheat-card-header h3 {
    font-size: 0.9rem;
    color: #f0f6fc;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cheat-card.cheat-blue .cheat-card-header h3 i { color: #58a6ff; }
.cheat-card.cheat-purple .cheat-card-header h3 i { color: #bc8cff; }
.cheat-card.cheat-green .cheat-card-header h3 i { color: #3fb950; }
.cheat-card.cheat-teal .cheat-card-header h3 i { color: #39c5cf; }
.cheat-card.cheat-orange .cheat-card-header h3 i { color: #f0883e; }
.cheat-card.cheat-red .cheat-card-header h3 i { color: #f85149; }
.cheat-card.cheat-cyan .cheat-card-header h3 i { color: #79c0ff; }
.cheat-card.cheat-grey .cheat-card-header h3 i { color: #8b949e; }
.cheat-card.cheat-pink .cheat-card-header h3 i { color: #ff7b72; }
.cheat-card.cheat-yellow .cheat-card-header h3 i { color: #d29922; }

.cheat-card-body {
    padding: 10px 12px 12px;
}

.cheat-card-body h4 {
    font-size: 0.7rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid #30363d;
}

.cheat-card-body h4:first-child {
    margin-top: 0;
}

/* Syntax Tables - Compact dark */
.syntax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.syntax-table td {
    padding: 3px 5px;
    border-bottom: 1px solid #30363d;
    vertical-align: top;
    color: #c9d1d9;
}

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

.syntax-table td:first-child {
    font-weight: 500;
    color: #f0f6fc;
    width: 50%;
}

.syntax-table td:last-child {
    color: #8b949e;
}

.syntax-table.compact td {
    padding: 2px 4px;
}

.syntax-table code {
    background: #30363d;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.72rem;
    color: #ff7b72;
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* Cheat Code Blocks - Super compact */
.cheat-code {
    background: #0d1117;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
    border: 1px solid #30363d;
}

.cheat-code pre {
    margin: 0;
    padding: 6px 8px;
    overflow-x: auto;
    font-size: 0.72rem;
    line-height: 1.4;
}

.cheat-code pre code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    background: transparent;
    color: #c9d1d9;
}

/* Inline code in cheat cards */
.cheat-card-body code {
    background: #30363d;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.72rem;
    color: #ff7b72;
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* Two column layout within card */
.cheat-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
    .cheatsheet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cheatsheet-header {
        padding: 75px 15px 20px;
    }

    .cheatsheet-header h1 {
        font-size: 1.5rem;
    }

    .cheatsheet-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cheatsheet-nav {
        gap: 5px;
        padding: 8px;
    }

    .cheatsheet-nav a {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .cheat-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cheat-card-body {
        padding: 8px 10px 10px;
    }

    .syntax-table {
        font-size: 0.7rem;
    }

    .cheat-code pre {
        font-size: 0.68rem;
        padding: 5px 6px;
    }
}

/* Print Styles for Cheat Sheet */
@media print {
    .cheatsheet-header {
        background: #1a1a2e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 20px;
    }

    .cheatsheet-search,
    .cheatsheet-nav,
    .navbar,
    .footer,
    .scroll-top {
        display: none !important;
    }

    .cheatsheet-section {
        background: #fff !important;
        padding: 10px 0;
    }

    .cheatsheet-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .cheat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff !important;
    }

    .cheat-card-header {
        background: #f5f5f5 !important;
    }

    .cheat-card-header h3 {
        color: #333 !important;
    }

    .cheat-card-body {
        color: #333;
    }

    .cheat-code {
        background: #f5f5f5 !important;
        border: 1px solid #ddd;
    }

    .cheat-code pre code {
        color: #333 !important;
    }

    .syntax-table td {
        color: #333 !important;
        border-color: #ddd !important;
    }
}
