/* ==========================================
   RESET & BASE STYLES
   ========================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    color: #1f2937;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================
   TOP PROGRESS BAR
   ========================================== */

.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    z-index: 1;
}

/* Hamburger Menu Button (Mobile Only) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    z-index: 1001;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background: #3b82f6;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ==========================================
   LAYOUT
   ========================================== */

.layout {
    display: flex;
    min-height: 100vh;
    padding-top: 32px;
}

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

.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    left: 0;
    top: 32px;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.lang-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: #e5e7eb;
}

.lang-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   STATS LINK
   ========================================== */

.sidebar-stats {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.stats-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.stats-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.stats-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ==========================================
   USER PROFILE / LOGIN
   ========================================== */

.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-button,
.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.login-button:hover,
.logout-button:hover {
    background: #2563eb;
}

.logout-button {
    background: #ef4444;
}

.logout-button:hover {
    background: #dc2626;
}

/* ==========================================
   COURSE NAVIGATION
   ========================================== */

.course-nav {
    padding: 1rem 0;
}

.module {
    margin-bottom: 1.5rem;
}

.module.locked .module-header {
    opacity: 0.6;
}

.module-header {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.module-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.module-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.module-badge.free {
    background: #d1fae5;
    color: #065f46;
}

.module-badge.locked {
    background: #e5e7eb;
    color: #6b7280;
}

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

.lesson-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.lesson-item:hover:not(.locked) {
    background: #f9fafb;
}

.lesson-item.active {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.lesson-item.active .lesson-title {
    color: #1f2937;
    font-weight: 600;
}

.lesson-item.completed .lesson-status {
    color: #10b981;
}

.lesson-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.lesson-status {
    font-size: 0.875rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.lesson-title {
    font-size: 0.875rem;
    color: #4b5563;
    transition: color 0.2s ease;
}

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

.content {
    margin-left: 320px;
    flex: 1;
    padding: 3rem;
    max-width: 900px;
}

.lesson-content {
    background: white;
    border-radius: 0.75rem;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    animation: fadeIn 0.4s ease;
}

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

.lesson-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.lesson-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.lesson-title-main {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.lesson-description {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.7;
}

.lesson-body {
    margin-bottom: 2rem;
}

.lesson-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.lesson-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.lesson-body p {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.lesson-body ul,
.lesson-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-body li {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.lesson-body strong {
    color: #1f2937;
    font-weight: 600;
}

/* Code blocks - VS Code Dark Theme */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.0625rem;
    line-height: 1.8;
    border: 1px solid #3c3c3c;
}

.code-block code {
    color: #d4d4d4;
    font-weight: 400;
    white-space: pre-wrap;
    display: block;
}

/* VS Code Python syntax highlighting */
.code-block .keyword {
    color: #c586c0;
    font-weight: 500;
}

.code-block .function {
    color: #dcdcaa;
    font-weight: 500;
}

.code-block .string {
    color: #ce9178;
}

.code-block .comment {
    color: #6a9955;
    font-style: italic;
}

.code-block .number {
    color: #b5cea8;
}

/* Inline code */
code {
    background: transparent;
    color: #e11d48;
    padding: 0;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.875em;
    font-weight: 500;
}

/* Info boxes */
.info-box {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.info-box p {
    margin-bottom: 0;
}

.success-box {
    background: #d1fae5;
    border-left: 3px solid #10b981;
}

.warning-box {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

/* ==========================================
   TASK CHECKLIST
   ========================================== */

.task-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin: 2rem 0;
}

.task-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.task-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 0.125rem;
}

.task-checkbox:hover {
    border-color: #3b82f6;
}

.task-checkbox.checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.task-text {
    flex: 1;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.complete-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.complete-button:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.complete-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.complete-button.completed {
    background: #10b981;
}

.complete-button.completed:hover {
    background: #059669;
}

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

.quiz-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin: 2rem 0;
}

.quiz-question {
    margin-bottom: 2rem;
}

.quiz-question.answered {
    opacity: 1;
}

.question-text {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.quiz-option:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.quiz-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.quiz-option.correct {
    border-color: #10b981;
    background: #d1fae5;
    cursor: default;
}

.quiz-option.wrong {
    border-color: #ef4444;
    background: #fee2e2;
    cursor: default;
}

.quiz-option.correct:hover,
.quiz-option.wrong:hover {
    background: inherit;
}

.option-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.quiz-option.correct .option-indicator {
    background: #10b981;
    color: white;
}

.quiz-option.wrong .option-indicator {
    background: #ef4444;
    color: white;
}

.option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
}

.quiz-option.correct .option-text,
.quiz-option.wrong .option-text {
    color: #1f2937;
}

.check-mark,
.x-mark {
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.check-mark {
    color: #10b981;
}

.x-mark {
    color: #ef4444;
}

/* Text input questions */
.text-input-question {
    margin-bottom: 2rem;
}

.text-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.text-input-field {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    color: #1f2937;
    font-family: inherit;
    transition: all 0.2s ease;
}

.text-input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.text-input-field[readonly] {
    background: #f9fafb;
    cursor: not-allowed;
}

.text-input-wrapper .check-mark {
    position: static;
    margin-left: 0.5rem;
}

/* Completion Message (Motivational) */
.completion-message {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1), 0 2px 4px -1px rgba(16, 185, 129, 0.06);
}

.motivational-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.next-prompt {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* ==========================================
   NAVIGATION BUTTONS
   ========================================== */

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    gap: 1rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover:not(.disabled) {
    background: #f9fafb;
    border-color: #3b82f6;
    color: #3b82f6;
}

.nav-button.next {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    margin-left: auto;
}

.nav-button.next:hover:not(.disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button svg {
    flex-shrink: 0;
}

/* ==========================================
   PAYWALL
   ========================================== */

.paywall {
    text-align: center;
    padding: 4rem 2rem;
}

.paywall-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.paywall h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.paywall p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.paywall-features {
    text-align: left;
    max-width: 400px;
    margin: 2rem auto;
}

.paywall-features ul {
    list-style: none;
    margin-left: 0;
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.paywall-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    font-size: 1.25rem;
}

.paywall-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paywall-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.paywall-price {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 1.5rem 0;
}

.paywall-price span {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

/* ==========================================
   RESPONSIVE - ENHANCED MOBILE DESIGN
   ========================================== */

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
}

/* Mobile-first: Comprehensive mobile adaptations */
@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Layout adaptations */
    .layout {
        flex-direction: column;
    }

    /* Sidebar - hidden by default on mobile */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 32px;
        bottom: 0;
        width: 280px;
        max-width: 85%;
        border-right: 1px solid #e5e7eb;
        border-bottom: none;
        max-height: none;
        transition: left 0.3s ease;
        z-index: 100;
        box-shadow: none;
    }

    /* Show sidebar when menu is open */
    body.sidebar-open .sidebar {
        left: 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .content {
        margin-left: 0;
        padding: 1rem;
        max-width: 100%;
    }

    /* Progress bar - ensure touch-friendly */
    .progress-bar-container {
        height: 36px;
        padding: 0 0.5rem;
    }

    .progress-text {
        font-size: 0.75rem;
    }

    /* Sidebar header - compact on mobile */
    .sidebar-header {
        padding: 1rem;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-icon {
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    /* Language switcher - smaller on mobile */
    .language-switcher {
        padding: 0.25rem;
    }

    .lang-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    /* User profile - compact */
    .sidebar-user {
        padding: 1rem;
    }

    .user-profile {
        padding: 0.625rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .user-name {
        font-size: 0.8125rem;
    }

    .user-email {
        font-size: 0.6875rem;
    }

    /* Stats link - touch-friendly */
    .sidebar-stats {
        padding: 0 1rem 1rem;
    }

    .stats-link {
        padding: 0.75rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    /* Course navigation - better spacing */
    .course-nav {
        padding: 0.75rem 0;
    }

    .module {
        margin-bottom: 1rem;
    }

    .module-header {
        padding: 0.625rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .module-header h3 {
        font-size: 0.8125rem;
    }

    .module-badge {
        font-size: 0.5625rem;
        padding: 0.25rem 0.5rem;
    }

    /* Lesson items - touch-friendly */
    .lesson-item {
        padding: 0.875rem 1rem;
        min-height: 44px;
    }

    .lesson-title {
        font-size: 0.8125rem;
    }

    .lesson-status {
        font-size: 0.75rem;
    }

    /* Lesson content - optimized padding */
    .lesson-content {
        padding: 1.5rem 1rem;
        min-height: auto;
        border-radius: 0.5rem;
    }

    /* Lesson header */
    .lesson-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .lesson-number {
        font-size: 0.75rem;
    }

    .lesson-title-main {
        font-size: 1.375rem;
        line-height: 1.3;
    }

    .lesson-description {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Lesson body - typography */
    .lesson-body h2 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .lesson-body h3 {
        font-size: 1.0625rem;
        margin-top: 1.25rem;
        margin-bottom: 0.625rem;
    }

    .lesson-body p {
        font-size: 0.9375rem;
        line-height: 1.7;
        margin-bottom: 0.875rem;
    }

    .lesson-body ul,
    .lesson-body ol {
        margin-left: 1.25rem;
        margin-bottom: 0.875rem;
    }

    .lesson-body li {
        font-size: 0.9375rem;
        line-height: 1.6;
        margin-bottom: 0.375rem;
    }

    /* Code blocks - horizontal scroll */
    .code-block {
        padding: 1rem;
        margin: 1.25rem 0;
        font-size: 0.875rem;
        line-height: 1.6;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .code-block code {
        white-space: pre;
    }

    /* Inline code */
    code {
        font-size: 0.8125em;
        word-break: break-word;
    }

    /* Info boxes */
    .info-box,
    .success-box,
    .warning-box {
        padding: 0.875rem 1rem;
        margin: 1.25rem 0;
        border-radius: 0.375rem;
    }

    .info-box p {
        font-size: 0.875rem;
    }

    /* Task section - touch-friendly */
    .task-section {
        padding: 1.25rem;
        margin: 1.5rem 0;
        border-radius: 0.5rem;
    }

    .task-section h3 {
        font-size: 1.0625rem;
        margin-bottom: 0.875rem;
    }

    .task-item {
        padding: 0.75rem 0;
        gap: 0.625rem;
    }

    .task-checkbox {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }

    .task-text {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    .complete-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    /* Quiz section - touch-friendly */
    .quiz-section {
        padding: 1.25rem;
        margin: 1.5rem 0;
        border-radius: 0.5rem;
    }

    .quiz-question {
        margin-bottom: 1.5rem;
    }

    .question-text {
        font-size: 0.9375rem;
        margin-bottom: 0.875rem;
        line-height: 1.5;
    }

    .quiz-options {
        gap: 0.625rem;
    }

    .quiz-option {
        padding: 0.875rem;
        min-height: 52px; /* Touch-friendly height */
    }

    .option-indicator {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 0.8125rem;
    }

    .option-text {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Text input questions */
    .text-input-field {
        padding: 0.875rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    /* Completion message */
    .completion-message {
        margin-top: 1.5rem;
        padding: 1.25rem;
        border-radius: 0.5rem;
    }

    .motivational-text {
        font-size: 1.0625rem;
        margin-bottom: 0.5rem;
    }

    .next-prompt {
        font-size: 0.9375rem;
    }

    /* Navigation buttons - stack on very small screens */
    .lesson-navigation {
        margin-top: 2rem;
        gap: 0.75rem;
    }

    .nav-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    .nav-button .button-text {
        font-size: 0.875rem;
    }

    /* Paywall - responsive */
    .paywall {
        padding: 2.5rem 1.25rem;
    }

    .paywall-icon {
        font-size: 2.5rem;
        margin-bottom: 1.25rem;
    }

    .paywall h2 {
        font-size: 1.5rem;
        margin-bottom: 0.875rem;
    }

    .paywall p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .paywall-features {
        margin: 1.5rem auto;
    }

    .paywall-features li {
        font-size: 0.9375rem;
        margin-bottom: 0.625rem;
    }

    .paywall-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    .paywall-price {
        font-size: 1.75rem;
        margin: 1.25rem 0;
    }

    /* OS Switcher - responsive */
    .os-switcher {
        flex-wrap: wrap;
        padding: 0.875rem;
        gap: 0.5rem;
    }

    .os-switcher-label {
        font-size: 0.875rem;
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .os-btn {
        flex: 1;
        min-width: 80px;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 44px;
    }

    .os-detected-info {
        margin: 1.25rem 0;
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .os-icon {
        font-size: 1.25rem;
    }

    .os-detected-title {
        font-size: 0.9375rem;
    }

    .os-detected-subtitle {
        font-size: 0.8125rem;
    }

    .os-switch-link-inline {
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
    }

    /* Footer - responsive */
    footer {
        padding: 1.5rem 0 !important;
        margin-top: 2.5rem !important;
    }

    footer > div {
        padding: 0 1rem !important;
    }

    footer a {
        font-size: 0.8125rem !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    footer p {
        font-size: 0.8125rem !important;
    }

    /* Ensure inputs don't zoom on iOS */
    input,
    button,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Improve tap targets - all interactive elements */
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Very small screens (< 375px) - older/smaller phones */
@media (max-width: 374px) {
    .progress-text {
        font-size: 0.6875rem;
    }

    .lesson-title-main {
        font-size: 1.25rem;
    }

    .lesson-body h2 {
        font-size: 1.125rem;
    }

    .lesson-body h3 {
        font-size: 1rem;
    }

    .code-block {
        font-size: 0.8125rem;
        padding: 0.875rem;
    }

    .quiz-option {
        padding: 0.75rem;
    }

    .nav-button {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .nav-button .button-text {
        font-size: 0.8125rem;
    }

    /* Stack navigation buttons on very small screens */
    .lesson-navigation {
        flex-direction: column;
    }

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

    .nav-button.next {
        margin-left: 0;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 280px;
    }

    .content {
        margin-left: 280px;
        padding: 2rem;
    }

    .lesson-content {
        padding: 2.5rem 2rem;
    }

    .lesson-title-main {
        font-size: 1.75rem;
    }
}

/* Landscape mobile phones */
@media (max-width: 896px) and (orientation: landscape) {
    .sidebar {
        position: relative;
        width: 100%;
        max-height: none;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .lesson-content {
        padding: 1.5rem 1.25rem;
    }

    .lesson-title-main {
        font-size: 1.25rem;
    }

    .lesson-body h2 {
        font-size: 1.125rem;
        margin-top: 1.25rem;
    }
}

/* Improve scrolling on touch devices */
@media (hover: none) and (pointer: coarse) {
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }

    .code-block {
        -webkit-overflow-scrolling: touch;
    }

    .lesson-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================
   OS SWITCHER FOR LESSON 0.2
   ========================================== */

.os-switcher {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    align-items: center;
}

.os-switcher-label {
    font-weight: 600;
    color: #475569;
    margin-right: 0.5rem;
}

.os-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.os-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.os-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.os-content {
    margin: 1.5rem 0;
}

[data-os] {
    display: none;
}

[data-os="all"] {
    display: block;
}

.os-detected-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.os-detected-badge::before {
    content: "✓";
    font-weight: 700;
}

/* OS Detection Info Block */
.os-detected-info {
    margin: 1.5rem 0 2rem 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.os-detected-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.os-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.os-detected-content {
    flex: 1;
}

.os-detected-title {
    font-size: 1rem;
    color: #1e40af;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.os-detected-subtitle {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

.os-switch-links {
    display: inline-block;
    margin-left: 0.25rem;
}

.os-switch-link-inline {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.os-switch-link-inline:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.os-switch-link-inline.active {
    background: #3b82f6;
    color: white;
}

.os-separator {
    color: #94a3b8;
    margin: 0 0.25rem;
    font-weight: 300;
}

/* OS Switcher - Small inline version */
.os-switcher-small {
    text-align: center;
    padding: 1rem 0;
    margin: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 4px;
}

.os-switcher-text {
    font-size: 0.875rem;
    color: #64748b;
    margin-right: 0.5rem;
}

.os-switch-link {
    font-size: 0.875rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.os-switch-link:hover {
    background: #dbeafe;
    color: #1e40af;
}

.os-switch-link.active {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.os-switcher-separator {
    color: #cbd5e1;
    margin: 0 0.5rem;
    font-size: 0.75rem;
}
