/* =============================================
   ВНУТРЕННИЕ СТРАНИЦЫ — Стили
   Topic, Lesson, Quiz, Dashboard
   ============================================= */

/* === Common Inner Page === */
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-xp-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(108, 92, 231, 0.08);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.xp-icon { font-size: 1rem; }

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.nav-avatar:hover {
    border-color: var(--primary);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    padding-top: calc(var(--nav-height) + 24px);
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.breadcrumbs a:hover { color: var(--primary); }

.breadcrumbs svg { opacity: 0.4; }

/* Page Header */
.page-header {
    background: var(--bg-secondary);
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

/* === TOPIC PAGE === */
.topic-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.topic-hero-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.topic-hero-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topic-hero-status {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-in-progress {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
}

.topic-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.topic-hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.topic-hero-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.meta-xp {
    color: var(--secondary) !important;
    font-weight: 700;
}

/* Progress Ring Card */
.topic-hero-progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.thp-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.thp-ring svg { width: 100%; height: 100%; }

.thp-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.thp-details { text-align: center; }

.thp-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.thp-sub {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* === Lessons List === */
.lessons-list-section {
    padding-top: 40px;
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 850px;
    margin: 0 auto;
}

.lesson-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
}

.lesson-row:hover {
    background: var(--bg-card-hover);
}

/* Status column */
.lesson-row-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 4px;
}

.lesson-check {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lesson-check.completed {
    background: var(--secondary);
}

.lesson-check.current {
    background: var(--primary);
    position: relative;
}

.current-pulse {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.lesson-check.locked {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.lesson-connector {
    width: 2px;
    height: 100%;
    min-height: 40px;
    background: var(--border);
    margin-top: 8px;
}

/* Content */
.lesson-row-content {
    flex: 1;
    min-width: 0;
}

.lesson-row-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lesson-type-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.lesson-row-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.lesson-row-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.lesson-row-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    margin-left: 38px;
}

.lrm-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.lrm-theory { background: rgba(9, 132, 227, 0.1); color: var(--accent-blue); }
.lrm-interactive { background: rgba(108, 92, 231, 0.1); color: var(--primary); }
.lrm-quiz { background: rgba(253, 203, 110, 0.15); color: #E17055; }
.lrm-practice { background: rgba(0, 184, 148, 0.1); color: var(--secondary); }
.lrm-exam { background: rgba(255, 107, 107, 0.1); color: var(--accent-red); }

.lrm-time {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.lrm-xp {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--secondary);
}

.lrm-xp.earned { opacity: 0.6; }

.lesson-row-actions {
    margin-left: 38px;
}

/* Score */
.lesson-row-score {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.score-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.2rem;
    color: var(--border);
}

.star.filled { color: #FDCB6E; }

.score-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(0, 184, 148, 0.1);
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

/* Current lesson */
.lesson-current {
    background: rgba(108, 92, 231, 0.04);
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: var(--radius-lg);
}

/* Locked */
.lesson-locked {
    opacity: 0.5;
}

/* === Bonus Section === */
.bonus-section {
    margin-top: 60px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.bonus-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.bonus-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.bonus-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.bonus-card div {
    flex: 1;
}

.bonus-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.bonus-card p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* === LESSON PAGE === */
.lesson-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .lesson-topbar {
    background: rgba(15, 15, 26, 0.95);
}

.lesson-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.lesson-back {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.lesson-back:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.lesson-topbar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lesson-topbar-topic {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.lesson-topbar-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-progress-bar-top {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 100px;
}

.lesson-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.lesson-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Lesson Main */
.lesson-main {
    padding-top: 60px;
    min-height: 100vh;
    background: var(--bg-primary);
}

.lesson-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.lesson-sidebar {
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.sidebar-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-step:hover {
    background: var(--bg-secondary);
}

.sidebar-step.active {
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-step.completed {
    color: var(--secondary);
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-step.active .step-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.sidebar-step.completed .step-dot {
    background: var(--secondary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.lesson-xp-earned {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.xp-count {
    font-weight: 700;
    color: var(--secondary);
}

/* Lesson Content */
.lesson-content {
    padding: 40px 48px;
    max-width: 800px;
}

.lesson-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.lesson-step.active {
    display: block;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.step-number {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.5;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.content-block {
    margin-bottom: 20px;
}

.content-block p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.content-block strong {
    color: var(--text-primary);
}

/* Definition Card */
.definition-card {
    display: flex;
    gap: 14px;
    padding: 20px;
    background: rgba(108, 92, 231, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.def-icon { font-size: 1.2rem; flex-shrink: 0; }

/* Info Cards Row */
.info-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.info-mini-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.info-mini-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

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

.info-mini-card strong {
    font-size: 0.9rem;
}

.info-mini-card span:last-child {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* Fun Fact */
.fun-fact {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(0, 184, 148, 0.06);
    border: 1px solid rgba(0, 184, 148, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.ff-icon { font-size: 1.3rem; flex-shrink: 0; }

.fun-fact strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.fun-fact p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Warning Card */
.warning-card {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(255, 107, 107, 0.06);
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.wc-icon { font-size: 1.3rem; flex-shrink: 0; }

.warning-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.88rem;
    color: var(--accent-red);
}

.warning-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.warning-card code,
.content-block code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* File Name Demo */
.file-name-demo {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 32px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.fnd-part {
    text-align: center;
}

.fnd-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.fnd-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.fnd-name .fnd-value { color: var(--accent-blue); }
.fnd-name .fnd-label { background: rgba(9, 132, 227, 0.1); color: var(--accent-blue); }

.fnd-ext .fnd-value { color: var(--secondary); }
.fnd-ext .fnd-label { background: rgba(0, 184, 148, 0.1); color: var(--secondary); }

.fnd-dot {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-top: 0;
}

/* Extensions Table */
.extensions-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.ext-row {
    display: grid;
    grid-template-columns: 130px 1fr 1fr;
    padding: 10px 16px;
    font-size: 0.88rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.ext-row:last-child { border-bottom: none; }

.ext-header {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ext-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
}

.ext-doc { background: rgba(9, 132, 227, 0.1); color: var(--accent-blue); }
.ext-img { background: rgba(253, 203, 110, 0.15); color: #E17055; }
.ext-music { background: rgba(108, 92, 231, 0.1); color: var(--primary); }
.ext-video { background: rgba(255, 107, 107, 0.1); color: var(--accent-red); }
.ext-code { background: rgba(0, 184, 148, 0.1); color: var(--secondary); }
.ext-exe { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }

/* File Tree */
.file-tree-interactive {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.file-tree-interactive h4 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.tree-hint {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.tree { padding-left: 0; }

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: default;
    font-size: 0.9rem;
    transition: var(--transition);
    user-select: none;
}

.tree-folder, .tree-root {
    cursor: pointer;
}

.tree-folder:hover, .tree-root:hover {
    background: var(--bg-tertiary);
}

.tree-toggle {
    width: 16px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    transition: var(--transition);
}

.tree-icon { font-size: 1rem; }

.tree-name { font-weight: 500; }

.tree-size {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.tree-children {
    padding-left: 28px;
    display: none;
    border-left: 1px dashed var(--border);
    margin-left: 12px;
}

.tree-children.open { display: block; }

.tree-file {
    padding-left: 24px;
}

.tree-file .tree-name {
    font-weight: 400;
    color: var(--text-secondary);
}

/* Path Demo */
.path-demo {
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.path-visual {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
}

.path-segment {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.path-root { background: rgba(255, 107, 107, 0.1); color: var(--accent-red); }
.path-dir { background: rgba(108, 92, 231, 0.1); color: var(--primary); }
.path-file { background: rgba(0, 184, 148, 0.1); color: var(--secondary); }

.path-sep { color: var(--text-tertiary); font-weight: 300; }

.path-labels {
    display: flex;
    gap: 24px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* Comparison Cards */
.comparison-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.comp-card {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.comp-card h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.comp-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.comp-card code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    word-break: break-all;
}

.comp-note {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-style: italic;
}

/* Interactive Task */
.interactive-task {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}

.task-prompt {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 14px;
    background: rgba(108, 92, 231, 0.06);
    border-radius: var(--radius-md);
}

.task-prompt-icon { font-size: 1.3rem; }

.task-prompt code {
    background: rgba(108, 92, 231, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.drag-zone {
    min-height: 60px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    transition: var(--transition);
}

.drag-zone.over {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.04);
}

.drag-placeholder {
    color: var(--text-tertiary);
    font-size: 0.88rem;
}

.drag-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.drag-item {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    cursor: grab;
    transition: var(--transition);
    user-select: none;
}

.drag-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.drag-item:active { cursor: grabbing; }

.drag-item.in-zone {
    background: rgba(108, 92, 231, 0.08);
    border-color: var(--primary);
}

.task-feedback {
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    animation: fadeInUp 0.3s ease;
}

.task-feedback.correct {
    background: rgba(0, 184, 148, 0.08);
    border: 1px solid rgba(0, 184, 148, 0.2);
    color: var(--secondary);
}

.task-feedback.wrong {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--accent-red);
}

.task-actions {
    display: flex;
    gap: 10px;
}

/* Operations Grid */
.operations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.op-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.op-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

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

.op-card strong { font-size: 0.9rem; }

.op-card p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.82em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* === Mini Quiz (inside lesson) === */
.mini-quiz { margin-bottom: 20px; }

.quiz-question {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.quiz-question.active { display: block; }

.qq-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qq-num {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

.qq-xp {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary);
}

.quiz-question h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.qq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qq-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition);
}

.qq-option:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.04);
}

.qq-option.selected-correct {
    border-color: var(--secondary);
    background: rgba(0, 184, 148, 0.08);
    color: var(--secondary);
}

.qq-option.selected-wrong {
    border-color: var(--accent-red);
    background: rgba(255, 107, 107, 0.08);
    color: var(--accent-red);
}

.qq-option.show-correct {
    border-color: var(--secondary);
    background: rgba(0, 184, 148, 0.06);
}

.qq-option:disabled {
    cursor: default;
    pointer-events: none;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 32px 0;
    animation: fadeInUp 0.5s ease;
}

.quiz-result .qr-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.quiz-result h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.quiz-result p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.quiz-result .qr-xp {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 16px;
}

.qr-stars {
    margin-bottom: 24px;
}

.qr-stars .star {
    font-size: 2rem;
}

.qr-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* === QUIZ PAGE === */
.quiz-main {
    padding-top: 60px;
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-container {
    width: 100%;
    max-width: 700px;
    padding: 24px;
}

/* Quiz Timer */
.quiz-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.quiz-timer.warning { color: var(--accent-red); }

/* Start Screen */
.qss-card {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.qss-icon { font-size: 3.5rem; margin-bottom: 16px; }

.qss-card h1 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.qss-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.qss-card > p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.qss-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.qss-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qss-info-icon { font-size: 1.3rem; }

.qss-info-item strong {
    display: block;
    font-size: 1.1rem;
}

.qss-info-item span {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.qss-rules {
    text-align: left;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
}

.qss-rules h4 {
    font-size: 0.88rem;
    margin-bottom: 10px;
}

.qss-rules li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

/* Quiz Dots */
.quiz-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.quiz-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: var(--transition);
}

.quiz-dot.active {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.quiz-dot.correct { background: var(--secondary); }
.quiz-dot.wrong { background: var(--accent-red); }

/* Quiz Card */
.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-md);
    min-height: 400px;
    animation: fadeInUp 0.3s ease;
}

.qc-question-num {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    font-weight: 600;
}

.qc-question {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
}

.qc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.qc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    width: 100%;
    text-align: left;
}

.qc-option:hover { border-color: var(--primary); }

.qc-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.qc-option.selected { border-color: var(--primary); background: rgba(108, 92, 231, 0.06); }
.qc-option.correct-answer { border-color: var(--secondary); background: rgba(0, 184, 148, 0.08); }
.qc-option.wrong-answer { border-color: var(--accent-red); background: rgba(255, 107, 107, 0.08); }

.qc-option.correct-answer .qc-option-letter { background: var(--secondary); color: white; }
.qc-option.wrong-answer .qc-option-letter { background: var(--accent-red); color: white; }

.qc-explanation {
    padding: 14px 18px;
    background: rgba(108, 92, 231, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.qc-actions {
    display: flex;
    justify-content: flex-end;
}

/* Quiz Results */
.qr-card {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.qr-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.qr-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.qr-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.qr-card > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.qr-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.qr-score-ring svg { width: 100%; height: 100%; }

.qr-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.qr-score-num {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

.qr-score-of {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.qr-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.qr-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.qr-stat-icon { font-size: 1.2rem; }

.qr-stat-val {
    font-weight: 700;
    font-size: 1rem;
}

.qr-stat-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* Review */
.qr-review {
    text-align: left;
    margin-bottom: 28px;
}

.qr-review h4 {
    font-size: 1rem;
    margin-bottom: 14px;
}

.qr-review-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qr-review-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: 0.88rem;
}

.qr-review-item.correct { border-left: 3px solid var(--secondary); }
.qr-review-item.wrong { border-left: 3px solid var(--accent-red); }

.qr-review-icon { font-size: 1rem; }

.qr-review-text { flex: 1; }

.qr-actions-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* === AI HELPER === */
.ai-helper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1500;
}

.ai-helper-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    transition: var(--transition);
    position: relative;
}

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

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

.ai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-helper-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInUp 0.3s ease;
}

.ai-helper-panel.open {
    display: flex;
}

.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.ai-panel-header h4 { font-size: 0.95rem; }

.ai-panel-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0 4px;
}

.ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.ai-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.ai-input:focus { border-color: var(--primary); }

.ai-send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ai-send:hover { background: var(--primary-dark); }

.ai-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px 14px;
}

.ai-quick-questions button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    color: var(--text-secondary);
}

.ai-quick-questions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* === DASHBOARD === */
.dashboard-hero {
    background: var(--bg-secondary);
    padding: calc(var(--nav-height) + 40px) 0 40px;
    border-bottom: 1px solid var(--border);
}

.dash-profile {
    display: flex;
    gap: 32px;
    align-items: center;
}

.dash-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.dash-avatar-ring svg {
    width: 140px;
    height: 140px;
}

.dash-avatar-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
}

.dash-level-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-secondary);
}

.dash-info { flex: 1; }

.dash-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.dash-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.dash-xp-row {
    margin-bottom: 14px;
}

.dash-xp-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.dash-xp-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.dash-badges-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-badge {
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Dashboard Grid */
.dashboard-content {
    padding-top: 40px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.dash-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.daily-counter {
    margin-left: auto;
    font-size: 0.78rem;
    padding: 2px 8px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
}

/* Continue Card */
.continue-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.cc-icon { font-size: 2rem; }

.cc-info { flex: 1; }

.cc-topic {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.cc-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.cc-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-progress .progress-bar { flex: 1; }

.cc-progress span {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Stats */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.sb-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.sb-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* Heatmap */
.activity-heatmap h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.hm-cell {
    aspect-ratio: 1;
    background: var(--primary);
    border-radius: 3px;
    transition: var(--transition);
}

.hm-cell:hover { transform: scale(1.2); }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.hl-colors {
    display: flex;
    gap: 3px;
}

.hl-cell {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
}

/* Dash Stats Card spans full width */
.dash-stats-card {
    grid-column: span 2;
}

/* Achievements in dashboard */
.dash-achievements {
    grid-column: span 2;
}

.dash-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.dash-ach {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 14px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.dash-ach:hover { transform: translateY(-3px); }

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

.da-name {
    font-size: 0.82rem;
    font-weight: 700;
}

.da-desc {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.dash-ach.locked {
    opacity: 0.35;
    filter: grayscale(1);
}

/* Topics Progress */
.topics-progress-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.tp-item:hover { background: var(--bg-tertiary); }

.tp-item.locked { opacity: 0.45; }

.tp-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.tp-icon { font-size: 1.2rem; }

.tp-info h4 {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-status {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.tp-status.completed { color: var(--secondary); }
.tp-status.current { color: var(--primary); }

.tp-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 140px;
    flex-shrink: 0;
}

.tp-bar-wrapper span {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 600;
    white-space: nowrap;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.af-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.af-item:hover { background: var(--bg-secondary); }

.af-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.af-lesson { background: rgba(9, 132, 227, 0.1); }
.af-quiz { background: rgba(253, 203, 110, 0.15); }
.af-achievement { background: rgba(108, 92, 231, 0.1); }
.af-streak { background: rgba(255, 107, 107, 0.1); }

.af-content {
    flex: 1;
    min-width: 0;
}

.af-content > span:first-child {
    display: block;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.af-xp {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary);
    white-space: nowrap;
}

/* Footer Mini */
.footer-mini {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-mini .container {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.footer-mini a:hover { color: var(--primary); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .lesson-container {
        grid-template-columns: 1fr;
    }

    .lesson-sidebar {
        display: none;
    }

    .lesson-content {
        padding: 32px 24px;
    }

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

    .dash-stats-card,
    .dash-achievements {
        grid-column: auto;
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .topic-hero {
        flex-direction: column;
    }

    .topic-hero-progress-card {
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .thp-ring {
        width: 70px;
        height: 70px;
    }

    .comparison-cards {
        grid-template-columns: 1fr;
    }

    .operations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-profile {
        flex-direction: column;
        text-align: center;
    }

    .dash-badges-row {
        justify-content: center;
    }

    .ai-helper-panel {
        width: calc(100vw - 48px);
        right: -12px;
    }

    .dash-achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tp-bar-wrapper {
        width: 100px;
    }

    .qss-info {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .info-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .path-visual {
        font-size: 0.85rem;
    }

    .file-name-demo {
        padding: 20px;
    }

    .fnd-value {
        font-size: 1.3rem;
    }
}
