/* ========================================
   CSS VARIABLES - Light & Dark Themes
   Enhanced with Terminal-Inspired Colors
   ======================================== */

:root {
    /* Terminal-Inspired Colors (Light Theme) */
    --bg-primary: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.12);
    --bg-content: rgba(255, 255, 255, 0.98);
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    --border-color: rgba(255, 255, 255, 0.25);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
    
    /* Terminal Green & Cyan Accents */
    --accent-primary: #00ff41;
    --accent-secondary: #00d9ff;
    --accent-success: #00ff41;
    --accent-warning: #ffb800;
    --accent-error: #ff4757;
    
    --terminal-bg: #0d1117;
    --terminal-text: #00ff41;
    --terminal-cursor: #00ff41;
    
    --backdrop-blur: 12px;
    --sidebar-bg: rgba(10, 14, 39, 0.85);
    --code-bg: #0d1117;
    --code-text: #c9d1d9;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'Courier New', Consolas, Monaco, monospace;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
    /* Dark Theme with Enhanced Terminal Aesthetics */
    --bg-primary: linear-gradient(135deg, #000000 0%, #0a0e27 100%);
    --bg-secondary: rgba(0, 0, 0, 0.4);
    --bg-glass: rgba(0, 0, 0, 0.5);
    --bg-content: rgba(13, 17, 23, 0.95);
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --border-color: rgba(0, 255, 65, 0.15);
    --shadow-light: rgba(0, 255, 65, 0.1);
    --shadow-heavy: rgba(0, 255, 65, 0.2);
    
    --accent-primary: #00ff41;
    --accent-secondary: #00d9ff;
    --sidebar-bg: rgba(0, 0, 0, 0.8);
}

/* ========================================
   GLOBAL STYLES & RESET
   ======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
}

/* ========================================
   ACCESSIBILITY - Screen Reader Only
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   ACCESSIBILITY - Skip Link
   ======================================== */

.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--accent-primary);
    color: #000;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 700;
    z-index: 10000;
    border-radius: 0 0 8px 8px;
    transition: top var(--transition-normal);
    font-size: 1rem;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* ========================================
   ACCESSIBILITY - Focus Indicators
   ======================================== */

*:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 255, 65, 0.2);
}

/* ========================================
   PARTICLE BACKGROUND
   ======================================== */

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

/* ========================================
   GLASSMORPHISM UTILITIES
   ======================================== */

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-light);
}

/* ========================================
   ANIMATIONS & KEYFRAMES
   ======================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   THEME TOGGLE
   ======================================== */

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px var(--shadow-light);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px var(--shadow-heavy);
    border-color: var(--accent-primary);
}

.theme-toggle svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent-primary);
    transition: all var(--transition-normal);
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px var(--shadow-heavy);
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: fadeInScale 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 30px var(--shadow-heavy);
}

.back-to-top svg {
    stroke: #000;
    stroke-width: 3;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 2px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo svg {
    stroke: var(--accent-primary);
    filter: drop-shadow(0 0 10px var(--accent-primary));
}

.logo-text {
    font-size: 1.4rem;
    color: var(--accent-primary);
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform var(--transition-fast);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar-toggle svg {
    stroke: var(--accent-primary);
}

/* Progress Overview */
.progress-overview {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 28px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-light);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-percentage {
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 1.3rem;
    font-family: var(--font-mono);
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent-primary),
        var(--accent-secondary),
        var(--accent-primary)
    );
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width var(--transition-slow);
    width: 0%;
    animation: gradientShift 3s ease infinite;
    box-shadow: 0 0 15px var(--accent-primary);
}

/* Module List */
.module-list {
    list-style: none;
}

.module-item {
    margin-bottom: 10px;
}

.module-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Hover shimmer effect */
.module-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 65, 0.2),
        transparent
    );
    transition: left var(--transition-slow);
}

.module-link:hover::before {
    left: 100%;
}

.module-link:hover {
    background: var(--bg-glass);
    border-color: var(--accent-primary);
    transform: translateX(6px);
    box-shadow: 0 4px 20px var(--shadow-light);
}

.module-item.active .module-link {
    background: var(--bg-glass);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.3);
}

.module-link svg {
    margin-right: 14px;
    stroke: var(--text-muted);
    transition: stroke var(--transition-fast);
}

.module-item.active .module-link svg {
    stroke: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.module-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.module-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: var(--font-mono);
}

.module-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.module-status {
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all var(--transition-normal);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    min-width: 32px;
    min-height: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 2px solid transparent;
}

.module-status:hover {
    background: var(--bg-glass);
    transform: scale(1.2);
    border-color: var(--accent-primary);
}

.module-status.completed {
    color: var(--accent-success);
    font-weight: bold;
}

.module-status.completed .status-icon {
    filter: drop-shadow(0 0 8px var(--accent-success));
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    margin-left: 320px;
    min-height: 100vh;
    padding: 24px;
    transition: margin-left var(--transition-normal);
}

/* ========================================
   TERMINAL BREADCRUMB
   ======================================== */

.terminal-breadcrumb {
    font-family: var(--font-mono);
    background: var(--terminal-bg);
    color: var(--terminal-text);
    padding: 14px 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.3);
    animation: slideInUp 0.6s ease-out;
}

.prompt {
    color: var(--accent-primary);
    font-weight: 700;
}

.path {
    color: var(--accent-secondary);
    font-weight: 600;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--terminal-cursor);
    font-weight: 700;
}

/* Content Header with Search */
.content-header {
    margin-bottom: 32px;
}

.search-bar {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-bar svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--text-muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    border-radius: 14px;
    border: 2px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
}

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

.search-bar input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-content);
    box-shadow: 0 0 0 4px rgba(0, 255, 65, 0.1), 0 8px 30px var(--shadow-heavy);
}

.search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--bg-content);
    border: 2px solid var(--accent-primary);
    border-radius: 14px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 12px 40px var(--shadow-heavy);
    backdrop-filter: blur(20px);
}

.search-results.show {
    display: block;
    animation: fadeInScale 0.3s ease;
}

.search-result-item {
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--bg-glass);
    padding-left: 28px;
}

.search-result-title {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
    font-size: 1rem;
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Content Body */
.content-body {
    background: var(--bg-content);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px;
    border: 2px solid var(--border-color);
    box-shadow: 0 12px 40px var(--shadow-heavy);
    min-height: 500px;
}

/* Stagger animation for content children */
.content-body > * {
    animation: slideInUp 0.6s ease-out backwards;
}

.content-body > *:nth-child(1) { animation-delay: 0.1s; }
.content-body > *:nth-child(2) { animation-delay: 0.2s; }
.content-body > *:nth-child(3) { animation-delay: 0.3s; }
.content-body > *:nth-child(4) { animation-delay: 0.4s; }
.content-body > *:nth-child(5) { animation-delay: 0.5s; }

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Typography in Content */
.content-body h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.content-body h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.content-body h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 16px;
}

.content-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 28px;
    margin-bottom: 14px;
}

.content-body p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.content-body ul,
.content-body ol {
    margin-bottom: 24px;
    padding-left: 32px;
}

.content-body li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: all var(--transition-fast);
}

.content-body a:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px var(--accent-secondary);
}

.content-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 24px;
    margin: 28px 0;
    font-style: italic;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 20px 24px;
    border-radius: 8px;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: var(--bg-glass);
    border-radius: 12px;
    overflow: hidden;
}

.content-body th {
    background: var(--terminal-bg);
    color: var(--accent-primary);
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    font-family: var(--font-mono);
}

.content-body td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.content-body tr:hover {
    background: var(--bg-secondary);
}

/* ========================================
   CODE BLOCKS WITH COPY BUTTON
   ======================================== */

.code-block-wrapper {
    position: relative;
    margin: 28px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 8px 30px rgba(0, 255, 65, 0.2);
}

.code-block-wrapper pre {
    margin: 0 !important;
    border-radius: 0 !important;
}

.copy-code-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 255, 65, 0.2);
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    font-family: var(--font-mono);
    z-index: 10;
}

.copy-code-btn:hover {
    background: rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.4);
}

.copy-code-btn.copied {
    background: var(--accent-success);
    color: #000;
    border-color: var(--accent-success);
}

.copy-code-btn svg {
    width: 18px;
    height: 18px;
}

/* Code styling */
.content-body pre {
    background: var(--code-bg) !important;
    padding: 24px !important;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

.content-body code {
    font-family: var(--font-mono);
    background: var(--code-bg);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.content-body pre code {
    background: none;
    padding: 0;
    border: none;
}

/* ========================================
   READING TIME BADGE
   ======================================== */

.reading-time {
    display: inline-block;
    margin-left: 16px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 2px solid var(--accent-primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    vertical-align: middle;
}

/* ========================================
   MODULE ACTIONS
   ======================================== */

.module-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding: 24px;
    background: var(--bg-glass);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.navigation-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
    font-family: var(--font-primary);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.btn-complete {
    background: var(--accent-success);
    color: #000;
    border: none;
}

.btn-complete:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.4);
}

.btn-complete.completed {
    background: var(--bg-glass);
    color: var(--accent-success);
    border: 2px solid var(--accent-success);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Extra Small Devices (< 576px) */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }
    
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .theme-toggle,
    .back-to-top {
        width: 48px;
        height: 48px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
    
    .content-body {
        padding: 24px;
        border-radius: 16px;
    }
    
    .content-body h1 {
        font-size: 1.8rem;
    }
    
    .content-body h2 {
        font-size: 1.5rem;
    }
    
    .terminal-breadcrumb {
        font-size: 0.8rem;
        padding: 10px 16px;
    }
    
    .module-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navigation-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small Devices (576px - 768px) */
@media (min-width: 576px) and (max-width: 767px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .content-body {
        padding: 32px;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
        padding: 20px;
    }
    
    .content-body {
        padding: 36px;
    }
}

/* Large Desktops (1440px+) */
@media (min-width: 1440px) {
    .sidebar {
        width: 360px;
    }
    
    .main-content {
        margin-left: 360px;
        max-width: 1400px;
        margin-right: auto;
        padding: 32px;
    }
    
    .content-body {
        padding: 56px;
        border-radius: 24px;
    }
    
    .content-body h1 {
        font-size: 3rem;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .particles-bg {
        display: none;
    }
    
    .progress-fill {
        animation: none;
    }
    
    .cursor {
        animation: none;
        opacity: 1;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .sidebar,
    .theme-toggle,
    .back-to-top,
    .search-bar,
    .module-actions,
    .particles-bg,
    .terminal-breadcrumb,
    .copy-code-btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-body {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ========================================
   QUIZ COMPONENT STYLES
   ======================================== */

.quiz-container {
    margin: 48px 0;
    padding: 36px;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.3);
    animation: fadeInScale 0.5s ease;
}

.quiz-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.quiz-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 14px;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.quiz-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 18px;
    line-height: 1.6;
}

.quiz-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.quiz-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quiz-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.quiz-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.quiz-question {
    margin-bottom: 36px;
    padding: 28px;
    background: var(--bg-content);
    border-radius: 16px;
    border-left: 5px solid var(--accent-primary);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px var(--shadow-light);
}

.quiz-question.answered-correct {
    border-left-color: var(--accent-success);
    background: linear-gradient(to right, rgba(0, 255, 65, 0.1), transparent);
}

.quiz-question.answered-incorrect {
    border-left-color: var(--accent-error);
    background: linear-gradient(to right, rgba(255, 71, 87, 0.1), transparent);
}

.question-header {
    display: flex;
    align-items: start;
    gap: 14px;
    margin-bottom: 22px;
}

.question-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.question-text {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.quiz-option {
    padding: 18px 22px;
    background: var(--bg-glass);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 14px;
}

.quiz-option:hover:not(.disabled) {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: translateX(6px);
}

.quiz-option input[type="radio"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.quiz-option label {
    flex: 1;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 500;
}

.quiz-option.selected {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.quiz-option.correct {
    border-color: var(--accent-success);
    background: linear-gradient(to right, rgba(0, 255, 65, 0.15), transparent);
}

.quiz-option.incorrect {
    border-color: var(--accent-error);
    background: linear-gradient(to right, rgba(255, 71, 87, 0.15), transparent);
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-icon {
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.quiz-option.correct .option-icon,
.quiz-option.incorrect .option-icon {
    display: flex;
}

.quiz-option.correct .option-icon {
    color: var(--accent-success);
}

.quiz-option.incorrect .option-icon {
    color: var(--accent-error);
}

.question-feedback {
    margin-top: 18px;
    padding: 18px;
    border-radius: 10px;
    display: none;
}

.question-feedback.show {
    display: block;
    animation: slideInUp 0.4s ease;
}

.question-feedback.correct {
    background: rgba(0, 255, 65, 0.1);
    border-left: 4px solid var(--accent-success);
}

.question-feedback.incorrect {
    background: rgba(255, 71, 87, 0.1);
    border-left: 4px solid var(--accent-error);
}

.feedback-title {
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.feedback-title.correct {
    color: var(--accent-success);
}

.feedback-title.incorrect {
    color: var(--accent-error);
}

.feedback-text {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.quiz-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 36px;
    flex-wrap: wrap;
}

.quiz-btn {
    padding: 16px 36px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-primary);
}

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

.quiz-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
}

.quiz-btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.4);
}

.quiz-btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.quiz-btn-secondary:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.quiz-results {
    margin-top: 36px;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-glass), var(--bg-secondary));
    border-radius: 20px;
    text-align: center;
    display: none;
}

.quiz-results.show {
    display: block;
    animation: fadeInScale 0.6s ease;
}

.results-score {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
}

.results-message {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 28px;
    font-weight: 700;
}

.results-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 28px 0;
    flex-wrap: wrap;
}

.result-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-detail-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.result-detail-value.correct {
    color: var(--accent-success);
}

.result-detail-value.incorrect {
    color: var(--accent-error);
}

.result-detail-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Responsive Quiz Styles */
@media (max-width: 768px) {
    .quiz-container {
        padding: 24px;
        margin: 36px 0;
    }
    
    .quiz-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .quiz-question {
        padding: 20px;
    }
    
    .question-text {
        font-size: 1.05rem;
    }
    
    .quiz-option {
        padding: 14px 18px;
    }
    
    .results-score {
        font-size: 2.8rem;
    }
    
    .results-details {
        gap: 20px;
    }
}
