/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #6c8cff;
    --secondary-color: #06ffa5;
    --accent-color: #ff6b6b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */
.landing-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.circle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.circle:nth-child(2) {
    width: 500px;
    height: 500px;
    bottom: -250px;
    right: -250px;
    animation-delay: 5s;
}

.circle:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* Landing Content */
.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.logo-section {
    margin-bottom: 3rem;
}

.logo-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    animation: fadeInDown 1s ease;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.company-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease;
}

.tagline {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    letter-spacing: 2px;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Welcome Card */
.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 1s ease 0.4s both;
}

.welcome-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.welcome-text {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.feature span {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.options-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.current-image {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

/* Footer */
.footer-info {
    margin-top: 3rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

.small {
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   STUDENT PAGE STYLES
   ============================================ */
.student-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.student-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
}

.student-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    transform: translateX(-5px);
}

.logo-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
}

.logo-mini img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.student-form {
    padding: 2rem;
}

.student-form h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-description {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.info-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-sm);
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #92400e;
}

/* ============================================
   WAITING PAGE STYLES
   ============================================ */
.waiting-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.waiting-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.status-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

.pulse-ring.delay-1 {
    animation-delay: 0.5s;
}

.pulse-ring.delay-2 {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.status-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon i {
    font-size: 2rem;
    color: white;
}

.student-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.student-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.status-message {
    color: var(--text-gray);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.success-icon, .error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon {
    background: var(--success-color);
}

.success-icon i {
    font-size: 3rem;
    color: white;
}

.error-icon {
    background: var(--danger-color);
}

.error-icon i {
    font-size: 3rem;
    color: white;
}

.approval-info h3, .rejection-info h3 {
    margin-bottom: 1rem;
}

.time-info {
    background: var(--light-bg);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    display: inline-block;
}

.btn-start {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-retry {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.loading-indicator {
    margin-top: 1.5rem;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dots span:nth-child(1) { animation-delay: -0.32s; }
.dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.help-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.help-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.help-link:hover {
    color: var(--primary-color);
}

/* Status styles */
.status-active, .status-approved {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.status-approved {
    background: #10a0d8;
}

.status-exam-stopped {
    background: #d32f2f;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.small-btn {
    background: var(--primary-color);
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    margin-left: 0.35rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.small-btn:hover {
    background: #1450b0;
}

/* ============================================
   ADMIN LOGIN PAGE STYLES
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    position: relative;
    animation: fadeInUp 0.6s ease;
}

.back-button {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: var(--transition);
}

.back-button:hover {
    color: var(--primary-color);
    transform: translateX(-3px);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.login-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.login-logo h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.login-logo p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-form .input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-gray);
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.error-message {
    background: #fee2e2;
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.security-note {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================
   ADMIN DASHBOARD STYLES
   ============================================ */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.menu-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid var(--secondary-color);
}

.menu-item i {
    width: 20px;
}

.badge {
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: var(--light-bg);
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
    min-height: 500px;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header p {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-info p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Tables */
.requests-table-container,
.questions-table-container {
    background: white;
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
}

.requests-table,
.questions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

#activeExamsSection .requests-table {
    min-width: 1400px;
}

.questions-table {
    table-layout: fixed;
}

.requests-table th,
.questions-table th {
    background: var(--light-bg);
    padding: 0.65rem 0.45rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.88rem;
}

.requests-table td,
.questions-table td {
    padding: 0.65rem 0.45rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-gray);
    font-size: 0.82rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.questions-table td:nth-child(1),
.questions-table th:nth-child(1) { width: 80px; }
.questions-table td:nth-child(2),
.questions-table th:nth-child(2) { width: 18%; }
.questions-table td:nth-child(3),
.questions-table th:nth-child(3) { width: 10%; }
.questions-table td:nth-child(4),
.questions-table th:nth-child(4) { width: 30%; }
.questions-table td:nth-child(5),
.questions-table th:nth-child(5) { width: 16%; }
.questions-table td:nth-child(6),
.questions-table th:nth-child(6) { width: 26%; }

.requests-table tr:hover,
.questions-table tr:hover {
    background: var(--light-bg);
}

.question-image-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(67, 97, 238, 0.15);
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    color: #4361ee;
    font-size: 0.9rem;
}

.question-image-icon i {
    font-size: 14px;
}

.loading-row,
.empty-row,
.error-row {
    text-align: center;
    padding: 2rem !important;
}

.time-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
}

.approve-btn,
.reject-btn,
.edit-btn,
.delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    margin: 0 0.25rem;
}

.approve-btn {
    background: var(--success-color);
    color: white;
}

.approve-btn:hover {
    background: #0d9668;
}

.reject-btn {
    background: var(--danger-color);
    color: white;
}

.reject-btn:hover {
    background: #dc2626;
}

.edit-btn {
    background: var(--warning-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 56px;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    margin: 0 0.15rem !important;
}

.edit-btn:hover {
    background: #d97706;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 56px;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    margin: 0 0.15rem !important;
}

.action-cell {
    white-space: nowrap;
    min-width: 180px;
    max-width: 220px;
    padding: 0.35rem !important;
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Questions Tools */
.questions-tools {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    background: white;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-gray);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

/* Badges */
.badge-text {
    background: #e0e7ff;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.badge-image {
    background: #fef3c7;
    color: #d97706;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.badge-image-options {
    background: #d1fae5;
    color: var(--success-color);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Settings Form */
.settings-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.setting-group input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

/* ============================================
   EXAM PAGE STYLES
   ============================================ */
.exam-container {
    min-height: 100vh;
    background: var(--light-bg);
    display: flex;
    flex-direction: column;
}

.exam-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.exam-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.exam-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.exam-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.student-name,
.timer,
.question-counter,
.allocated-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.timer {
    background: var(--primary-color);
    color: white;
}

.allocated-time {
    background: #eef2ff;
    color: #1d4ed8;
}

.exam-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.question-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    min-height: 500px;
    border: 1px solid #e5e9f0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.question-header h3 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
}

.question-status {
    background: #f8fafc;
    color: #334155;
    font-size: 0.85rem;
    border: 1px solid #cfd8e3;
    border-radius: 99px;
    padding: 0.4rem 0.8rem;
}

.question-text p {
    margin: 0;
    font-size: 1.05rem;
    color: #102a43;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.question-card {
    animation: fadeIn 0.3s ease;
}

.question-text h3 {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.question-text p {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.question-image {
    margin: 1.5rem 0;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7e1ee;
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(17, 31, 53, 0.08);
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.option-item:hover {
    border-color: #4675f7;
    box-shadow: 0 3px 12px rgba(17, 31, 53, 0.16);
    transform: translateY(-1px);
}

.option-item.selected {
    border-color: #3262e7;
    background: #ebf1ff;
}


.option-radio {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-radio i {
    font-size: 1.2rem;
    color: var(--text-light);
}

.option-radio.checked i {
    color: var(--primary-color);
}

.option-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.option-image img {
    max-width: 150px;
    max-height: 100px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    color: var(--text-dark);
    text-align: left !important;
    display: block;
}

.exam-navigation {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 0;
    z-index: 50;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    color: #1f2937;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.prev-btn, .next-btn {
    background: #3b82f6;
    color: #ffffff;
    min-width: 110px;
    border: 1px solid #2563eb;
}

.prev-btn:hover:not(:disabled), .next-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #1d4ed8;
}

.prev-btn:disabled {
    background: #1f2937;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #374151;
}


.prev-btn:hover:not(:disabled),
.next-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.prev-btn:disabled {
    opacity: 0.7;
    color: #6b7280;
    cursor: not-allowed;
}

.prev-btn:disabled,
.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    background: var(--success-color);
    color: white;
    padding: 0.75rem 2rem;
    border: 1px solid var(--success-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background: #0d9668;
    border-color: #0d9668;
    color: #fff;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}


/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 90%;
    width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.modal-header .close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: var(--transition);
}

.modal-header .close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.results-modal {
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-number {
    font-size: 3rem;
    font-weight: 800;
}

.score-total {
    font-size: 1rem;
    opacity: 0.9;
}

.score-message {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.review-section {
    text-align: left;
    margin-top: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.review-section h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.review-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
}

.review-item.correct {
    background: #d1fae5;
    border-left-color: var(--success-color);
}

.review-item.incorrect {
    background: #fee2e2;
    border-left-color: var(--danger-color);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.question-number {
    font-weight: 600;
    color: var(--text-dark);
}

.review-status i {
    margin-right: 0.25rem;
}

.review-question {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.review-answer, .review-correct {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.retake-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.close-results-btn {
    background: var(--text-gray);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .exam-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .options-container {
        gap: 0.75rem;
    }
    
    .option-item {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }
    
    .option-content {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    
    .option-text {
        width: 100%;
        text-align: left;
    }
    
    .exam-navigation {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .questions-tools {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}