/* ── Exams hub & two-level tile UI ──────────────────────── */

.exams-hub {
    padding: 0.1rem 1rem 4rem;
    min-height: 60vh;
    background: #f8fafc;
}

.exams-hub-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Small gap to separate sticky site header from exams hero when rendered near top */
.exams-hub-container>.exams-hub-header,
.exams-hub-container>.exams-group-header {
    margin-top: 1.2rem;
}

/* ── Page header ────────────────────────────────────────── */
.exams-hub-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.exams-hub-header-icon {
    font-size: 3rem;
    color: #20c997;
    line-height: 1;
    flex-shrink: 0;
}

.exams-hub-header h1 {
    margin: 0 0 0.3rem;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: #1a1a2e;
    line-height: 1.1;
}

.exams-hub-header p {
    margin: 0;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.6;
}

/* ── Group detail header ────────────────────────────────── */
.exams-group-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.exams-group-header-icon {
    font-size: 2.5rem;
    color: #20c997;
    line-height: 1;
    flex-shrink: 0;
}

.exams-group-header h1 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: #1a1a2e;
}

.exams-group-header p {
    margin: 0;
    color: #4b5563;
}

/* ── Search ─────────────────────────────────────────────── */
.exams-search {
    margin-bottom: 2rem;
}

.exams-search input {
    width: 100%;
    max-width: 420px;
    padding: 0.65rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.exams-search input:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.12);
}

/* ── Section ────────────────────────────────────────────── */
.exams-section {
    margin-bottom: 3rem;
}

.exams-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e8ecf0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Tile grid ──────────────────────────────────────────── */
.exams-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ── Group tile (hub level) ─────────────────────────────── */
.exam-group-tile {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.exam-group-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.11);
    border-color: #20c997;
    text-decoration: none;
    color: inherit;
}

.exam-group-tile-icon {
    font-size: 2.25rem;
    color: #20c997;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.exam-group-tile-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.exam-group-tile-desc {
    color: #4b5563;
    font-size: 0.875rem;
    margin: 0;
    flex: 1;
    line-height: 1.6;
}

.exam-group-tile-footer {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.exam-group-tile-count {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.exam-group-tile-tag {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
}

/* ── Set tile (group-detail level) ──────────────────────── */
.exam-set-tile {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.exam-set-tile--completed {
    border-color: #b7ebcd;
    background: linear-gradient(180deg, #f4fbf6 0%, #ffffff 72%);
}

.exam-set-tile--inprogress {
    border-color: #f3cf8e;
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 10px 30px rgba(243, 207, 142, 0.04);
    background: #ffffff;
}

.exam-set-tile--inprogress .exam-set-progress-pill {
    background: #fff7e6;
    border-color: #f3cf8e;
    color: #9a5b00;
}

.exam-set-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    border-color: #20c997;
    text-decoration: none;
    color: inherit;
}

.exam-set-tile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.exam-set-tile-badge {
    background: #eff9f0;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.exam-set-progress-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.exam-set-tile--completed .exam-set-progress-pill {
    background: #e8f7ee;
    color: #166534;
    border-color: #b7ebcd;
}

.exam-set-tile-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.exam-set-tile-desc {
    color: #4b5563;
    font-size: 0.85rem;
    margin: 0;
    flex: 1;
    line-height: 1.55;
}

.exam-set-tile-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.exam-set-tile-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── Detail page badges ─────────────────────────────────── */

/* ── Tag pills ──────────────────────────────────────────── */
.exams-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
}

.exams-tag-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
    line-height: 1.4;
}

.exams-tag-pill:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.exams-tag-pill.active {
    background: #20c997;
    color: #fff;
    border-color: #20c997;
}

/* ── Empty state ────────────────────────────────────────── */
.exams-empty {
    color: #6b7280;
    font-style: italic;
    padding: 1rem 0;
}

/* ── Completed-quiz modal overlay ───────────────────────── */
.quiz-completed-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: overlayFadeIn 0.18s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.quiz-completed-modal {
    background: #fff;
    border-radius: 20px;
    padding: 2.25rem 2rem 1.75rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    text-align: center;
    animation: modalSlideUp 0.22s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quiz-completed-modal-icon {
    font-size: 3rem;
    color: #20c997;
    line-height: 1;
    margin-bottom: 0.85rem;
}

.quiz-completed-modal h3 {
    margin: 0 0 0.6rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.quiz-completed-modal p {
    margin: 0 0 1.5rem;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}

.quiz-completed-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-completed-btn-primary {
    background: #20c997;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease;
}

.quiz-completed-btn-primary:hover {
    background: #17a589;
    transform: translateY(-1px);
}

.quiz-completed-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}

.quiz-completed-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .exams-hub {
        padding: 1.5rem 0.75rem 3rem;
    }

    .exams-tiles-grid {
        grid-template-columns: 1fr;
    }

    .exams-hub-header,
    .exams-group-header {
        flex-direction: column;
        gap: 0.75rem;
    }
}