/* LuyenThi Styles - Optimized & Unified */

:root {
    --accent: #FF9800;
    --accent-2: #FFB74D;
    --accent-soft: rgba(255, 152, 0, 0.14);
    --accent-shadow: rgba(255, 152, 0, 0.28);
    --primary: #1a68ff;
    --bg-light: #f5f7fb;
    --white: #ffffff;
    --text-main: #1b1f3b;
    --text-muted: #6e7690;
    --border-color: #edf0f7;
}

.js-semester-item {
    cursor: pointer;
}
/* Common Components */
.exam-page, .exam-do-page, .exam-start-page {
    background-color: var(--bg-light);
    padding: 40px 0 60px;
}

.exam-card, .exam-do-card, .exam-sidebar-card, .exam-start-card, .uni-type-card {
    background-color: var(--white);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(15, 35, 80, 0.06);
    border: 1px solid transparent;
}

/* Tabs */
.exam-top-tabs {
    border-bottom: none;
}

    .exam-top-tabs .nav-link {
        border: none;
        border-bottom: 3px solid transparent;
        font-weight: 600;
        font-size: 1.05rem;
        color: var(--text-muted);
        padding: 10px 18px;
    }

        .exam-top-tabs .nav-link.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
            background-color: transparent;
        }

/* Sub Tabs (Bộ sách) */
.exam-sub-tabs {
    margin-top: 10px;
    border-bottom: 1px solid #e2e6f3;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
}

    .exam-sub-tabs .nav-link {
        border: none;
        border-bottom: 2px solid transparent;
        color: var(--text-muted);
        font-size: 0.95rem;
        padding: 8px 16px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .exam-sub-tabs .nav-link:hover {
            color: var(--accent);
        }

        .exam-sub-tabs .nav-link.active {
            color: var(--accent) !important;
            border-bottom-color: var(--accent) !important;
            background-color: var(--accent-soft) !important;
            font-weight: 700;
        }

/* Grade Pills & Chips */
.grade-pill, .filter-chip {
    border-radius: 999px;
    border: 1px solid #dde3f0;
    padding: 8px 20px;
    font-weight: 500;
    background-color: var(--white);
    color: var(--text-main);
    transition: all 0.2s ease;
}

    .grade-pill.active, .filter-chip.active {
        background-color: var(--accent);
        border-color: var(--accent);
        color: var(--white);
        box-shadow: 0 6px 16px var(--accent-shadow);
    }

/* Exam Items */
.exam-item, .uni-exam-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
    transition: all 0.15s ease;
}

    .exam-item:hover, .uni-exam-item:hover {
        border-color: var(--accent-2);
        box-shadow: 0 10px 25px rgba(255, 152, 0, 0.1);
        transform: translateY(-1px);
    }

.btn-exam-start {
    border-color: #dee2e6 !important;
    color: #555 !important;
    background-color: #fff;
    transition: all 0.2s;
    font-weight: 700;
}

.exam-item:hover .btn-exam-start,
.uni-exam-item:hover .btn-exam-start {
    background-color: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

.exam-item-icon, .uni-exam-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff3e0;
    color: var(--accent);
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* Hero Section */
.exam-hero {
    background: #f2f4f7;
    padding: 48px 0 56px;
    position: relative;
    overflow: hidden;
}

    .exam-hero::after {
        content: "";
        position: absolute;
        inset: -40%;
        background: radial-gradient(circle at 20% 15%, rgba(255, 152, 0, 0.12) 0%, rgba(255, 152, 0, 0) 55%);
        pointer-events: none;
    }

.exam-title {
    color: #ff6a00;
    font-weight: 800;
    font-size: clamp(28px, 3vw, 44px);
}

/* Exam Do Page Specifics */
.exam-do-page {
    background-color: var(--bg-light);
    padding: 30px 0 50px;
}

.exam-do-card {
    background: var(--white);
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 8px 24px rgba(15, 35, 80, .06);
}

.exam-do-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.exam-do-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.exam-do-note {
    background: #f5f7ff;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: .92rem;
    color: #4b5270;
    margin-bottom: 24px;
}

.exam-question-block {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    background: var(--white);
}

.eq-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

.eq-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.eq-text {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.5;
}

.eq-bookmark {
    color: #9aa3b2;
    font-size: 1.2rem;
    padding: 0;
    margin-left: auto;
    text-decoration: none;
}

.eq-bookmark.active {
    color: #f5c518;
}

.eq-type-note {
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.eq-option {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding-left: 45px;
}

.eq-option:hover {
    background-color: #f8faff;
    border-color: #cdd7ff;
}

.eq-option .form-check-input {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 18px;
    height: 18px;
}

.eq-option-label {
    font-size: 0.98rem;
    color: var(--text-main);
}

/* Sidebar */
.exam-sidebar {
    position: sticky;
    top: 20px;
}

.exam-sidebar-card {
    background: var(--white);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 35, 80, .06);
}

.es-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.es-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.es-question-map-header {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.es-question-map {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.qm-item {
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f2f4ff;
    font-size: .85rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    text-decoration: none;
    position: relative;
}

.qm-item:hover {
    background: #e8ecff;
}

.qm-item.answered {
    background: var(--primary);
    color: var(--white);
}

.qm-item.current {
    border-color: var(--primary);
    background: #e6f0ff;
    color: var(--primary);
    font-weight: 700;
}

.qm-item.current .qm-eye {
    display: block;
    position: absolute;
    right: 2px;
    top: 2px;
    font-size: 0.6rem;
}

.qm-eye, .qm-star { display: none; }

.qm-item.bookmarked {
    border: 2px dotted #f5c518;
    background: #fffbe6;
}

.qm-item.bookmarked .qm-star {
    display: inline-block;
    font-size: 0.7rem;
    color: #f5c518;
    margin-left: 2px;
}

.es-bookmark-tools .btn {
    font-size: 0.8rem;
    padding: 6px 4px;
}

#btnSubmitExam {
    background-color: #16a34a;
    border: none;
    padding: 12px;
    font-weight: 700;
    border-radius: 10px;
}

#btnSubmitExam:hover {
    background-color: #15803d;
}

.exam-sidebar-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

.exam-sidebar-note ul {
    padding-left: 15px;
}

.exam-sidebar-note li {
    margin-bottom: 5px;
}

/* Metric Boxes */
.metric {
    border-radius: 14px;
    padding: 20px 12px;
    border: 2px solid var(--border-color);
    text-align: center;
}

.metric-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

.metric-score {
    background: #f3f7ff;
    border-color: #d7e6ff;
}
.metric-score .metric-value { color: #e11d48; }

.metric-correct {
    background: #f2fff5;
    border-color: #c9f3d4;
}
.metric-correct .metric-value { color: #16a34a; }

.metric-wrong {
    background: #fff5f5;
    border-color: #ffd0d0;
}
.metric-wrong .metric-value { color: #ef4444; }

/* Exam Completed Panel */
.exam-completed-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
    background: var(--bg-light);
}

.exam-completed-card {
    width: 100%;
    max-width: 850px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(15, 35, 80, 0.08);
    padding: 40px;
    text-align: center;
}

.exam-completed-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.exam-completed-sub {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
}

.exam-completed-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.exam-completed-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Modals (Alert/Confirm) */
.modal-content {
    border-radius: 18px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 20px 24px 10px;
}

.modal-title {
    font-weight: 700;
    color: var(--text-main);
}

.modal-body {
    padding: 10px 24px 24px;
    font-size: 1.1rem;
    color: #333;
}

.modal-footer {
    padding: 0 24px 24px;
    border: none;
    display: flex;
    gap: 12px;
}

.modal-footer > button, .modal-footer > a {
    flex: 1;
    margin: 0 !important;
}

#appConfirmOk {
    background-color: #16a34a;
    border: none;
    font-weight: 600;
    padding: 10px;
    color: white;
}

#appConfirmCancel {
    border: 1px solid #9aa3b2;
    color: #6e7690;
    background-color: white;
    font-weight: 600;
    padding: 10px;
}

/* UNI PAGE SPECIFICS (Luyện thi Đại học) */
.uni-type-card {
    display: block;
    padding: 24px 20px;
    border-radius: 18px;
    background: var(--white);
    border: 1px solid #e0e5f2;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 22px rgba(15, 35, 80, 0.05);
    transition: all 0.2s ease;
    height: 100%;
}

    .uni-type-card:hover {
        border-color: var(--accent-2);
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(15, 35, 80, 0.1);
    }

    .uni-type-card.active {
        background: #ffd690 !important;
        border-color: var(--accent) !important;
    }

.uni-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(26, 104, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 16px;
}

.uni-type-card.active .uni-type-icon {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-main);
}

.uni-type-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.uni-type-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Uni Search Block */
.uni-search-wrapper {
    background: var(--white);
    border: 1px solid #e3e8f3;
    border-radius: 999px;
    padding: 8px 8px 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(35, 70, 140, 0.05);
}

    .uni-search-wrapper .search-input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 1rem;
        color: var(--text-main);
        background: transparent;
    }

    .uni-search-wrapper .search-btn {
        background: var(--accent);
        color: var(--white);
        border: none;
        padding: 10px 28px;
        border-radius: 999px;
        font-weight: 700;
        transition: background 0.2s;
    }

        .uni-search-wrapper .search-btn:hover {
            background: #f58700;
        }

/* Flying books */
.exam-fly {
    position: absolute;
    top: 6px;
    width: 210px;
    max-width: 32vw;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.exam-heading, .exam-cards {
    position: relative;
    z-index: 2;
}

.exam-fly-left {
    left: -20px;
}

.exam-fly-right {
    right: -20px;
    transform: scaleX(-1);
}

@media (max-width: 576px) {
    .exam-fly {
        opacity: .35;
        width: 160px;
        top: 0;
    }

    .exam-fly-left {
        left: -40px;
    }

    .exam-fly-right {
        right: -40px;
    }
}
