:root {
    --primary-blue: #1A73E8;
    --primary-purple: #4285F4;
    --success-green: #34A853;
    --warning-yellow: #FBBC04;
    --bg-light: #ffffff;
    --bg-gray: #F8F9FA;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --sidebar-width: 320px;
    --navbar-height: 72px;
    --gradient-primary: linear-gradient(135deg, #1A73E8 0%, #4285F4 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade {
    animation: fadeIn 0.4s ease-out forwards;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-lg);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.lesson-progress-container {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.lesson-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-top: 1rem;
}

.lesson-progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
    transform: translateY(-50%);
    z-index: 1;
}

.lesson-progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: translateY(-50%);
    z-index: 2;
    transition: width var(--transition-medium);
}

.progress-step {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.progress-step.active {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: #eef2ff;
    transform: scale(1.1);
}

.progress-step.completed {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.progress-step-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* ... existing code ... */

/* ========================================
   Practice Tabs
======================================== */
.practice-tabs {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

.practice-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    border: none;
}

.practice-tabs .nav-link:hover {
    color: var(--primary-blue);
    background: rgba(79, 70, 229, 0.1);
}

.practice-tabs .nav-link.active {
    background: var(--gradient-primary);
    color: white;
}

/* ========================================
   Story Cards
======================================== */
.story-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 0.875rem;
    padding: 1.75rem;
    transition: all var(--transition-medium);
}

.story-card:hover {
    box-shadow: var(--shadow-medium);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-gray);
}

.story-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.story-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 0.75rem;
    border-left: 4px solid var(--warning-yellow);
}

.story-vocab {
    background: rgba(79, 70, 229, 0.05);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.story-vocab h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
}

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.vocab-item {
    background: white;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vocab-item strong {
    color: var(--primary-blue);
    font-size: 0.875rem;
}

.vocab-item .text-muted {
    font-size: 0.8125rem;
}

.story-audio {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-gray);
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    padding-top: var(--navbar-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Base Font Size and Touch Targets */
@media (max-width: 767.98px) {
    html {
        font-size: 16px;
        /* Prevent iOS zoom on inputs */
    }

    body {
        font-size: 1rem;
        padding-top: 60px;
        /* Smaller navbar height on mobile */
    }

    .btn {
        min-height: 48px;
        /* Better touch targets */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

a {
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Navbar
======================================== */
.global-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.global-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.overall-numerical-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bg-soft-primary {
    background-color: #eef2ff !important;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    z-index: 1050;
    display: flex;
    align-items: center;
    padding: 0;
    /* Add padding: 0 to handle progress bar positioning if needed */
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-text {
    color: var(--text-primary);
}

.logo-highlight {
    color: var(--primary-blue);
}

/* ========================================
   Gradient Buttons
======================================== */
.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
    color: white;
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-gradient-purple {
    background: linear-gradient(135deg, var(--primary-purple) 0%, #a855f7 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
}

.btn-gradient-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
    color: white;
}

.btn-gradient-success {
    background: var(--gradient-success);
    border: none;
    color: white;
}

.btn-gradient-success:hover {
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    color: white;
}

/* ========================================
   Sidebar
======================================== */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background-color: var(--bg-light);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    z-index: 1000;
    transition: transform var(--transition-medium);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    z-index: 10;
}

.sidebar-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.search-box .form-control {
    background-color: var(--bg-gray);
    border-color: var(--border-light);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-size: 0.875rem;
}

.search-box .form-control:focus {
    background-color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-section {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.nav-section-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Accordion Styles */
.sidebar .accordion-item {
    border: none;
    background: transparent;
    margin-bottom: 0.25rem;
}

.sidebar .accordion-button {
    background: transparent;
    border: none;
    padding: 0.75rem 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: none;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.sidebar .accordion-button:hover {
    background-color: var(--bg-gray);
}

.sidebar .accordion-button:not(.collapsed) {
    background-color: var(--bg-gray);
    color: var(--primary-blue);
    box-shadow: none;
}

.sidebar .accordion-button:focus {
    box-shadow: none;
}

.sidebar .accordion-button::after {
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
}

.sidebar .accordion-body {
    padding: 0.25rem 0 0.5rem 0;
}

/* Lesson Links */
.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
    border-radius: 0.5rem;
    margin-bottom: 0.125rem;
}

.lesson-link:hover {
    background-color: var(--bg-gray);
    color: var(--text-primary);
}

.lesson-link.active {
    background-color: #eef2ff;
    color: var(--primary-blue);
    font-weight: 500;
}

.lesson-link .lesson-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Vocabulary List */
.vocab-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vocab-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
    margin-bottom: 0.125rem;
}

.vocab-link:hover {
    background-color: var(--bg-gray);
    color: var(--text-primary);
}

.vocab-link.feature-link {
    font-weight: 500;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* ... existing code ... */

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        /* Reduced padding */
    }

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

    /* Mobile Navigation Adjustments */
    .top-navbar {
        height: 60px;
    }

    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
    }
}

@media (max-width: 767.98px) {
    .content-card {
        padding: 1.5rem;
        /* Reduce card padding on mobile */
        border-radius: 1rem;
    }

    .lesson-title {
        font-size: 1.0rem;
        /* Smaller title on mobile */
    }

    /* Practice Tabs Scrolling */
    .practice-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        display: flex;
        gap: 0.5rem;
    }

    .practice-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 1rem;
    }

    /* Progress Steps Mobile */
    .lesson-progress-steps {
        overflow-x: auto;
        padding-bottom: 1rem;
        justify-content: flex-start;
        gap: 1.5rem;
    }

    .lesson-progress-line {
        width: 100%;
        left: 0;
    }

    .progress-step {
        width: 3rem;
        /* Larger touch target */
        height: 3rem;
        flex-shrink: 0;
    }

    .story-card {
        padding: 1.25rem;
    }

    .story-content {
        padding: 1rem;
        font-size: 1rem;
        /* Enhanced readability */
    }
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item a:hover {
    color: var(--primary-blue);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* Content Card */
.content-card {
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.content-card .lesson-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Badges */
.level-badge {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.badge-new {
    background: var(--gradient-success);
    color: white;
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.badge-cefr {
    background: var(--bg-gray);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.badge-cefr-blue {
    background: #dbeafe;
    color: #1e40af;
}

/* Lesson Body */
.lesson-body {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-top: 1.5rem;
}

.lesson-body h4 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.lesson-body h5 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.0625rem;
}

.lesson-body ul {
    padding-left: 1.25rem;
}

.lesson-body li {
    margin-bottom: 0.5rem;
}

/* Examples Section */
.examples-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    margin-top: 2rem;
}

.examples-section h5 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Practice Section */
.practice-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px dashed #bae6fd;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.practice-section::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.practice-section h5 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   Quiz Styles
======================================== */
.quiz-container {
    position: relative;
    z-index: 1;
}

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

.quiz-progress {
    height: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 1rem;
    transition: width var(--transition-medium);
}

.quiz-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.question-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.question-text {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.quiz-option {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-option:hover:not(.disabled) {
    border-color: var(--primary-blue);
    background: rgba(79, 70, 229, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary-blue);
    background: rgba(79, 70, 229, 0.1);
}

.quiz-option.correct {
    border-color: var(--success-green);
    background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

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

.quiz-option .option-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: none;
}

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

.quiz-explanation {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 0.625rem;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.quiz-explanation.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.quiz-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 2rem;
}

.quiz-result .result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.quiz-result h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.quiz-result .result-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

/* ========================================
   Hero Section
======================================== */
.hero-section {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.1), transparent 60%);
    pointer-events: none;
}

.hero-content {
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title span {
    color: var(--primary-blue);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-light);
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: all var(--transition-medium);
    height: 100%;
    box-shadow: var(--shadow-soft);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    color: white;
}

.feature-icon.blue {
    background: var(--gradient-primary);
}

.feature-icon.green {
    background: var(--gradient-success);
}

.feature-icon.purple {
    background: linear-gradient(135deg, var(--primary-purple), #a855f7);
}

.feature-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.0625rem;
}

.feature-text {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.875rem;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ========================================
   Mobile Overlay
======================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===== PREMIUM BLUR CONTENT ===== */

.blurred {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.premium-overlay {
    position: absolute;
    inset: 0;

    /* qora fon */
    background: rgba(0, 0, 0, 0.55);

    /* ORQA TOMONNI BLUR QILADI */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    color: #fff;
    z-index: 10;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Vocab Grid & Item */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.vocab-item {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vocab-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-blue);
}

.vocab-item strong {
    font-size: 1.1rem;
    color: var(--primary-blue);
}

.vocab-item .text-muted {
    font-size: 0.9rem;
}

/* Writing Section */
.writing-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.writing-prompt {
    margin-bottom: 1.5rem;
}

.writing-prompt h5 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.writing-area textarea {
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    transition: all var(--transition-fast);
}

.writing-area textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#writingFeedback {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

/* Tab Pane Styling Overrides */
.practice-section .tab-pane {
    animation: fadeIn 0.4s ease;
}

.practice-tabs .nav-link {
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.practice-tabs .nav-link.active {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* ========================================
   Dark Mode Overrides
   ======================================== */
:root[data-theme="dark"] {
    --bg-light: #1e293b;
    --bg-gray: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-light: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

[data-theme="dark"] body {
    background-color: var(--bg-gray);
    color: var(--text-primary);
    background-image: none;
    /* Remove light mode gradients */
}

[data-theme="dark"] .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .story-card,
[data-theme="dark"] .vocab-item,
[data-theme="dark"] .lesson-progress-container,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .content-card,
[data-theme="dark"] .top-navbar {
    background-color: var(--bg-light);
    border-color: var(--border-light);
}

[data-theme="dark"] .sidebar-header {
    background-color: var(--bg-light);
    border-color: var(--border-light);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-gray);
    border-color: var(--border-light);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-gray);
    color: var(--text-primary);
}

[data-theme="dark"] .lesson-link:hover,
[data-theme="dark"] .vocab-link:hover,
[data-theme="dark"] .sidebar .accordion-button:hover,
[data-theme="dark"] .sidebar .accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .lesson-link.active {
    background-color: rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] .story-content {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-left-color: var(--warning-yellow);
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-light);
    border-color: var(--border-light);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-gray);
    color: var(--primary-blue);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-link {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-light) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

/* Aggressive Dark Mode Overrides for Lesson Content */
[data-theme="dark"] .card,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .shadow-sm {
    background-color: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
}

[data-theme="dark"] .lesson-content div[style*="background-color: white"],
[data-theme="dark"] .lesson-content div[style*="background: white"],
[data-theme="dark"] .lesson-content .p-4.bg-white,
[data-theme="dark"] .lesson-content .p-3.bg-white {
    background-color: var(--bg-light) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .lesson-text {
    color: var(--text-primary) !important;
}

/* Fix for light background containers in dark mode */
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .alert-light,
[data-theme="dark"] .alert-secondary,
[data-theme="dark"] pre,
[data-theme="dark"] code,
[data-theme="dark"] blockquote,
[data-theme="dark"] .card-body,
[data-theme="dark"] .example-box,
/* Hypothetical class */
[data-theme="dark"] .note-box,
/* Hypothetical class */
[data-theme="dark"] [class*="bg-"] {
    background-color: #334155 !important;
    /* Slightly lighter than main bg */
    color: #f8fafc !important;
    border-color: #475569 !important;
}

/* Specific fix for styles that might be using RGB/RGBA for light grays */
[data-theme="dark"] .lesson-content div {
    background-color: transparent !important;
    /* Reset nested divs unless specific */
    color: inherit;
}

/* Restore background for specific interactive elements if needed, but for now force dark */
[data-theme="dark"] .lesson-content .card,
[data-theme="dark"] .lesson-content .p-3,
[data-theme="dark"] .lesson-content .p-4 {
    background-color: #1e293b !important;
}

/* Ensure text is readable on these new backgrounds */
[data-theme="dark"] * {
    border-color: #334155;
}

/* ========================================
   UX Enhancements
======================================== */

/* Focus Mode */
body.focus-mode header.top-navbar,
body.focus-mode aside.sidebar,
body.focus-mode nav[aria-label="breadcrumb"],
body.focus-mode .lesson-progress-container,
body.focus-mode .mobile-bottom-nav,
body.focus-mode .practice-tabs,
body.focus-mode .examples-section {
    display: none !important;
}

body.focus-mode .main-content {
    margin-left: 0 !important;
    padding-top: 2rem !important;
    max-width: 800px;
    margin: 0 auto;
}

body.focus-mode .content-card {
    box-shadow: none;
    border: none;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: all 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-blue);
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 65px;
    }
}

/* AI Vocab Popover/Tooltip */
.ai-vocab-popover {
    position: absolute;
    background: var(--bg-light);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    z-index: 9999;
    max-width: 250px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.ai-vocab-popover.show {
    opacity: 1;
    pointer-events: auto;
}

.clickable-word {
    cursor: pointer;
    border-bottom: 1px dashed var(--primary-blue);
    transition: background 0.2s;
}

.clickable-word:hover {
    background: rgba(26, 115, 232, 0.1);
}

/* Roadmap Timeline */
.roadmap-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.5rem;
    width: 2px;
    background: var(--border-light);
}

.roadmap-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.roadmap-item .roadmap-icon {
    position: absolute;
    left: -1rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--success-green);
    color: var(--success-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 2;
}

.roadmap-item.current .roadmap-icon {
    border-color: var(--primary-blue);
    color: var(--bg-light);
    background: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.roadmap-item.locked .roadmap-icon {
    border-color: var(--border-light);
    color: var(--text-muted);
}