/* Teacher Portal Styles */

:root {
    --primary-color: #127ae0;
    --primary-hover: #0f6bc7;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #f6f8fa;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Main Layout */
body {
    font-family: Arial, sans-serif;
    background-color: #f6f8fa;
}


.main-content {
    padding: 1rem 0;
    background: #f6f8fa;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Header (navbar) minimal avatar-only layout */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand .logo {
    height: 32px;
    width: auto;
    border-radius: 22%;
}

.nav-brand .brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.profile-link:hover .user-avatar {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.avatar-management {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.avatar-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.avatar-actions .btn {
    width: fit-content;
}

.avatar-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}



/* Portal Header */
.portal-header {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-content h1 i {
    color: var(--primary-color);
}

.header-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

.quick-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}


/* Action Section */
.action-section {
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    min-height: 44px;
}

.btn-primary {
    background: #127ae0;
    color: white;
    font-family: Arial, sans-serif;
    border-color: transparent;
}

.btn-primary:hover {
    background: #0f6bc7;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-family: Arial, sans-serif;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #127ae0;
    border: 2px solid #127ae0;
    font-family: Arial, sans-serif;
}

.btn-outline:hover {
    background: #127ae0;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}



/* Loading state for buttons */
.btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Quick Links Section */
.quick-links-section {
    margin-bottom: 2rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.quick-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 122, 224, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-link-card:hover::before {
    opacity: 1;
}

.quick-link-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--text-primary);
}

.quick-link-card:hover .quick-link-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 25px rgba(18, 122, 224, 0.4);
}

.quick-link-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: #127ae0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(18, 122, 224, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.quick-link-icon i {
    font-size: 1.25rem;
    color: white;
}

.quick-link-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-link-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Classes Section */
.classes-section {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.section-header h2 i {
    color: var(--primary-color);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-primary);
}

/* Classes Container */
.classes-container {
    min-height: 300px;
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.classes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Class Card */
.class-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #127ae0;
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

.class-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(18, 122, 224, 0.05), transparent);
    transition: left 0.6s ease;
}

.class-card:hover::after {
    left: 100%;
}

.class-card:hover {
    border-color: #127ae0;
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-direction: column;
    gap: 0.5rem;
}

.class-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.class-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    align-self: flex-end;
}

.class-subject {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.class-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.class-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.class-meta-item i {
    width: 16px;
    color: var(--primary-color);
}

.class-id {
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
    border: 1px dashed var(--border-color);
}

.class-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.class-stat {
    text-align: center;
    flex: 1;
}

.class-stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.class-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


.class-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
}

.class-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.class-stat i {
    width: 16px;
    color: var(--primary-color);
    text-align: center;
}

.class-card .class-id {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.class-id-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-class-id-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.copy-class-id-btn:hover,
.copy-class-id-btn:focus {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    outline: none;
}

.copy-class-id-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.class-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

.class-actions .btn {
    flex: 1 1 45%;
    justify-content: center;
    min-width: 140px;
}

@media (max-width: 640px) {
    .class-actions .btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}


/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
    /* Span all grid columns */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.loading-state .loading-spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.loading-state .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 400px;
}

/* When empty state or loading state is present, override grid layout */
.classes-container:has(.empty-state),
.classes-container:has(.loading-state) {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

/* Fallback for browsers that don't support :has() */
.classes-container.show-empty-state,
.classes-container.show-loading-state {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.empty-state .empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
}

/* Links */
a {
    color: #127ae0;
    font-family: Arial, sans-serif;
    text-decoration: none;
}

a:hover {
    color: #0f6bc7;
    text-decoration: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2400;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff !important;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2401;
    padding: 32px;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 24px;
    }
}

.modal-content.large {
    max-width: 1000px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

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

.modal-header {
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border-radius: 0;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h2 i {
    color: var(--primary-color);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-size: 1.25rem;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(15, 23, 42, 0.12);
    /* NO transform or rotation */
}

.modal-body {
    padding: 0;
    background: transparent;
    position: relative;
    color: var(--text-primary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #fff;
    padding: 0 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
    width: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-actions {
    padding: 0;
    padding-top: 1.5rem;
    border-top: none;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: transparent;
    border-radius: 0;
    margin-top: 1.5rem;
}

/* Quick Create Modal specific smaller form spacing */
#quickCreateClassModal .modal-form .form-group {
    margin: 0;
}

/* Tabs */
.class-details-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Test Generation Steps */
.generation-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.step.active:not(:last-child)::after {
    background: var(--primary-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step.active .step-title {
    color: var(--primary-color);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area input[type="file"] {
    display: none;
}

/* Content Input Methods */
.content-input-methods {
    margin-bottom: 1rem;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

.content-method-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.method-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-btn.active,
.method-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-primary);
}

/* Progress Animation */
.progress-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.ai-brain {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: brainPulse 2s infinite;
}

@keyframes brainPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.brain-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    opacity: 0;
    animation: waveExpand 2s infinite;
}

.brain-wave:nth-child(2) {
    animation-delay: 0.7s;
}

.brain-wave:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes waveExpand {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-step {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--primary-color);
    color: white;
    transform: translateX(10px);
}

/* Test Editor */
.test-editor {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.editor-toolbar {
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.questions-editor {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Question Editor */
.question-editor {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: 600;
    color: var(--primary-color);
}

.question-actions {
    display: flex;
    gap: 0.5rem;
}

.question-actions .btn-icon {
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color-light);
    cursor: pointer;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    width: 2.25rem;
}

.question-actions .btn-icon:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: var(--text-color);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.1));
}

.question-actions .btn-icon .fas {
    font-size: 0.95rem;
}

.question-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* AI Edit Interface */
.ai-edit-interface {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.current-question {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ai-suggestions {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.suggestions-list {
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

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

/* Additional Component Styles */

/* File Upload Components */
.uploaded-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Class Overview Styles */
.class-overview-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.overview-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-section h4 i {
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.class-id-display {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: var(--success-color);
    color: white;
}

.status-badge.inactive {
    background: var(--text-muted);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}


.class-description {
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.class-description-preview {
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.section-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.section-header .section-actions {
    margin-top: 0;
}

.section-actions .btn {
    font-size: 0.9rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pill i {
    font-size: 0.875rem;
}

.status-pill-open {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
}

.status-pill-closed {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error-color);
}

.status-pill-invitation {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
}

.section-hint {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.description-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.description-editor textarea {
    width: 100%;
    min-height: 160px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.description-editor textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.description-editor textarea:disabled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.description-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.description-char-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.description-char-count.over-limit {
    color: var(--error-color);
}

.description-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.description-buttons {
    display: flex;
    gap: 0.5rem;
}

.unsaved-indicator {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--warning-color);
}

.description-preview-box {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.description-preview-box h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.description-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Question Editor Styles */
.option-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-input input[type="radio"] {
    margin: 0;
}

.option-text {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.expected-answer {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
}

/* Students Management */
.students-header,
.tests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tests-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-width: min(320px, 100%);
}

.students-header h3,
.tests-header h3,
.tests-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.test-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.test-actions .btn {
    height: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.test-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.test-search,
.test-status-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
}

.test-search i,
.test-status-filter i {
    color: var(--text-muted);
}

.test-search input,
.test-status-filter select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 160px;
}

.test-search input::placeholder {
    color: var(--text-muted);
}

.test-status-filter select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 1rem;
    cursor: pointer;
}

.test-status-filter {
    position: relative;
}

.test-status-filter::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.test-search:focus-within,
.test-status-filter:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

.test-search input {
    flex: 1;
    min-width: 180px;
}

.students-list,
.tests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}


/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    min-width: 300px;
    max-width: 500px;
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty States */
.empty-state-small {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state-small i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Form Validation */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Drag and Drop States */
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.upload-area.processing {
    opacity: 0.7;
    pointer-events: none;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Navbar responsive styles */
    .nav-container {
        padding: 0 1rem;
    }

    .nav-brand .brand-name {
        font-size: 16px;
    }

    .nav-brand .logo {
        height: 28px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .portal-header {
        flex-direction: column;
        text-align: center;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .quick-stats {
        justify-content: center;
    }

    .classes-grid {
        grid-template-columns: 1fr;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .quick-link-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .quick-link-icon {
        width: 50px;
        height: 50px;
    }


    .classes-section {
        padding: 1.5rem;
    }

    .class-card {
        padding: 1.5rem;
    }

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

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .generation-steps {
        flex-direction: column;
        gap: 1rem;
    }

    .step:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 480px) {

    /* Extra small screens navbar adjustments */
    .nav-container {
        padding: 0 0.5rem;
        height: 60px;
    }

    .nav-brand .brand-name {
        font-size: 14px;
    }

    .nav-brand .logo {
        height: 24px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .main-content {
        margin-top: 70px;
    }

    .container {
        padding: 0 0.5rem;
    }

    .portal-header,
    .classes-section {
        padding: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .setting-control {
        width: 100%;
        justify-content: space-between;
    }

    .form-control {
        min-width: 120px;
    }
}

/* Class Settings */
.class-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.setting-info {
    flex: 1;
}

.setting-info h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.setting-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 180px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.status-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success-color);
}

.class-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.class-link:hover {
    text-decoration: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--success-color);
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

/* Enhanced Footer Styles - Match public footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 60px 0 20px;
    margin-top: 0;
    position: relative;
    width: 100%;
    max-width: 100%;
}

body.has-sidebar .footer {
    width: 100%;
    max-width: 100%;
}

.footer .container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand .logo {
    height: 32px;
    width: auto;
    border-radius: 22%;
}

.footer-brand .brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #f9fafb;
}

.footer-column a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
    margin: 0;
}

/* Teacher Management Styles */
.teacher-management .setting-item {
    border-bottom: none;

}

.add-teacher-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.add-teacher-form .form-control {
    min-width: 200px;
    flex: 1;
}

.add-teacher-form .btn {
    white-space: nowrap;
}

.content-source-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.content-source-option {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.import-from-image-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.import-from-image-area i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.import-from-image-area h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.import-from-image-area p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Table Styles */
.import-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.import-option {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.import-option:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.import-option h3 {
    margin-top: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.import-option p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.students-table-container,
.tests-table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.students-table,
.tests-table {
    width: 100%;
    border-collapse: collapse;
}

.students-table thead,
.tests-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.students-table th,
.tests-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0.05em;
}

.students-table td,
.tests-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.students-table tbody tr:hover,
.tests-table tbody tr:hover {
    background: var(--bg-secondary);
}

.students-table tbody tr:last-child td,
.tests-table tbody tr:last-child td {
    border-bottom: none;
}

.students-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.students-pagination .pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.students-pagination .btn {
    min-width: 130px;
}

.loading-row {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile lists - hidden on desktop */
.mobile-students-list,
.mobile-tests-list {
    display: none;
}

/* Mobile card layouts */
.mobile-student-card,
.mobile-test-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.mobile-student-card:hover,
.mobile-test-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.mobile-student-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.mobile-student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    background: var(--bg-tertiary);
}

.mobile-student-info {
    width: 100%;
}

.mobile-student-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.mobile-student-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.mobile-student-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.mobile-student-actions {
    display: flex;
    justify-content: center;
}

.mobile-test-header {
    margin-bottom: 0.75rem;
}

.mobile-test-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mobile-test-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.mobile-test-status.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.mobile-test-status.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.mobile-test-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}

.mobile-test-actions .btn,
.mobile-student-actions .btn {
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure buttons wrap text on very small screens */
@media (max-width: 360px) {

    .mobile-test-actions .btn,
    .mobile-student-actions .btn {
        white-space: normal;
        text-align: center;
    }
}

/* Student Profile Styles */
.student-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.student-info {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.student-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Action Buttons */
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: Arial, sans-serif;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info-color);
    color: white;
    border: none;
}

.btn-info:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
}

/* Test Status Toggle */
.test-status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s ease;
    border-radius: 999px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-label.active {
    color: var(--success-color);
}

.status-label.inactive {
    color: var(--text-muted);
}

/* Import Modal */
.import-modal-intro {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.import-modal-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 1.5rem;
}

.import-column h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.import-classes-list,
.import-tests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.import-empty-state {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.import-empty-state i {
    font-size: 1.75rem;
    color: var(--text-muted);
}

.import-class-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.import-class-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.import-class-item.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow-sm);
}

.import-class-item h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.import-class-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.import-class-meta i {
    color: var(--primary-color);
}

.import-test-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.import-test-card h5 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.import-test-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.import-test-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.import-test-meta i {
    color: var(--primary-color);
}

.import-test-actions {
    display: flex;
    justify-content: flex-end;
}

.import-test-actions .btn {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .import-modal-layout {
        grid-template-columns: 1fr;
    }

    .import-classes-list,
    .import-tests-list {
        max-height: none;
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    min-width: 280px;
    max-width: 420px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid var(--info-color);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    border-left-color: var(--success-color);
}

.notification-error {
    border-left-color: var(--error-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-content i {
    font-size: 1.25rem;
}

.notification-success .notification-content i {
    color: var(--success-color);
}

.notification-error .notification-content i {
    color: var(--error-color);
}

.notification-warning .notification-content i {
    color: var(--warning-color);
}

.notification-info .notification-content i {
    color: var(--info-color);
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
}

.notification-close:hover {
    color: var(--text-secondary);
}

/* Enhanced Header Styles */
.tests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.tests-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tests-header h2::before {
    content: '\f15c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
}

.test-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Date and Status Badges */
.date-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}


.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

/* Test Results Page */
.results-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.results-page-header .page-heading {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.results-page-header h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--text-primary);
}

.results-page-header p {
    margin: 0;
    color: var(--text-secondary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

.test-status-control {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.test-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: fit-content;
}

.overview-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    line-height: 1.2;
}

.overview-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: fit-content;
}

.summary-card h3 {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
}

.summary-subtext {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Main Tabs Styles */
.main-tabs-section {
    margin-top: 2rem;
}

.main-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.main-tab {
    padding: 0.875rem 1.75rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.main-tab:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.main-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.main-tab-content {
    display: none;
}

.main-tab-content.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.results-table-wrapper {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: var(--bg-secondary);
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.results-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-student {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.results-student .student-email {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.score-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.score-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.score-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.score-badge.requires-correction {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.requires-correction-row {
    background: rgba(245, 158, 11, 0.05);
}

.score-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    animation: pulse-error 2s ease-in-out infinite;
}

@keyframes pulse-error {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.grading-failed-row {
    background: rgba(239, 68, 68, 0.05);
}

.trigger-correction-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
    white-space: nowrap;
}

.trigger-correction-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

.score-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.results-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.empty-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-results i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

@media (max-width: 768px) {
    .results-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .test-status-control {
        align-self: flex-start;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .test-overview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .test-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Modal Styles */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    background: var(--bg-secondary);
}

.modal-header h2 {
    color: var(--text-primary);
}

.modal-actions {
    gap: 0.75rem;
}

.modal-actions .btn {
    min-width: 100px;
    justify-content: center;
}

/* Empty States */
.empty-table-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-table-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-table-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-table-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


/* Responsive Table Styles */
@media (max-width: 768px) {

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content {
        overflow-x: hidden;
    }

    .container h1 {
        font-size: 1.75rem;
        word-break: break-word;
    }

    /* Vertical tabs on mobile */
    .class-details-tabs {
        flex-direction: column;
        border-bottom: none;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .tab-btn {
        padding: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        justify-content: flex-start;
        background: var(--bg-secondary);
    }

    .tests-header {
        align-items: stretch;
    }

    .tests-header-main {
        width: 100%;
    }

    .test-filters {
        width: 100%;
    }

    .test-search,
    .test-status-filter {
        flex: 1 1 160px;
    }

    .test-search input,
    .test-status-filter select {
        min-width: 0;
    }

    .test-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tab-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .tab-btn:hover {
        background: var(--bg-tertiary);
    }

    .tab-btn.active:hover {
        background: var(--primary-hover);
    }

    /* Hide tables on mobile */
    .students-table-container .students-table,
    .tests-table-container .tests-table {
        display: none;
    }

    /* Show mobile card layouts */
    .mobile-students-list,
    .mobile-tests-list {
        display: block;
    }

    .students-table-container,
    .tests-table-container {
        overflow-x: hidden;
    }

    .students-table th,
    .tests-table th,
    .students-table td,
    .tests-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .student-profile {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .student-avatar {
        width: 32px;
        height: 32px;
    }

    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-small {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .tests-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .test-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .test-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Mobile pagination adjustments */
    .students-pagination {
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem 0.75rem;
    }

    .students-pagination .btn {
        min-width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .students-pagination .pagination-info {
        width: 100%;
        text-align: center;
        font-size: 0.875rem;
    }
}

/* Usage Statistics Styles for Test Results */
.usage-stats-section {
    margin: 24px 0;
}

.monthly-stats-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.usage-stats-header {
    margin-bottom: 20px;
}

.usage-stats-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.usage-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.usage-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.usage-stat-icon.ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.usage-stat-icon.simple {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.usage-stat-info {
    flex: 1;
}

.usage-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    display: block;
    margin-bottom: 2px;
}

.usage-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .usage-stats-grid {
        grid-template-columns: 1fr;
    }

    .monthly-stats-container {
        padding: 16px;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Teacher Management Styles */
.teachers-table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.table-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.teachers-table {
    width: 100%;
    border-collapse: collapse;
}

.teachers-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0.05em;
}

.teachers-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.teachers-table tbody tr:hover {
    background: var(--bg-secondary);
}

.teachers-table tbody tr:last-child td {
    border-bottom: none;
}

.teacher-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.teacher-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.teacher-info {
    display: flex;
    flex-direction: column;
}

.teacher-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.teacher-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-admin {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b5a00;
    border: 1px solid #ffd700;
}

.role-teacher {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #e3f2fd;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-admin {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b5a00;
    border: 1px solid #ffd700;
}

.status-active {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #e8f5e8;
}

.status-inactive {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1px solid #ffebee;
}

.date-badge {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Danger Zone Styles */
.danger-zone {
    border: 2px solid #ffebee;
    background: linear-gradient(135deg, #ffebee, #fff5f5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h4 {
    color: #d32f2f;
    margin-bottom: 1rem;
}

.danger-zone .setting-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ffcdd2;
    border-radius: var(--border-radius);
    padding: 1rem;
}

.danger-zone .setting-info h5 {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.danger-zone .setting-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10000;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: transparent;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    position: relative;
    z-index: 10001;
}

.form-group .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Empty Table State */
.empty-table-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-table-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-table-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.empty-table-state p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design for Teacher Management */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .table-header .btn {
        width: 100%;
    }

    .teachers-table {
        font-size: 0.9rem;
    }

    .teachers-table th,
    .teachers-table td {
        padding: 0.75rem 0.5rem;
    }

    .teacher-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .teacher-avatar {
        width: 32px;
        height: 32px;
    }

    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .table-actions .btn {
        width: 100%;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Limits Display Styles */
.limits-overview {
    margin-bottom: 2rem;
}

.limits-overview .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.plan-display {
    font-weight: 500;
    color: var(--text-secondary);
}

.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.plan-badge.free {
    background: #dcfce7;
    color: #166534;
}

.plan-badge.pro {
    background: #dbeafe;
    color: #1e40af;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.limit-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.limit-card:hover {
    box-shadow: var(--shadow-md);
}

.limit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.limit-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-indicator {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.credits-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.credits-link:hover {
    text-decoration: none;
}

.limit-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.limit-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.limit-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    position: relative;
}

.limit-progress.zero-usage .progress-bar {
    opacity: 0.5;
    background: var(--bg-secondary);
    border-style: dashed;
}


.progress-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
    display: block;
}

.progress-fill:not([style*="display: none"]) {
    opacity: 1;
}

.progress-bar:has(.progress-fill[style*="display: none"]) {
    opacity: 0.3;
}

.progress-fill.warning {
    background: var(--warning-color);
}

.progress-fill.danger {
    background: var(--error-color);
}

.limit-value {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
}

.limit-value.limit-warning {
    background: #fef3c7;
    color: #92400e;
}

.limit-value.limit-danger {
    background: #fee2e2;
    color: #991b1b;
}

.limit-value-static {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.limit-value-static.credits {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary-color);
}

.upgrade-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.upgrade-content {
    text-align: center;
}

.upgrade-content h3 {
    color: white;
    margin-bottom: 0.75rem;
}

.upgrade-content p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 0.875rem;
}

.btn-upgrade {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-upgrade:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

/* Enhanced responsive design for limits */
@media (max-width: 768px) {
    .limits-grid {
        grid-template-columns: 1fr;
    }

    .limits-overview .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .limit-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .limit-progress {
        width: 100%;
        justify-content: space-between;
    }

    .progress-bar {
        width: 120px;
    }

    .limit-card {
        padding: 1rem;
    }

    .progress-bar {
        width: 100px;
    }
}

/* Join Requests Styles */
.join-requests-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.requests-count {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 40px;
    text-align: center;
}

.has-pending-requests .requests-count {
    background: var(--warning-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.modal-large .modal-content {
    max-width: 800px;
    width: 90%;
}

.join-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.join-request-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.student-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.student-details p {
    margin: 0 0 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.request-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--error-color);
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0;
}

/* Test Details Page Styles */
.test-details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0f6bc7;
    text-decoration: none;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 400;
}

.breadcrumb span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Test Header */
.test-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.test-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

.test-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.test-title::before {
    content: '\f15c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.test-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.test-meta-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.test-meta-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.test-meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.test-meta-icon.duration {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.test-meta-icon.questions {
    background: linear-gradient(135deg, #10b981, #047857);
}

.test-meta-icon.points {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.test-meta-icon.status {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.test-meta-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.test-meta-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.test-meta-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Test Status Section */
.test-status-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.status-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.status-toggle:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.status-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.status-label.active {
    color: var(--success-color);
}

.status-label.inactive {
    color: var(--text-muted);
}

.time-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-field label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-field label::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
}

.time-field input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    max-width: 200px;
}

.time-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Actions Section */
.actions-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.action-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.action-buttons .btn:hover::before {
    left: 100%;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-color: var(--primary-color);
}

.action-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #0f6bc7, #127ae0);
    border-color: #0f6bc7;
    color: white;
}

.action-buttons .btn-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    color: white;
    border-color: var(--info-color);
}

.action-buttons .btn-info:hover {
    background: linear-gradient(135deg, #2563eb, var(--info-color));
    border-color: #2563eb;
    color: white;
}

.action-buttons .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.action-buttons .btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-buttons .btn-danger {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
    border-color: var(--error-color);
}

.action-buttons .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, var(--error-color));
    border-color: #dc2626;
    color: white;
}

/* Enhanced Toggle Switch for Test Details */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transition: all 0.4s ease;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    top: 4px;
    background: white;
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(26px);
    background: white;
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive design for test details */
@media (max-width: 1024px) {
    .test-details-container {
        padding: 1rem;
        gap: 1.5rem;
    }

    .test-header {
        padding: 2rem;
    }

    .test-title {
        font-size: 1.75rem;
    }

    .test-meta {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .action-buttons {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .test-details-container {
        padding: 0.5rem;
        gap: 1rem;
    }

    .breadcrumb {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .test-header {
        padding: 1.5rem;
    }

    .test-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .test-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .test-meta-item {
        padding: 1rem;
    }

    .test-status-section,
    .actions-section {
        padding: 1.5rem;
    }

    .status-toggle {
        padding: 1rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .action-buttons .btn {
        padding: 0.875rem 1rem;
    }

    .section-title {
        font-size: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }

    .time-field input {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .test-header {
        padding: 1rem;
    }

    .test-title {
        font-size: 1.25rem;
    }

    .test-meta-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .test-meta-value {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .toggle-switch {
        width: 50px;
        height: 28px;
    }

    .toggle-slider::before {
        height: 22px;
        width: 22px;
        left: 3px;
        top: 3px;
    }

    .toggle-switch input:checked+.toggle-slider::before {
        transform: translateX(22px);
    }
}

/* Responsive design for join requests */
@media (max-width: 768px) {
    .join-request-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .request-actions {
        justify-content: center;
    }

    .join-requests-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .modal-large .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Plan Banner Styles */
.plan-banner {
    display: block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}


.plan-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.plan-banner-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.plan-banner .plan-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.plan-banner .plan-badge.pro {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

.plan-banner-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.plan-banner-actions {
    display: flex;
    gap: 0.75rem;
}

.plan-banner .btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-banner .btn-upgrade {
    background: white;
    color: #6366f1;
}

.plan-banner .btn-upgrade:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.plan-banner .btn-manage {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.plan-banner .btn-manage:hover {
    background: rgba(255, 255, 255, 0.25);
}