/* ============================================================
   QUESTION BANK PAGE
   ============================================================ */

.question-bank-page {
    width: 100%;
    min-height: calc(100vh - 92px);
    background: #f8fafc;
    box-sizing: border-box;
}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.question-bank-header {
    width: calc(100% - 40px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 64px 0 42px;
    box-sizing: border-box;
}

.page-eyebrow {
    margin-bottom: 10px;
    color: #0f766e;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.4px;
    line-height: 20px;
}

.question-bank-header h1 {
    margin: 0;
    color: #0f172a;
    font-family: "Poppins", sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
}

.question-bank-header p {
    max-width: 720px;
    margin: 14px 0 0;
    color: #64748b;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 27px;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.question-bank-content {
    width: calc(100% - 40px);
    max-width: 1440px;
    margin: 0 auto;
    padding-bottom: 80px;
    box-sizing: border-box;
}


/* ============================================================
   SEARCH
   ============================================================ */

.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 22px;
}

.search-container input {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 50px;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 400;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-container input::placeholder {
    color: #94a3b8;
}

.search-container input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.8;
    pointer-events: none;
}


/* ============================================================
   SECTION TABS
   ============================================================ */

.section-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
    display: none;
}

.section-tab {
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.section-tab:hover {
    border-color: #99b8b5;
    color: #0f766e;
}

.section-tab.active {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}


/* ============================================================
   FILTERS
   ============================================================ */

.filters-row {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(180px, 1fr)
        minmax(180px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-group label {
    color: #334155;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 19px;
}

.filter-group select {
    width: 100%;
    height: 46px;
    padding: 0 38px 0 13px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    outline: none;
    background-color: #ffffff;
    color: #334155;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 500;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filter-group select:hover {
    border-color: #b6c8d5;
}

.filter-group select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}


/* ============================================================
   REVIEW FILTER
   ============================================================ */

.review-filter {
    display: flex;
    align-items: center;
    min-height: 40px;
    margin-bottom: 25px;
}

.review-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    user-select: none;
}

.review-checkbox input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.custom-checkbox {
    position: relative;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    box-sizing: border-box;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.review-checkbox input:checked + .custom-checkbox {
    border-color: #0f766e;
    background: #0f766e;
}

.review-checkbox input:checked + .custom-checkbox::after {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    content: "";
    transform: rotate(45deg);
}


/* ============================================================
   RESULTS HEADER
   ============================================================ */

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-bottom: 16px;
}

.results-header > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.results-header strong {
    color: #0f172a;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
}

.results-header span {
    color: #94a3b8;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
}


/* ============================================================
   QUESTION LIST
   ============================================================ */

.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* ============================================================
   QUESTION CARD
   ============================================================ */

.question-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 22px 92px;
    align-items: center;
    column-gap: 18px;
    min-height: 128px;
    padding: 20px 22px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.question-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}


/* ============================================================
   QUESTION NUMBER
   ============================================================ */

.question-card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
}


/* ============================================================
   QUESTION MAIN
   ============================================================ */

.question-card-main {
    min-width: 0;
}

.question-card-top {
    display: flex;
    align-items: center;
    min-height: 20px;
    margin-bottom: 7px;
}

.question-card-topic {
    overflow: hidden;
    color: #0f766e;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-card-description {
    display: -webkit-box;
    max-width: 900px;
    overflow: hidden;
    color: #1e293b;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.question-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.question-meta-tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    font-family: "Poppins", sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    box-sizing: border-box;
}

.question-meta-tag.difficulty-easy {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.question-meta-tag.difficulty-medium {
    border-color: #fde68a;
    background: #fffbeb;
    color: #a16207;
}

.question-meta-tag.difficulty-hard {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}


/* ============================================================
   REVIEW STAR
   ============================================================ */

.question-card-review {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    color: #eab308;
    font-size: 18px;
    line-height: 22px;
}


/* ============================================================
   PERFORMANCE INDICATOR
   ============================================================ */

.question-card-performance {
    display: flex;
    align-items: center;
    justify-content: center;
}

.performance-indicator {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-sizing: border-box;
}

.performance-indicator.first-correct {
    border: 2px solid #22c55e;
    background: #22c55e;
}

.performance-indicator.second-correct {
    border: 2px solid #22c55e;
    background:
        linear-gradient(
            to right,
            #22c55e 0%,
            #22c55e 50%,
            #ef4444 50%,
            #ef4444 100%
        );
}

.performance-indicator.later-correct {
    border: 2px solid #ef4444;
    background: #ef4444;
}

.performance-indicator.unanswered {
    border: 2px solid #cbd5e1;
    background: #ffffff;
}

.performance-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    transform: translate(-50%, -50%);
}


/* ============================================================
   PRACTICE BUTTON
   ============================================================ */

.practice-button {
    width: 92px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #0f766e;
    border-radius: 8px;
    background: #0f766e;
    color: #ffffff;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.practice-button:hover {
    border-color: #115e59;
    background: #115e59;
}

.practice-button:active {
    transform: translateY(1px);
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 50px 25px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
    box-sizing: border-box;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #f1f5f9;
}

.empty-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state h2 {
    margin: 0;
    color: #334155;
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 27px;
}

.empty-state p {
    max-width: 520px;
    margin: 8px 0 0;
    color: #94a3b8;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 21px;
}


/* ============================================================
   LOADING STATE
   ============================================================ */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #64748b;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbe3ec;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: question-bank-spin 0.75s linear infinite;
}

@keyframes question-bank-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 950px) {

    .question-bank-header {
        padding-top: 48px;
        padding-bottom: 34px;
    }

    .question-bank-header h1 {
        font-size: 36px;
    }

    .filters-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-group:first-child {
        grid-column: 1 / -1;
    }

    .question-card {
        grid-template-columns: 48px minmax(0, 1fr) 22px 88px;
        column-gap: 14px;
        padding: 18px;
    }

}


@media (max-width: 700px) {

    .question-bank-header {
        width: calc(100% - 30px);
        padding-top: 38px;
        padding-bottom: 28px;
    }

    .question-bank-content {
        width: calc(100% - 30px);
    }

    .question-bank-header h1 {
        font-size: 31px;
    }

    .question-bank-header p {
        font-size: 14px;
        line-height: 24px;
    }

    .filters-row {
        grid-template-columns: 1fr;
    }

    .filter-group:first-child {
        grid-column: auto;
    }

    .question-card {
        grid-template-columns: 42px minmax(0, 1fr) 20px;
        column-gap: 12px;
        row-gap: 14px;
        padding: 16px;
    }

    .question-card-number {
        width: 38px;
        height: 38px;
        font-size: 11px;
    }

    .question-card-main {
        grid-column: 2;
    }

    .question-card-performance {
        grid-column: 3;
        grid-row: 1;
    }

    .question-card-review {
        position: absolute;
        top: 17px;
        right: 48px;
    }

    .practice-button {
        grid-column: 2 / 4;
        width: 100%;
        height: 42px;
    }

}


@media (max-width: 480px) {

    .question-bank-header {
        width: calc(100% - 24px);
    }

    .question-bank-content {
        width: calc(100% - 24px);
    }

    .question-bank-header h1 {
        font-size: 28px;
    }

    .section-tab {
        padding-left: 14px;
        padding-right: 14px;
        font-size: 13px;
    }

    .question-card-description {
        font-size: 13px;
        line-height: 20px;
    }

    .question-card-meta {
        gap: 5px;
    }

    .question-meta-tag {
        font-size: 9px;
    }

}
