/* Add Category Modal Styles */

.resume-host-schedule-row {
    display: flex;
    gap: 10px;
}


#addCategoryModal .exams-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

#addCategoryModal .papers-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

.exam-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exam-card:hover {
    border-color: #8B5CF6;
    background-color: #f8fafc;
}

.exam-card.selected {
    border-color: #8B5CF6;
    background-color: #f3f4f6;
}

.exam-card .exam-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.exam-card .exam-count {
    font-size: 14px;
    color: #6b7280;
}

.paper-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.paper-item:hover {
    background-color: #f8fafc;
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.paper-item .paper-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.paper-item .paper-details {
    font-size: 12px;
    color: #6b7280;
    margin-left: 10px;
}

.selected-count {
    background-color: #8B5CF6;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

#saveCategoryBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Category Filter Active State */
.exam-list-item.active {
    background-color: #f3f4f6;
    /* border-left: 3px solid #8B5CF6; */
}

.exam-list-item.active a {
    color: #8B5CF6;
    font-weight: 600;
}

.exam-list-item.active svg path {
    fill: #8B5CF6;
}

/* Smooth transitions for category filtering */
.test-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.test-item[style*="none"] {
    opacity: 0;
    transform: scale(0.95);
}

/* Empty state styling */
.empty-state-message {
    margin-top: 2rem;
}

.empty-state-message h4 {
    color: #6b7280;
    font-weight: 500;
}

.empty-state-message p {
    color: #9ca3af;
}

/* Sub-category styling */
.sub-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f9fafb;
}

.sub-category-list li.sub-category-item {
    padding: 0;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e5e7eb;
}

.sub-category-list li.sub-category-item:first-child {
    border-top: 1px solid #e5e7eb;
}

.sub-category-list li.sub-category-item:last-child {
    border-bottom: none;
}

.sub-category-list .sub-category-filter {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 12px 8px 12px 20px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sub-category-list .sub-category-filter svg {
    flex-shrink: 0;
}

.sub-category-list .sub-category-filter:hover {
    background-color: #f3f4f6;
    color: #8B5CF6;
}

.exam-pref-remove-btn {
    flex-shrink: 0;
    align-self: stretch;
    width: 40px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.exam-pref-remove-btn:hover,
.exam-pref-remove-btn:focus-visible {
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.06);
    outline: none;
}

.exam-pref-remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.exam-pref-remove-btn--compact {
    width: auto;
    padding: 0 4px;
    align-self: center;
}

.exam-filter-mobile-item .exam-pref-remove-btn--compact {
    margin-left: 2px;
}

.exam-filter-mobile-label {
    white-space: nowrap;
}

.sub-category-list .dot {
    margin-right: 8px;
    display: inline-block;
}

/* Collapse icon animation */
.collapse-icon {
    transition: transform 0.3s ease;
}

.exam-list-item .category-filter {
    cursor: pointer;
}

.exam-list-item {
    border-bottom: 1px solid #e5e7eb;
}

.exam-list-item:last-child {
    border-bottom: none;
}

/* An exam chip trimmed away by picking it. Needs !important because the rules that show the
   exam row carry it too, and re-opening the category would otherwise bring the chip back
   before the class is cleared. */
.exam-categories .exam-filter-hidden {
    display: none !important;
}

/* Drill-down: while a category is open the strip belongs to its exams alone.
   Categories and exams used to share one horizontal row, so opening a category pushed the
   rest of them off the edge and left a half-and-half strip that read as neither. The open
   category keeps its own chip - that is the way back out - and everything else steps aside.
   Only below the desktop breakpoint, where the strip is actually cramped. */
@media (max-width: 991.98px) {
    .exam-categories.exam-categories--drilled > ul > li:not(.expanded) {
        display: none !important;
    }
}

/* Small Device Category Toggle Styles */
@media (max-width: 991.98px) {
    /* Hide subcategories by default on small devices */
    .exam-categories li.d-flex > ul {
        display: none !important;
    }

    /* Show subcategories when expanded - more specific selector to override above */
    .exam-categories li.d-flex.expanded > ul {
        display: flex !important;
    }
}

/* Large screens - show subcategories by default */
@media (min-width: 992px) {
    .exam-categories li>ul,
    .exam-categories li.d-flex > ul {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    #addCategoryModal .exams-list {
        /* display: flex; */
        gap: 10px;
    }

    .exam-card {
        min-width: 200px;
    }

    /* Horizontal scroll for categories list on small screens */
    .categories-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #8B5CF6 #f3f4f6;
    }

    .categories-list::-webkit-scrollbar {
        height: 6px;
    }

    .categories-list::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 10px;
    }

    .categories-list::-webkit-scrollbar-thumb {
        background: #8B5CF6;
        border-radius: 10px;
    }

    .categories-list::-webkit-scrollbar-thumb:hover {
        background: #7c3aed;
    }

    .categories-list .category-card,
    .categories-list .exam-card {
        flex: 0 0 auto;
        min-width: 200px;
        margin-bottom: 0;
    }
}

/* Exam Filter Dropdown Scrollable Menu */
.exam-filter-dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 300px;
}

.exam-filter-dropdown-menu .dropdown-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.year-filter-dropdown-menu {
    max-height: 260px;
    overflow-y: auto;
}

/* Filter Sidebar Scrolling (Desktop) */
.exams-list-card .exams-list {
    max-height: 283px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Dropdown Button Max-Width with Ellipsis */
#categoryFilterDropdown,
#categoryFilterDropdownMobile {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auth Modal Toggle Buttons */
.auth-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.auth-toggle-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.auth-toggle-btn:hover {
    color: #8B5CF6;
}

/* Modal Overlay Styles - For reusable user details and test code modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    /* width: 90%; */
    /* max-width: 500px; */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-overlay .modal-close:hover {
    background-color: #f0f0f0;
}

.modal-overlay .modal-body {
    padding: 24px;
}

.modal-overlay .form-group {
    margin-bottom: 20px;
}

.modal-overlay .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.modal-overlay .form-group .required {
    color: #dc3545;
}

.modal-overlay .form-group .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.modal-overlay .form-group .form-control:focus {
    outline: none;
    border-color: #702DFF;
    box-shadow: 0 0 0 3px rgba(112, 45, 255, 0.1);
}

.modal-overlay .form-group .form-control.is-invalid {
    border-color: #dc3545;
}

.modal-overlay .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.modal-overlay .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-overlay .btn-cancel,
.modal-overlay .btn-submit {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-overlay .btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-overlay .btn-cancel:hover {
    background-color: #e5e7eb;
}

.modal-overlay .btn-submit {
    background-color: #702DFF;
    color: white;
}

.modal-overlay .btn-submit:hover {
    background-color: #5a1fd9;
}

.modal-overlay .btn-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.auth-toggle-btn.active {
    color: #8B5CF6;
    border-bottom-color: #8B5CF6;
    font-weight: 600;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* Scheduled test card: icon-only edit control */
.edit-scheduled-test-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #702DFF;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-scheduled-test-btn:hover,
.edit-scheduled-test-btn:focus {
    color: #5a24cc;
    background: transparent;
    box-shadow: none;
}

.edit-scheduled-test-btn:focus-visible {
    outline: 2px solid #702DFF;
    outline-offset: 2px;
    border-radius: 4px;
}
/* Join is closed in the final 5 minutes: the button stays visible so the card does not
   jump around, but is blurred out to read as unavailable. */
.join-closed-btn,
.join-closed-btn:disabled {
    filter: blur(1.2px);
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.join-closed-note {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
    color: #b45309;
}

/* Same note on the purple hero banner - amber is unreadable there. */
.upcoming-test-card .join-closed-note {
    text-align: left;
    color: rgba(255, 255, 255, 0.85);
}

/* Group test hero heading: the page's own title, so it carries more weight than the
   shared 2xl scale gives it (21px mobile / 24px desktop). */
.tests-section-header .heading-2xl,
.tests-section-header .heading-2xl > h1 {
    font-size: 20px !important;
    line-height: 1.25;
}

/* 27px, not the shared 24px token: this is the page's own H1 and it sits above a paragraph of
   description, a filter dropdown and a purple banner, all of which are competing for the eye.
   The token stays where it is because saved questions, solution and pagetitle read it too. */
@media (min-width: 768px) {
    .tests-section-header .heading-2xl,
    .tests-section-header .heading-2xl > h1 {
        font-size: 27px !important;
    }
}

/* Desktop: breathing room between the site nav and the H1 */
@media (min-width: 992px) {
    .tests-section-header .heading-2xl {
        padding-top: 32px;
    }

    /* Signed in, the heading and description move to the top.tpl header, so this block is
       empty here - drop its gap so the banner sits right under that header */
    .tests-section-header--logged-in {
        margin-bottom: 0;
    }
}

/* The phone's exam filter row, under the hero description. Matches the Exams heading in the
   .exams-section picker so the two read as the same control in the two states the page has. */
.group-test-mobile-filter h4 {
    font-weight: 600;
    font-size: 18px;
}

/* The hero now ends on the Exams filter row rather than on a paragraph, and under it the section's
   own 1.5rem stacked with the tab container's 2rem - 56px of nothing between the filter and the
   tabs it filters. Phones only: the desktop layout has the picker in a column beside the listing,
   so that gap is doing real separating work there. */
@media (max-width: 767px) {
    .tests-section-header {
        margin-bottom: 0.75rem;
    }

    .test-tabs-container {
        margin-top: 0.75rem;
    }
}

/* Group Test FAQs, restyled to match the accordion on /group-test/category.

   The two pages sit one click apart and carry the same kind of list, so they should not look like
   two different components. The category page's version is a compact bordered row with a chevron;
   this one was a tall white card with a shadow and a yellow "Q." tile, which read as a different
   feature rather than the same one seen twice.

   Scoped to #faqAccordion, not to .accordion: Bootstrap's accordion is used elsewhere in the app
   and those screens are not part of this change. The declarations mirror .gtc-faq* in
   ../assets/css/group_test_category.css - if that file's look changes, this follows it. */
/* The gap replaces the per-item margin-bottom this used to carry, which also means the last row
   no longer pushes anything below it - and directly under this block sits the footer's gradient
   bar, so the list was ending flush against it. The space belongs to the list as a whole rather
   than to its last child. */
#faqAccordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

/* !important on the radius only, because newcutome.css sets 15px with one. */
#faqAccordion .accordion-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px !important;
    box-shadow: none;
    margin-bottom: 0;
    overflow: hidden;
}

#faqAccordion .accordion-header button {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    border-radius: 8px !important;
    justify-content: space-between;
    gap: 12px;
}

/* The tile carried no information the question did not already carry - every row is a question,
   so a mark saying so on each one is a column of identical stickers. */
#faqAccordion .faq-icon {
    display: none;
}

/* The chevron, drawn as two borders of an empty box turned 45 degrees - same as the category
   page's .gtc-faq-chevron. newcutome.css hides Bootstrap's own ::after, so this reuses it. */
#faqAccordion .accordion-button::after {
    display: inline-block;
    content: "";
    flex: 0 0 auto;
    margin-left: auto;
    padding: 3px;
    border: solid #6b7280;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    background: none;
    width: auto;
    height: auto;
}

/* Bootstrap marks the shut ones with .collapsed, so the open one is the row without it. */
#faqAccordion .accordion-button:not(.collapsed)::after {
    transform: rotate(-135deg);
}

#faqAccordion .accordion-body {
    padding: 0 16px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

/* About and FAQ headings, matched to .gtc-heading on /group-test/category (26px / 700 / centred).

   Scoped to the two sections that carry them rather than set on .section-title, because that class
   is newcutome.css's and is worn by headings all over the app - restyling it here would move
   screens that have nothing to do with this page.

   The rule/underline goes with the change: the category page separates a section from the one
   above it with space, and a centred heading sitting on a full-width line reads as a divider that
   happens to have words on it. */
.preparation-tips-section > .section-title,
.faq-section > .section-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 28px;
    padding-bottom: 0;
    border-bottom: 0;
}

/* Spacing matched to /group-test/category: the About title sits 14px over its prose, paragraphs
   are 14px apart at 1.7 leading, and the FAQ heading starts 90px below the last line - the About
   section's 34px bottom padding plus the FAQ section's 56px top padding there. */
.preparation-tips-section {
    margin-bottom: 90px;
}

/* Same column as the category page's .gtc-container-narrow: 780px centred with 20px gutters.
   At full width the prose ran 1400px+ a line, far past a comfortable reading measure. */
.preparation-tips-section,
.faq-section {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.preparation-tips-section > .section-title {
    margin-bottom: 14px;
}

.preparation-tips-section p {
    line-height: 1.7;
    margin: 0 0 14px;
}

.preparation-tips-section p:last-child,
.preparation-tips-section .group-test-about-content > :last-child {
    margin-bottom: 0;
}
