/* 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;
}

/* 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;
}