* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #17191c;
    --muted: #727780;
    --border: #e7e9ed;
    --primary: #20242a;
    --success: #16794b;
    --danger: #bd3434;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.page {
    max-width: 1180px;
    margin: auto;
    padding: 46px 28px 120px;
}

.hero {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--muted);
}

h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -1.5px;
}

.muted,
.page-header p {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin: 9px 0 4px;
}

.correct strong {
    color: var(--success);
}

.wrong strong {
    color: var(--danger);
}

.quick-actions {
    margin: 20px 0 42px;
}

.primary-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.action-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.12);
}

.primary-action strong,
.primary-action small {
    display: block;
}

.primary-action small {
    margin-top: 4px;
    opacity: .65;
}

.arrow {
    margin-left: auto;
    font-size: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading a,
.back-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.subject-card {
    min-height: 104px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    transition: .18s ease;
}

.subject-card:hover {
    transform: translateY(-2px);
    border-color: #c9cdd3;
    box-shadow: 0 8px 24px rgba(0,0,0,.05);
}

.folder-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f0f1f3;
    font-weight: 800;
}

.subject-info h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.subject-info p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.subject-arrow {
    margin-left: auto;
    color: var(--muted);
}

.page-header {
    margin: 22px 0 28px;
}

.empty-state {
    background: white;
    border: 1px dashed #ccd0d5;
    border-radius: 20px;
    padding: 60px 25px;
    text-align: center;
}

.empty-icon {
    width: 52px;
    height: 52px;
    margin: auto auto 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f0f1f3;
    font-size: 25px;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 500px;
    margin: auto;
    color: var(--muted);
    line-height: 1.6;
}

.bottom-nav {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    padding: 7px;
    background: rgba(25,27,31,.96);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
    z-index: 100;
}

.bottom-nav a {
    min-width: 90px;
    padding: 9px 14px;
    color: #d4d5d7;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    border-radius: 12px;
}

.bottom-nav span {
    display: block;
    font-size: 18px;
    margin-bottom: 3px;
}

.bottom-nav a:hover {
    background: rgba(255,255,255,.1);
    color: white;
}

@media (max-width: 800px) {

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

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

    .page {
        padding: 30px 16px 115px;
    }

    .topbar {
        padding: 0 16px;
    }

    .bottom-nav {
        width: calc(100% - 20px);
        bottom: 10px;
        justify-content: space-around;
    }

    .bottom-nav a {
        min-width: 0;
        flex: 1;
        padding: 8px 3px;
    }
}

.primary-action {
    position: relative;
}

.start-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
}



/* =========================
   MCQ PRACTICE
========================= */

.practice-shell {
    max-width: 900px;
    margin: auto;
}

.practice-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.question-counter {
    color: var(--muted);
    font-size: 14px;
}

.question-counter strong {
    color: var(--text);
}

.progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    background: #e5e7ea;
    border-radius: 20px;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: #20242a;
    border-radius: inherit;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

.question-meta > div:first-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-badges {
    display: flex;
    gap: 7px;
}

.difficulty-badge,
.high-yield-badge {
    padding: 6px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
}

.high-yield-badge {
    color: #9a6811;
}

.question-card-main {
    padding: 36px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
}

.concept-label {
    display: flex;
    gap: 9px;
    margin-bottom: 17px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.concept-label strong {
    color: var(--text);
}

.question-text {
    max-width: 800px;
    margin-bottom: 30px;
    font-size: clamp(22px, 3vw, 31px);
    line-height: 1.35;
    letter-spacing: -.6px;
}

.options-list {
    display: grid;
    gap: 12px;
}

.option-button {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: white;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: .15s ease;
}

.option-button:hover:not(:disabled) {
    border-color: #aeb3ba;
    transform: translateY(-1px);
}

.option-button.selected {
    border-color: #20242a;
    background: #f5f6f7;
}

.option-letter {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: grid;
    place-items: center;
    background: #f0f1f3;
    border-radius: 11px;
    font-weight: 800;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

.option-state {
    font-size: 22px;
    font-weight: 900;
}

.option-button.correct-option {
    border-color: #15915b;
    background: #f0faf5;
}

.option-button.correct-option
.option-letter {
    background: #15915b;
    color: white;
}

.option-button.wrong-option {
    border-color: #d44747;
    background: #fff5f5;
}

.option-button.wrong-option
.option-letter {
    background: #d44747;
    color: white;
}

.hint-panel {
    margin-top: 20px;
    padding: 18px 20px;
    background: #fff9e9;
    border: 1px solid #f0d78e;
    border-radius: 15px;
}

.hint-title {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hint-panel p {
    margin: 9px 0 0;
    line-height: 1.6;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
}

.secondary-button,
.check-button {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 13px;
    font-weight: 800;
    cursor: pointer;
}

.secondary-button {
    background: white;
    border: 1px solid var(--border);
}

.check-button {
    min-width: 180px;
    border: 0;
    background: #20242a;
    color: white;
}

.check-button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.result-panel {
    margin-top: 20px;
    padding: 30px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.result-status-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 900;
}

.correct-result
.result-status-icon {
    background: #e5f7ed;
    color: #11834e;
}

.wrong-result
.result-status-icon {
    background: #fdeaea;
    color: #c73434;
}

.result-status span,
.result-status strong {
    display: block;
}

.result-status span {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
}

.correct-result span {
    color: #11834e;
}

.wrong-result span {
    color: #c73434;
}

.result-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.result-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.result-section p {
    margin: 0;
    line-height: 1.75;
}

.learning-box {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding: 18px;
    border-radius: 15px;
    background: #f6f7f8;
}

.learning-icon {
    font-size: 23px;
}

.learning-box strong {
    font-size: 12px;
}

.learning-box p {
    margin: 7px 0 0;
    line-height: 1.6;
}

.memory-box {
    background: #f1f7ff;
}

.trap-box {
    background: #fff5f2;
}

.clue-box {
    background: #f4f8f1;
}

.next-area {
    margin-top: 25px;
}

.next-button {
    width: 100%;
    min-height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 22px;
    background: #20242a;
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
}


@media (max-width: 700px) {

    .question-card-main,
    .result-panel {
        padding: 22px 17px;
        border-radius: 18px;
    }

    .question-meta {
        display: block;
    }

    .meta-badges {
        margin-top: 12px;
    }

    .question-actions {
        display: grid;
    }

    .check-button,
    .secondary-button {
        width: 100%;
    }

}

.history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 22px 0 45px;
}

.history-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    text-decoration: none;
}

.history-action h2 {
    margin: 5px 0;
}

.history-action p {
    margin: 0;
    color: var(--muted);
}

.correct-history {
    border-left: 4px solid #168454;
}

.wrong-history {
    border-left: 4px solid #c53c3c;
}

.progress-heading {
    margin-top: 15px;
}

.performance-list {
    display: grid;
    gap: 12px;
}

.performance-card {
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;
}

.performance-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.performance-top small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.accuracy-track {
    height: 7px;
    margin: 15px 0 10px;
    background: #eceef0;
    border-radius: 20px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background: #20242a;
}

.performance-numbers {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 12px;
}

.history-question-list {
    display: grid;
    gap: 12px;
}

.history-question-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;
    color: var(--text);
    text-decoration: none;
}

.history-status {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 900;
}

.history-status.correct {
    background: #e5f7ed;
    color: #11834e;
}

.history-status.wrong {
    background: #fdeaea;
    color: #c73434;
}

.history-question-content {
    flex: 1;
}

.history-path {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.history-question-content h3 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.5;
}

.history-question-content small {
    color: var(--muted);
}

.pagination-wrap {
    margin-top: 25px;
}

@media(max-width:700px) {
    .history-actions {
        grid-template-columns: 1fr;
    }

    .history-question-card {
        align-items: flex-start;
    }
}


/* SMART REVISION */

.revision-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 42px;
}

.revision-stat {
    padding: 22px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.revision-stat span,
.revision-stat small {
    display: block;
}

.revision-stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.revision-stat strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 30px;
}

.revision-stat small {
    color: var(--muted);
}

.weak-stat strong {
    color: #c53c3c;
}

.mastered-stat strong {
    color: #168454;
}

.revision-heading {
    margin-top: 32px;
}

.revision-list {
    display: grid;
    gap: 12px;
}

.revision-card {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    transition: .15s ease;
}

.revision-card:hover {
    transform: translateY(-1px);
    border-color: #c6c9ce;
}

.mastery-indicator {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 900;
}

.mastery-weak {
    background: #fdeaea;
    color: #bd3434;
}

.mastery-new {
    background: #f0f1f3;
}

.mastery-learning {
    background: #fff4d9;
    color: #9b6b00;
}

.mastery-improving {
    background: #eaf2ff;
    color: #3169a8;
}

.mastery-mastered {
    background: #e5f7ed;
    color: #168454;
}

.revision-content {
    flex: 1;
}

.revision-path {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.revision-content h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.revision-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

.mastery-label {
    padding: 3px 8px;
    border-radius: 20px;
    background: #f0f1f3;
    font-weight: 800;
}

.mastery-label.weak {
    background: #fdeaea;
    color: #bd3434;
}

.mastery-label.mastered {
    background: #e5f7ed;
    color: #168454;
}

@media(max-width:700px) {

    .revision-summary {
        grid-template-columns: 1fr;
    }

    .revision-card {
        align-items: flex-start;
    }

}
