/* =========================================================
   EXAM PAGE
========================================================= */

.exam-page {
    padding: 18px;
    background: #f7f9fc;
    min-height: calc(100vh - 100px);
}


/* =========================================================
   TOP HEADER
========================================================= */

.exam-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #ffffff;

    border: 1px solid #dce5ef;
    border-radius: 8px;

    padding: 14px 18px;

    margin-bottom: 14px;
}


.exam-title {
    margin: 0;

    font-size: 18px;
    font-weight: 600;

    color: #172b4d;
}


.exam-meta {
    margin-top: 4px;

    font-size: 12px;

    color: #6c757d;
}


.exam-meta span {
    margin: 0 5px;

    color: #adb5bd;
}


/* =========================================================
   TIMER
========================================================= */

.exam-timer {
    min-width: 105px;

    text-align: center;

    font-size: 20px;
    font-weight: 700;

    color: #dc3545;

    letter-spacing: 1px;
}


/* =========================================================
   QUESTION CARD
========================================================= */

.exam-question-card {
    background: #ffffff;

    border: 1px solid #dce5ef;

    border-radius: 8px;

    padding: 20px;

    min-height: 500px;
}


/* =========================================================
   QUESTION HEADER
========================================================= */

.question-header {
    font-size: 14px;

    font-weight: 600;

    color: #172b4d;

    margin-bottom: 20px;

    padding-bottom: 10px;

    border-bottom: 1px solid #edf1f5;
}


/* =========================================================
   QUESTION TEXT
========================================================= */

.question-text {
    font-size: 16px;

    line-height: 1.7;

    font-weight: 500;

    color: #212529;

    margin-bottom: 25px;

    min-height: 70px;
}


/* =========================================================
   OPTIONS
========================================================= */

.options-list {
    display: flex;

    flex-direction: column;

    gap: 10px;

    margin-bottom: 35px;
}


.exam-option {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 12px 14px;

    border: 1px solid #dce5ef;

    border-radius: 6px;

    background: #ffffff;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}


.exam-option:hover {
    background: #f8fafc;

    border-color: #9db9d7;
}


.exam-option input {
    width: 16px;
    height: 16px;

    flex-shrink: 0;
}


.option-key {
    min-width: 25px;

    font-weight: 600;

    color: #0d6efd;
}


.option-text {
    font-size: 14px;

    color: #343a40;
}


/* =========================================================
   NAVIGATION
========================================================= */

.exam-navigation {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: auto;

    padding-top: 20px;

    border-top: 1px solid #edf1f5;
}


.exam-navigation .btn {
    min-width: 100px;
}


/* =========================================================
   QUESTION NAVIGATOR
========================================================= */

.question-navigator {
    background: #ffffff;

    border: 1px solid #dce5ef;

    border-radius: 8px;

    padding: 14px;

    position: sticky;

    top: 15px;
}


/* =========================================================
   NAVIGATOR TITLE
========================================================= */

.navigator-title {
    font-size: 13px;

    font-weight: 700;

    color: #172b4d;

    padding-bottom: 10px;

    border-bottom: 1px solid #edf1f5;

    margin-bottom: 10px;
}


/* =========================================================
   SECTION
========================================================= */

.navigator-section {
    margin-bottom: 14px;
}


.navigator-section-title {
    font-size: 11px;

    font-weight: 700;

    color: #0d6efd;

    background: #eaf3ff;

    padding: 5px 7px;

    border-radius: 4px;

    margin-bottom: 7px;
}


/* =========================================================
   QUESTION GRID
========================================================= */

.question-grid {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;
}


.question-number-btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 31px;

    height: 31px;

    border-radius: 5px;

    border: 1px solid #ced7e2;

    background: #ffffff;

    color: #526581;

    text-decoration: none;

    font-size: 11px;

    font-weight: 600;

    transition: all .15s ease;
}


.question-number-btn:hover {
    border-color: #0d6efd;

    color: #0d6efd;

    background: #f0f6ff;
}


/* =========================================================
   ANSWERED
========================================================= */

.question-number-btn.answered {
    background: #d1e7dd;

    border-color: #a3cfbb;

    color: #146c43;
}


/* =========================================================
   CURRENT
========================================================= */

.question-number-btn.current {
    background: #0d6efd;

    border-color: #0d6efd;

    color: #ffffff;
}


/*
   Current question should remain clearly visible
   even if it has already been answered.
*/

.question-number-btn.current.answered {
    background: #0d6efd;

    border-color: #0d6efd;

    color: #ffffff;
}


/* =========================================================
   NAVIGATOR SUBMIT
========================================================= */

.navigator-submit {
    margin-top: 15px;

    padding-top: 12px;

    border-top: 1px solid #edf1f5;
}


.navigator-submit .btn {
    font-size: 12px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 991px) {

    .question-navigator {
        position: static;
    }

}


@media (max-width: 767px) {

    .exam-page {
        padding: 10px;
    }


    .exam-top-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 10px;
    }


    .exam-timer {
        text-align: left;
    }


    .exam-question-card {
        padding: 14px;
    }


    .question-text {
        font-size: 15px;
    }

}
/* =========================================================
   GUEST EXAM PAGE
========================================================= */

.exam-page {
    padding: 18px;
    background: #f7f9fc;
    min-height: calc(100vh - 100px);
}

.exam-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.exam-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #172b4d;
}

.exam-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

.exam-meta span {
    margin: 0 5px;
    color: #adb5bd;
}

.exam-timer {
    min-width: 105px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #dc3545;
    letter-spacing: 1px;
}


/* QUESTION CARD */

.exam-question-card {
    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
}

.question-header {
    font-size: 14px;
    font-weight: 600;
    color: #172b4d;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf1f5;
}

.question-text {
    font-size: 16px;
    line-height: 1.7;
    font-weight: 500;
    color: #212529;
    margin-bottom: 25px;
    min-height: 70px;
}


/* OPTIONS */

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 35px;
}

.exam-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce5ef;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.exam-option:hover {
    background: #f8fafc;
    border-color: #9db9d7;
}

.exam-option input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.option-key {
    min-width: 25px;
    font-weight: 600;
    color: #0d6efd;
}

.option-text {
    font-size: 14px;
    color: #343a40;
}


/* NAVIGATION */

.exam-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #edf1f5;
    gap: 10px;
}

.exam-navigation .btn {
    min-width: 100px;
}


/* =========================================================
   QUESTION NAVIGATOR
========================================================= */

.question-navigator {
    display: flex;
    flex-direction: column;

    background: #ffffff;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    padding: 14px;

    position: sticky;
    top: 15px;

    /* Keep navigator within the screen */
    max-height: calc(70vh - 90px);

    overflow: hidden;
}


/* =========================================================
   SCROLLABLE QUESTION AREA
========================================================= */

.navigator-sections-scroll {
    flex: 1 1 auto;

    /* Important for flex scrolling */
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 5px;
}


/* Keep these sections fixed */
.navigator-title,
.exam-legend,
.navigator-submit {
    flex-shrink: 0;
}


/* =========================================================
   SCROLLBAR
========================================================= */

.navigator-sections-scroll::-webkit-scrollbar {
    width: 7px;
}

.navigator-sections-scroll::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.navigator-sections-scroll::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.navigator-sections-scroll::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}


/* Firefox */
.navigator-sections-scroll {
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f1f3f5;
}

/* Equal question buttons */

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.question-number-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ced7e2;
    background: #ffffff;
    color: #526581;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.question-number-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f6ff;
}

.question-number-btn.answered {
    background: #d1e7dd;
    border-color: #a3cfbb;
    color: #146c43;
}

.question-number-btn.current,
.question-number-btn.current.answered {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}


/* LEGEND */

.exam-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    font-size: 11px;
}


/* SUBMIT BUTTON */

.navigator-submit {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #edf1f5;
}

.navigator-submit .btn {
    width: 100%;
    font-size: 12px;
}

/* =========================================================
   QUESTION NAVIGATOR LEGEND
========================================================= */

.exam-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    font-size: 11px;
}

.exam-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Small color box */
.legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Current Question - Blue */
.legend-current {
    background: #0d6efd;
    border: 1px solid #0d6efd;
}

/* Answered Question - Green */
.legend-answered {
    background: #02502d;
    border: 1px solid #074e33cb;
}

/* RESPONSIVE */

@media (max-width: 991px) {
    .question-navigator {
        position: static;
    }
}

@media (max-width: 767px) {
    .exam-page {
        padding: 10px;
    }

    .exam-top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .exam-timer {
        text-align: left;
    }

    .exam-question-card {
        padding: 14px;
    }

    .question-text {
        font-size: 15px;
    }

    .question-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Two topics per row */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

/* Compact topic card */
.topic-box {
    min-width: 0;
    padding: 10px;
    border: 1px solid #dce5ef;
    border-radius: 6px;
    background: #fff;
}

/* Compact topic heading */
.topic-title {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf1f5;
    font-size: 13px;
    font-weight: 600;
}

/* Keep session content within each card */
.session-list {
    min-width: 0;
}

.session-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 75px;
    align-items: start;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #edf1f5;
}

.session-row:last-child {
    border-bottom: none;
}

.session-name,
.session-label-wrapper {
    min-width: 0;
}

.session-label {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.available-question-count {
    display: block;
    font-size: 11px;
}

.required-question-label {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
}

.question-count-wrapper .form-control {
    width: 100%;
}

/* Mobile: one topic per row */
@media (max-width: 575.98px) {
    .topic-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   EDIT ASSESSMENT PAGE HEADER
========================================================= */

.test-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    border-radius: 8px;
}

.test-page-header h4 {
    margin: 0;
    color: #243447;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================================
   VIEW AND BACK BUTTONS — RIGHT SIDE
========================================================= */

.test-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.test-page-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 5px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 575.98px) {
    .test-page-header {
        gap: 10px;
        padding: 12px;
    }

    .test-page-header h4 {
        font-size: 16px;
        white-space: normal;
    }

    .test-page-actions {
        gap: 6px;
    }

    .test-page-actions .btn {
        padding: 5px 8px;
        font-size: 12px;
    }
}

.test-view-page {
    max-width: 100%;
    overflow-x: hidden;
}


/* PAGE HEADER */

.test-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.test-page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}



/* =========================================================
   ASSESSMENT VIEW PAGE
========================================================= */

.test-view-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* =========================================================
   PAGE HEADER
========================================================= */

.test-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 8px;
}

.test-page-header h4 {
    margin: 0;
    color: #243447;
    font-size: 20px;
    font-weight: 600;
}

.test-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* =========================================================
   ASSESSMENT INFORMATION
========================================================= */

.test-info-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.8fr)
        minmax(0, 1.8fr)
        minmax(0, 0.7fr)
        minmax(0, 0.7fr);
    gap: 18px;
    width: 100%;
}

.test-info-item,
.test-info-name {
    min-width: 0;
}

.test-info-label {
    margin-bottom: 5px;
    color: #6b7c93;
    font-size: 12px;
    font-weight: 500;
}

.test-info-value {
    min-width: 0;
    color: #172b4d;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: normal;
}

.test-total-question {
    color: #0d6efd;
    font-size: 20px;
    font-weight: 700;
}

/* =========================================================
   DESCRIPTION
========================================================= */

.test-description-box {
    width: 100%;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5ebf2;
}

.test-description-view {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e1e8f0;
    border-radius: 6px;
    color: #172b4d;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
}

/* =========================================================
   QUESTION CONFIGURATION HEADER
========================================================= */

.question-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* =========================================================
   TECHNOLOGY / TOPIC / SESSION TABLE
========================================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.test-view-table {
    width: 100%;
    min-width: 650px;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 0;
}

/* Consistent cell alignment */

.test-view-table th,
.test-view-table td {
    padding: 10px 12px;
    vertical-align: middle;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.test-view-table thead th {
    background: #f5f8fc;
    color: #526581;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #dce5ef;
    white-space: nowrap;
}

.test-view-table tbody td {
    color: #343a40;
    font-size: 13px;
}

/* Column 1: Number */

.test-view-table th:nth-child(1),
.test-view-table td:nth-child(1) {
    width: 55px;
}

/* Column 2: Technology */

.test-view-table th:nth-child(2),
.test-view-table td:nth-child(2) {
    width: 30%;
}

/* Column 3: Topic */

.test-view-table th:nth-child(3),
.test-view-table td:nth-child(3) {
    width: 95px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* Column 4: Session */

.test-view-table th:nth-child(4),
.test-view-table td:nth-child(4) {
    width: auto;
    text-align: left;
    padding-left: 12px;
    padding-right: 12px;
}

/* Column 5: Questions */

.test-view-table th:nth-child(5),
.test-view-table td:nth-child(5) {
    width: 110px;
    text-align: center;
}

/* Topic badge */

.test-view-table td:nth-child(3) .badge {
    display: inline-block;
    max-width: 100%;
    padding: 5px 8px;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Technology and session names */

.test-view-table td:nth-child(2) .fw-semibold,
.test-view-table td:nth-child(4) .fw-semibold {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.test-view-table td small {
    display: inline-block;
    margin-top: 3px;
    font-size: 11px;
}

/* =========================================================
   QUESTION COUNT BADGES
========================================================= */

.question-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    background: #eaf3ff;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 700;
}

.total-question-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: #0d6efd;
    color: #fff;
    font-weight: 700;
}

/* Table footer */

.test-view-table tfoot th {
    padding: 12px;
    background: #f8fafc;
    border-top: 1px solid #dce5ef;
    vertical-align: middle;
}

.test-view-table tfoot th:first-child {
    text-align: right;
}

/* =========================================================
   RESPONSIVE LAYOUT
========================================================= */

@media (max-width: 992px) {
    .test-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .test-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .test-page-actions {
        width: 100%;
        margin-left: 0;
    }

    .test-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .test-info-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .test-page-header {
        padding: 12px;
    }

    .test-page-header h4 {
        font-size: 17px;
    }

    .test-page-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

