/* ============================
   O'ZBEK LMS — Main Stylesheet
   SoloLearn-inspired design
   ============================ */

:root {
    --primary: #4A90D9;
    --primary-dark: #2c6fad;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --dark: #1a1a2e;
    --card-bg: #ffffff;
    --body-bg: #f4f6f9;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --navbar-bg: #1a1a2e;
    --code-bg: #282c34;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: #333;
    line-height: 1.7;
}

/* ====== NAVBAR ====== */
.lms-navbar {
    background: var(--navbar-bg) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 0.5rem 0;
}
.navbar-brand .brand-logo { font-size: 1.4rem; }
.lms-navbar .nav-link { color: rgba(255,255,255,0.8) !important; transition: color 0.2s; }
.lms-navbar .nav-link:hover { color: #fff !important; }
.xp-badge { color: #f1c40f !important; font-weight: 600; }

/* ====== HERO ====== */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 3rem 0;
    min-height: 520px;
    display: flex;
    align-items: center;
}
.hero-title { font-size: 2.6rem; font-weight: 800; color: #fff; line-height: 1.2; }
.text-highlight {
    background: linear-gradient(135deg, #4A90D9, #27AE60);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle { color: rgba(255,255,255,0.75); font-size: 1.15rem; margin: 1.5rem 0; }
.hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.hero-stats .stat-item { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.hero-stats .stat-item i { color: var(--warning); margin-right: 4px; }
.btn-hero {
    background: linear-gradient(135deg, #4A90D9, #27AE60);
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 50px;
    padding: 0.75rem 2rem;
}
.btn-hero:hover { opacity: 0.9; color: #fff; transform: translateY(-1px); }

/* Hero code block */
.hero-code-block {
    background: var(--code-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: left;
}
.hero-code-block pre { margin: 0; padding: 1.5rem; font-size: 0.9rem; }
.code-output {
    background: #1e2127;
    padding: 1rem 1.5rem;
    border-top: 1px solid #3d4048;
}
.output-text { color: #98c379; font-family: monospace; font-size: 0.9rem; line-height: 1.8; }

/* ====== SECTIONS ====== */
.section-title { font-size: 1.8rem; font-weight: 700; }
.page-title { font-size: 2rem; font-weight: 700; }

/* ====== COURSE CARDS ====== */
.course-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-top: 4px solid var(--course-color, #4A90D9);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.course-card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.course-icon { font-size: 2.5rem; line-height: 1; }
.course-card-body { padding: 0.5rem 1.5rem 1rem; flex: 1; }
.course-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.course-desc { color: var(--text-muted); }
.course-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }
.course-card-footer { padding: 1rem 1.5rem 1.5rem; }
.category-tag {
    display: inline-block;
    background: #e8f4fd;
    color: #2c6fad;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Difficulty badges */
.difficulty-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.difficulty-boshlangich { background: #d4edda; color: #155724; }
.difficulty-orta { background: #fff3cd; color: #856404; }
.difficulty-murakkab { background: #f8d7da; color: #721c24; }

/* ====== FEATURES ====== */
.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* ====== COURSE HERO ====== */
.course-hero { min-height: 320px; display: flex; align-items: center; }
.course-icon-lg { font-size: 4rem; }
.text-white-75 { color: rgba(255,255,255,0.75) !important; }
.breadcrumb-nav a { text-decoration: none; }
.stat-badge {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    margin-right: 8px;
}
.course-stats-row { display: flex; flex-wrap: wrap; gap: 8px; }

.enrollment-progress-card, .enroll-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.progress-label, .progress-percent { color: rgba(255,255,255,0.8); font-size: 0.9rem; }

/* ====== LESSONS LIST ====== */
.lessons-list { display: flex; flex-direction: column; gap: 0; }
.lesson-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0;
    transition: background 0.2s;
}
.lesson-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.lesson-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.lesson-row + .lesson-row { border-top: none; }
.lesson-row:hover { background: #f8f9ff; }
.lesson-number {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}
.lesson-info { flex: 1; }
.lesson-name { font-weight: 600; }
.lesson-status { flex-shrink: 0; }
.lesson-action { flex-shrink: 0; }

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-done { background: #d4edda; color: #155724; }
.status-test { background: #fff3cd; color: #856404; }
.status-progress { background: #cce5ff; color: #004085; }
.status-locked { background: #f8f9fa; color: #6c757d; }

/* ====== LESSON CONTENT ====== */
.lesson-sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    height: calc(100vh - 60px);
}
.sidebar-header { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.back-link { text-decoration: none; font-size: 0.85rem; }
.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}
.part-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 2px;
    text-decoration: none;
    color: inherit;
}
.part-nav-item:hover { background: #f0f4ff; }
.part-nav-item.active { background: #e8f0fe; }
.part-nav-item.done { opacity: 0.7; }
.part-nav-item.disabled-nav { pointer-events: none; opacity: 0.5; }
.part-nav-icon { width: 20px; flex-shrink: 0; text-align: center; font-size: 0.85rem; }
.part-nav-text { line-height: 1.3; }
.test-nav { color: inherit; }

/* Lesson Part Content */
.lesson-content-area { max-width: 800px; }
.part-header { display: flex; align-items: center; gap: 1rem; padding-top: 2rem; }
.part-number-badge {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.part-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.part-content { font-size: 1.05rem; line-height: 1.8; }

/* Code blocks */
.code-block-wrapper {
    background: var(--code-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #3d4048;
}
.code-block-header {
    background: #21252b;
    padding: 0.6rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-bottom: 1px solid #3d4048;
}
.code-lang-badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}
.code-label { color: rgba(255,255,255,0.5); font-size: 0.8rem; }
.code-block-wrapper pre {
    margin: 0;
    padding: 1.2rem;
    background: transparent;
    overflow-x: auto;
}
.code-output-section {
    background: #1e2127;
    border-top: 1px solid #3d4048;
    padding: 1rem;
}
.output-label { color: rgba(255,255,255,0.5); font-size: 0.8rem; margin-bottom: 0.5rem; }
.output-content {
    margin: 0;
    color: #98c379;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    background: transparent;
}

/* Tip box */
.tip-box {
    background: #fffbea;
    border: 1px solid #f0d060;
    border-left: 4px solid #f0d060;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}
.tip-icon { font-size: 1.2rem; flex-shrink: 0; }
.tip-text { font-size: 0.95rem; color: #665a00; }

/* Completed banner */
.lesson-completed-banner {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #28a745;
    border-radius: var(--radius);
    margin-top: 2rem;
}
.completed-icon { font-size: 3rem; }

/* ====== TEST PAGE ====== */
.test-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.question-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.question-num { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.question-points { font-size: 0.85rem; font-weight: 600; }
.question-text { font-size: 1.2rem; font-weight: 600; margin: 1rem 0 1.5rem; }

/* Choices */
.choice-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    margin-bottom: 0.7rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}
.choice-option:hover { border-color: var(--primary); background: #f0f4ff; }
.choice-option.selected { border-color: var(--primary); background: #e8f0fe; }
.choice-radio { display: none; }
.choice-letter {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.choice-option.selected .choice-letter { background: var(--primary); color: #fff; }
.choice-text { font-size: 1rem; }

.fill-blank-input { font-size: 1.1rem; padding: 0.75rem 1rem; }

/* Question dots */
.question-dots { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.q-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
}
.q-dot.active { border-color: var(--primary); color: var(--primary); }
.q-dot.answered { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ====== TEST RESULT ====== */
.result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.result-icon { font-size: 4rem; }
.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 6px solid;
}
.score-pass { border-color: var(--success); color: var(--success); }
.score-fail { border-color: var(--danger); color: var(--danger); }
.score-number { font-size: 2rem; font-weight: 800; }
.score-label { font-size: 0.8rem; color: var(--text-muted); }
.xp-earned-badge {
    display: inline-block;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 20px;
    padding: 6px 16px;
    font-weight: 700;
    color: #856404;
}

/* Answer review */
.answer-review-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--border);
}
.answer-correct { border-left: 4px solid var(--success); }
.answer-wrong { border-left: 4px solid var(--danger); }
.answer-review-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.answer-status-icon { font-size: 1.2rem; }
.answer-question-num { flex: 1; font-weight: 600; color: var(--text-muted); }
.choice-review {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.choice-correct { background: #d4edda; }
.choice-wrong { background: #f8d7da; }
.choice-indicator { font-weight: 700; width: 18px; }
.explanation-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
}
.explanation-label { font-weight: 700; color: var(--primary); margin-bottom: 0.3rem; }

/* ====== MY COURSES ====== */
.my-course-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-top: 4px solid var(--course-color, #4A90D9);
    transition: transform 0.2s;
}
.my-course-card:hover { transform: translateY(-3px); }
.my-course-header {
    padding: 1.2rem 1.2rem 0.5rem;
    display: flex;
    justify-content: space-between;
}
.my-course-body { padding: 0.5rem 1.2rem 1rem; }
.my-course-footer { padding: 0.8rem 1.2rem 1.2rem; }

/* ====== AUTH PAGES ====== */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; padding: 3rem 0; }
.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
}
.brand-logo-lg { font-size: 3rem; }

/* ====== PROFILE ====== */
.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.profile-avatar { font-size: 4rem; line-height: 1; }
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
}
.level-number { font-size: 1.1rem; }
.level-name { font-size: 0.85rem; }
.xp-section { margin: 0 auto; max-width: 250px; }
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); }

/* Avatar picker */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-option { cursor: pointer; }
.avatar-option input { display: none; }
.avatar-emoji {
    width: 38px; height: 38px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    transition: all 0.15s;
    cursor: pointer;
}
.avatar-option:has(input:checked) .avatar-emoji,
.avatar-option.selected .avatar-emoji {
    border-color: var(--primary);
    background: #e8f0fe;
}
.profile-course-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
    color: inherit;
}
.profile-course-card:hover { box-shadow: var(--shadow-hover); }

/* ====== LEADERBOARD ====== */
.top3-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.top1 { border-top: 4px solid gold; transform: translateY(-10px); }
.top2 { border-top: 4px solid silver; }
.top3 { border-top: 4px solid #cd7f32; }
.top3-rank { font-size: 2rem; margin-bottom: 0.5rem; }
.top3-avatar { font-size: 2.5rem; margin-bottom: 0.3rem; }
.top3-name { font-size: 0.9rem; }
.top3-level { margin-top: 2px; }

.leaderboard-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: #f8f9ff; }
.my-row { background: #e8f0fe; }
.lb-rank { width: 40px; text-align: center; font-size: 1.3rem; }
.rank-number { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
.lb-avatar { font-size: 1.5rem; }
.lb-info { flex: 1; }
.lb-name { font-size: 0.95rem; }
.lb-xp { text-align: right; }
.xp-value { font-size: 1.1rem; font-weight: 700; }

/* ====== FILTER BAR ====== */
.filter-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ====== EMPTY STATE ====== */
.empty-state { padding: 3rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }

/* ====== FOOTER ====== */
.lms-footer {
    background: var(--navbar-bg);
    color: rgba(255,255,255,0.7);
}

/* ====== CTA SECTION ====== */
.cta-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-top: 1px solid var(--border);
}

/* ====== UTILITIES ====== */
.text-answer-review { background: #f8f9fa; border-radius: 6px; padding: 0.5rem 0.8rem; font-size: 0.9rem; }
