/* TOEIC Practice Web App Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Kanit:wght@200;300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #070b15;
    --card-bg: rgba(22, 30, 49, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --accent-orange: #f59e0b;
    --accent-orange-glow: rgba(245, 158, 11, 0.15);
    --accent-green: #34d399;
    --accent-green-glow: rgba(52, 211, 153, 0.15);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    
    --font-heading: 'Outfit', 'Kanit', sans-serif;
    --font-body: 'Inter', 'Kanit', sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background blob decorations */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background-color: var(--primary);
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background-color: #3b82f6;
    bottom: -150px;
    left: -100px;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background-color: #a855f7;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

/* Layout Wrapper */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem 1.25rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    font-size: 1.25rem;
    color: white;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.header-stats {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-badge i {
    color: var(--accent-orange);
}

/* Glassmorphic Panel Layout */
.panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* View transitions */
.view-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-section.active-view {
    display: block;
    animation: slideUpFade 0.5s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Home Screen Card */
.category-card {
    padding: 2.5rem 2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 60%);
    pointer-events: none;
}

.category-badge {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.category-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.meta-val {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

/* Category Details Sub-topics */
.category-header {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.05));
    padding: 2rem;
    border-bottom: 1px solid var(--card-border);
    position: relative;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.btn-back:hover {
    color: white;
}

.subtopics-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subtopic-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.subtopic-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.subtopic-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-secondary);
}

.subtopic-details h3 {
    font-size: 1rem;
    color: white;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.subtopic-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.subtopic-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: var(--primary-glow);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-locked {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.badge-completed {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.subtopic-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
}

.subtopic-item.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.subtopic-item.locked:hover {
    transform: none;
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.04);
}

/* Lesson Screen Layout */
.lesson-container {
    padding: 2rem;
}

.lesson-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
}

.lesson-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-body {
    font-size: 0.975rem;
    color: #cbd5e1;
    line-height: 1.7;
}

.lesson-section {
    margin-bottom: 3.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: white;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--primary-light);
}

/* Interactive Tabs for Suffixes Cheatsheet */
.tabs-header {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s forwards;
}

.tab-content.active {
    display: block;
}

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

.suffix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.suffix-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.suffix-tag {
    font-family: 'Courier New', Courier, monospace;
    color: var(--accent-orange);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.suffix-example {
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
    transition: opacity 0.4s ease;
}

.suffix-meaning {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: opacity 0.4s ease;
}

.fade-out {
    opacity: 0 !important;
}

/* Callout Box styled like Github Alert */
.alert-box {
    background: rgba(30, 41, 59, 0.4);
    border-left: 4px solid var(--primary-light);
    padding: 1.25rem 1.5rem;
    border-radius: 0 16px 16px 0;
    margin: 1.5rem 0;
}

.alert-box.alert-warning {
    border-left-color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.03);
}

.alert-title {
    font-weight: 700;
    color: white;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.alert-title i {
    font-size: 1.1rem;
}

.alert-desc {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* POS Position Formulas - visual cards */
.formula-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.formula-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.formula-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.7);
}

.formula-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.formula-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.formula-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Interactive Sentence Analyzer Widget */
.sentence-widget {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.75rem;
    margin-top: 1.5rem;
}

.sentence-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sentence-word {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.sentence-word.hoverable:hover {
    background: var(--primary-glow);
    border-color: var(--primary-light);
    color: white;
}

.sentence-word.active-word {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.word-explanation-panel {
    min-height: 80px;
    background: rgba(7, 11, 21, 0.5);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

/* Call to action at bottom of lesson */
.cta-box {
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 4rem;
}

.cta-box h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

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

/* Quiz Screen Layout */
.quiz-header {
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.quiz-progress-bar-container {
    width: 40%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-light), #3b82f6);
    width: 0%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.quiz-score-indicator span {
    color: var(--success);
    font-weight: 700;
}

.quiz-body {
    padding: 2rem;
}

.question-card {
    background: rgba(7, 11, 21, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 1.1rem 1.5rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.option-btn i {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.15rem;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Option States */
.option-btn.selected {
    border-color: var(--primary-light);
    background: var(--primary-glow);
}

.option-btn.correct {
    border-color: var(--success) !important;
    background: var(--success-glow) !important;
    color: #a7f3d0 !important;
    font-weight: 600;
}

.option-btn.correct i {
    color: var(--success) !important;
}

.option-btn.wrong {
    border-color: var(--danger) !important;
    background: var(--danger-glow) !important;
    color: #fca5a5 !important;
    font-weight: 600;
}

.option-btn.wrong i {
    color: var(--danger) !important;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Explanation Panel */
.explanation-panel {
    background: rgba(7, 11, 21, 0.8);
    border-radius: 18px;
    border-left: 4px solid var(--accent-orange);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    animation: slideDown 0.3s forwards ease-out;
}

.explanation-panel.correct-explanation {
    border-left-color: var(--success);
}

.explanation-panel.wrong-explanation {
    border-left-color: var(--danger);
}

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

.explanation-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.explanation-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: space-between;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Results Screen Layout */
.result-screen {
    padding: 3rem 2rem;
    text-align: center;
}

.trophy-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
}

.trophy-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    position: absolute;
    top: 0;
    left: 0;
    animation: pulseGlow 2s infinite ease-in-out;
}

.trophy-icon {
    font-size: 4rem;
    color: var(--accent-orange);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatIcon 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes floatIcon {
    0%, 100% { transform: translate(-50%, -54%); }
    50% { transform: translate(-50%, -46%); }
}

.result-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 450px;
    margin: 0 auto 2.5rem auto;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2.5rem auto;
    position: relative;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.5);
}

.score-num {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--success);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.result-feedback {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 2rem;
    border-radius: 16px;
    font-size: 0.95rem;
    max-width: 550px;
    margin: 0 auto 3rem auto;
    line-height: 1.5;
}

.result-feedback.feedback-perfect {
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.03);
}

.result-feedback.feedback-good {
    border-color: rgba(99, 102, 241, 0.2);
    color: #93c5fd;
    background: rgba(99, 102, 241, 0.03);
}

.result-feedback.feedback-learn {
    border-color: rgba(245, 158, 11, 0.2);
    color: #fde047;
    background: rgba(245, 158, 11, 0.03);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Review Answers List */
.review-section {
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 3rem;
    text-align: left;
}

.review-section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.review-item {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.wrong {
    border-left: 4px solid var(--danger);
}

.review-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.review-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.review-badge.correct {
    background: var(--success-glow);
    color: var(--success);
}

.review-badge.wrong {
    background: var(--danger-glow);
    color: var(--danger);
}

.review-q-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.review-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.review-opt {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.review-opt.user-selected {
    border-color: var(--danger);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.05);
}

.review-opt.correct-answer {
    border-color: var(--success);
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.05);
}

.review-exp {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* Footer styling */
footer {
    margin-top: auto;
    text-align: center;
    padding: 3rem 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem 0.75rem 2rem 0.75rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .category-card {
        padding: 1.75rem 1.25rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .category-meta {
        grid-template-columns: 1fr 1fr;
    }
    
    .category-header {
        padding: 1.5rem 1.25rem;
    }
    
    .subtopics-list {
        padding: 1rem;
    }
    
    .subtopic-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .subtopic-badge {
        align-self: flex-start;
    }
    
    .lesson-container {
        padding: 1.25rem;
    }
    
    .lesson-title {
        font-size: 1.6rem;
    }
    
    .cta-box {
        padding: 1.5rem;
    }
    
    .quiz-body {
        padding: 1.25rem 1rem;
    }
    
    .quiz-header {
        padding: 1rem;
    }
    
    .quiz-progress-bar-container {
        width: 30%;
    }
    
    .option-btn {
        padding: 0.9rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ================= LIGHT/WARM-READING THEME OVERRIDES ================= */

body.light-theme {
    --bg-dark: #f6f1eb; /* Soft warm paper-cream page background */
    --card-bg: rgba(252, 251, 247, 0.85); /* Warm paper white */
    --card-border: rgba(92, 83, 70, 0.12); /* Subtle warm brown borders */
    --text-primary: #2d261e; /* Deep coffee brown for comfortable reading */
    --text-secondary: #706556; /* Soft warm grey text */
    
    --primary: #4f46e5;
    --primary-light: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.08);
    
    --accent-orange: #b45309; /* Deep warm orange/amber */
    --accent-orange-glow: rgba(180, 83, 9, 0.08);
    --accent-green: #047857; /* Deep readable forest green */
    --accent-green-glow: rgba(4, 120, 87, 0.08);
    
    --success: #047857; /* Rich emerald */
    --success-glow: rgba(4, 120, 87, 0.08);
    
    --danger: #be123c; /* Dark crimson */
    --danger-glow: rgba(190, 18, 60, 0.08);
}

body.light-theme .bg-blob {
    opacity: 0.12;
    filter: blur(140px);
}

body.light-theme .logo-text h1 {
    background: linear-gradient(135deg, #2d261e, #706556);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .subtopic-num {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-secondary) !important;
}

body.light-theme .subtopic-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

body.light-theme .subtopic-item:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.15);
}

body.light-theme .question-card {
    background: rgba(252, 251, 247, 0.9);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .option-btn {
    background: rgba(252, 251, 247, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .option-btn i {
    color: rgba(0, 0, 0, 0.2);
}

body.light-theme .option-btn:hover:not(:disabled) {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .option-btn.selected {
    border-color: var(--primary-light) !important;
    background: var(--primary-glow) !important;
}

body.light-theme .explanation-panel {
    background: rgba(252, 251, 247, 0.95);
    border-color: var(--accent-orange);
}

body.light-theme .explanation-panel.correct-explanation {
    border-color: var(--success);
}

body.light-theme .explanation-panel.wrong-explanation {
    border-color: var(--danger);
}

body.light-theme .sentence-widget {
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(92, 83, 70, 0.18);
}

body.light-theme .sentence-word.hoverable:hover {
    background: var(--primary-glow);
    border-color: var(--primary-light);
    color: var(--primary);
}

body.light-theme .word-explanation-panel {
    background: rgba(252, 251, 247, 0.9);
    border: 1px dashed rgba(92, 83, 70, 0.35);
}

body.light-theme .tab-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(92, 83, 70, 0.25);
    color: var(--text-secondary);
}

body.light-theme .tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

body.light-theme .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

body.light-theme .suffix-card {
    background: #ffffff;
    border: 1.5px solid rgba(92, 83, 70, 0.22);
    box-shadow: 0 4px 10px rgba(92, 83, 70, 0.05);
}

body.light-theme .suffix-example {
    color: var(--text-primary);
}

body.light-theme .formula-card {
    background: #ffffff;
    border: 1.5px solid rgba(92, 83, 70, 0.22);
    box-shadow: 0 4px 10px rgba(92, 83, 70, 0.05);
}

body.light-theme .formula-card:hover {
    background: #ffffff;
    border-color: var(--primary-light);
}

body.light-theme .formula-badge {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .alert-box {
    background: rgba(79, 70, 229, 0.04);
}

body.light-theme .alert-box.alert-warning {
    background: rgba(180, 83, 9, 0.04);
}

body.light-theme .alert-title {
    color: var(--text-primary);
}

body.light-theme .alert-desc {
    color: var(--text-secondary);
}

body.light-theme .score-circle {
    background: rgba(252, 251, 247, 0.9);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .result-feedback {
    background: rgba(252, 251, 247, 0.95);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .result-feedback.feedback-perfect {
    background: rgba(4, 120, 87, 0.04);
    color: #065f46;
}

body.light-theme .result-feedback.feedback-good {
    background: rgba(37, 99, 235, 0.04);
    color: #1e40af;
}

body.light-theme .result-feedback.feedback-learn {
    background: rgba(180, 83, 9, 0.04);
    color: #92400e;
}

body.light-theme .review-item {
    background: rgba(252, 251, 247, 0.8);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .review-opt {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .review-exp {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

/* Custom color corrections for Light Mode to prevent text from blending with the warm background */
body.light-theme .lesson-title {
    color: var(--text-primary) !important;
}

body.light-theme .section-title {
    color: var(--text-primary) !important;
}

body.light-theme .lesson-body {
    color: var(--text-primary) !important;
}

body.light-theme .category-title {
    color: var(--text-primary) !important;
}

body.light-theme .meta-val {
    color: var(--text-primary) !important;
}

body.light-theme .subtopic-details h3 {
    color: var(--text-primary) !important;
}

body.light-theme .alert-title {
    color: var(--text-primary) !important;
}

body.light-theme .alert-desc {
    color: var(--text-primary) !important;
}

body.light-theme .formula-text {
    color: var(--text-primary) !important;
}

body.light-theme .option-btn.correct {
    color: #047857 !important; /* Dark green for success in light mode */
}

body.light-theme .option-btn.wrong {
    color: #be123c !important; /* Dark red for error in light mode */
}

body.light-theme .review-section-title {
    color: var(--text-primary) !important;
}

body.light-theme .review-q-text {
    color: var(--text-primary) !important;
}

body.light-theme .lesson-section h4 {
    color: var(--text-primary) !important;
}

/* SVA Subject, Verb, and Modifier Highlighting */
.sva-hl-subject {
    color: #4ade80 !important; /* light green in dark mode */
    font-weight: 700;
}
.sva-hl-verb {
    color: #fbbf24 !important; /* amber/gold in dark mode */
    font-weight: 700;
}
.sva-hl-modifier {
    color: #94a3b8;
    font-style: italic;
    opacity: 0.9;
}

body.light-theme .sva-hl-subject {
    color: #059669 !important; /* emerald green in light mode */
}
body.light-theme .sva-hl-verb {
    color: #d97706 !important; /* dark amber/gold in light mode */
}
body.light-theme .sva-hl-modifier {
    color: #706556;
}

/* SVA Dynamic Card */
.sva-dynamic-card {
    background: rgba(15, 23, 42, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.light-theme .sva-dynamic-card {
    background: #ffffff;
    border: 1.5px solid rgba(92, 83, 70, 0.22);
    box-shadow: 0 4px 10px rgba(92, 83, 70, 0.05);
}

.sva-card-header {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sva-pair {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.badge-single {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    width: fit-content;
    font-weight: bold;
}

.badge-plural {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    width: fit-content;
    font-weight: bold;
}

body.light-theme .badge-single {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

body.light-theme .badge-plural {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.sva-sentence-container {
    font-size: 1.1rem;
    font-weight: 600;
    transition: opacity 0.4s ease;
}

.sva-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-top: 0.15rem;
}

/* SVA Monospace Sentence Block */
.sva-sentence-block {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.60rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

body.light-theme .sva-sentence-block {
    background: rgba(92, 83, 70, 0.08);
    color: #2d261e;
}

.blurry-question {
    opacity: 0.12;
    filter: blur(4.5px);
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.blurry-question:hover {
    opacity: 0.25;
    filter: blur(2px);
}
.blurry-question.revealed {
    opacity: 1 !important;
    filter: none !important;
    user-select: text;
    cursor: default;
}




