/* ==========================================
   DARK THEME MOBILE-FIRST CSS
   MCQ Exam Platform - App-Like Experience
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Dark Theme Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1f2937;
    --bg-card: #1a1f2e;
    --bg-hover: #252d3d;
    
    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    /* Border Colors */
    --border-primary: #30363d;
    --border-secondary: #21262d;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
    
    /* App Heights for Mobile */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --stat-tiles-height: 90px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent body scrolling on mobile for app-like feel */
    position: fixed;
    width: 100%;
    height: 100vh;
}

/* iOS-style smooth scrolling */
* {
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   TOAST NOTIFICATION SYSTEM
   ========================================== */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    border-left: 4px solid var(--accent-primary);
    animation: slideInRight 0.3s ease;
    transition: all 0.3s ease;
}

.toast:hover {
    transform: translateX(-5px);
}

.toast.success {
    border-left-color: var(--accent-success);
}

.toast.error {
    border-left-color: var(--accent-danger);
}

.toast.warning {
    border-left-color: var(--accent-warning);
}

.toast.info {
    border-left-color: var(--accent-primary);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Mobile Toast */
@media (max-width: 768px) {
    #toast-container {
        top: auto;
        bottom: calc(var(--bottom-nav-height) + 10px);
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ==========================================
   MODAL/POPUP SYSTEM
   ========================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Support for old modal structure (take-exam.html) */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal .modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

.modal .modal-header {
    margin-bottom: 20px;
}

.modal .modal-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.5rem;
}

.modal .modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal p strong {
    color: var(--text-primary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

/* ==========================================
   AUTHENTICATION PAGES
   ========================================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    overflow-y: auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    animation: slideUp 0.5s ease;
}

.auth-card h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-align: center;
    font-size: 32px;
}

.auth-card h2 {
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    font-size: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.policy-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-primary);
    font-size: 13px;
}

.policy-links a {
    color: var(--accent-primary);
    text-decoration: none;
}

.policy-links span {
    margin: 0 8px;
    color: var(--text-muted);
}

/* ==========================================
   DASHBOARD LAYOUT - MOBILE FIRST
   ========================================== */

.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-primary);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-nav-items {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-around;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.mobile-nav-item.active {
    color: var(--accent-primary);
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
}

.mobile-nav-icon {
    font-size: 22px;
}

/* Top Header - Mobile Optimized */
.dashboard-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

.dashboard-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Main Content Area - Mobile Optimized */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
    padding-bottom: calc(var(--bottom-nav-height) + 10px);
}

.dashboard-content {
    padding: 16px;
}

/* ==========================================
   STATISTICS CARDS
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================
   NOTIFICATIONS SECTION
   ========================================== */

.notifications-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.notifications-section h2 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-box {
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.notification-scroll {
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    overscroll-behavior: contain;
}

.notification-item {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.notification-message {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.notification-time {
    color: var(--text-muted);
    font-size: 11px;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 14px;
}

/* ==========================================
   EXAM CARDS
   ========================================== */

.exams-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.exam-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    position: relative;
}

.exam-card:active {
    transform: scale(0.98);
}

.exam-course-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.exam-card h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 10px;
    padding-right: 100px;
}

.exam-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.exam-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.exam-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 8px;
}

.exam-actions {
    display: flex;
    gap: 10px;
}

/* ==========================================
   EXAM TAKING INTERFACE
   ========================================== */

.exam-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
}

.exam-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.exam-title h1 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient-danger);
    color: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}

/* Subject Filter Tiles */
.subject-filter-tiles {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.subject-filter-tiles::-webkit-scrollbar {
    height: 6px;
}

.subject-filter-tiles::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.subject-filter-tiles::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.subject-tile {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 2px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
    user-select: none;
}

.subject-tile:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
}

.subject-tile:active {
    transform: translateY(0);
}

.subject-tile.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.subject-tile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.subject-tile.active .subject-tile-name {
    color: white;
}

.subject-tile-stats {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.subject-tile.active .subject-tile-stats {
    color: rgba(255, 255, 255, 0.9);
}

/* Exam Stats Tiles */
.exam-stats-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.stat-tile {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-left: 3px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.stat-tile.clickable {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.3);
}

.stat-tile.clickable:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
}

.stat-tile.clickable:active {
    transform: translateY(0);
    background: var(--bg-tertiary);
}

.stat-tile.active {
    background: var(--bg-hover);
    border-left-width: 4px;
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.stat-tile.answered {
    border-left-color: var(--accent-success);
}

.stat-tile.answered.active {
    box-shadow: 0 0 0 2px var(--accent-success);
}

.stat-tile.pending {
    border-left-color: var(--accent-warning);
}

.stat-tile.pending.active {
    box-shadow: 0 0 0 2px var(--accent-warning);
}

.stat-tile .stat-icon {
    font-size: 20px;
}

.stat-tile .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-tile .stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Question Container */
.exam-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 180px;
}

.question-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.question-number {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.question-text {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.7;
    font-weight: 500;
}

.question-marks {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 18px 20px;
    border: 2px solid var(--border-primary);
    background: var(--bg-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

.option-btn:active {
    transform: scale(0.98);
}

.option-btn.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.option-btn.correct {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.option-btn.wrong {
    border-color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.option-label {
    font-weight: 700;
    margin-right: 10px;
}

/* Exam Bottom Navigation */
.exam-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-primary);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
}

.nav-controls-top,
.nav-controls-bottom {
    display: flex;
    gap: 10px;
}

.exam-bottom-nav .btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    pointer-events: auto;
    cursor: pointer;
}

/* Bottom Ad Banner - Completely hidden on exam pages */
.exam-container ~ .bottom-ad-banner {
    display: none !important;
}

.bottom-ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 4px 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-ad-banner ins {
    display: block;
    max-height: 40px;
}

/* ==========================================
   RESULTS PAGE
   ========================================== */

.results-container {
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 24px;
}

.results-header h1 {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 8px;
}

.score-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    text-align: center;
}

.score-display {
    font-size: 56px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 16px 0;
}

.score-percentage {
    font-size: 28px;
    color: var(--accent-success);
    font-weight: 700;
    margin: 12px 0;
}

.score-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.detail-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-value.correct {
    color: var(--accent-success);
}

.detail-value.wrong {
    color: var(--accent-danger);
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ==========================================
   ADMIN STYLES
   ========================================== */

.quick-actions {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-primary);
    margin-bottom: 20px;
}

.quick-actions h2 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 16px;
}

.action-buttons {
    display: grid;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.action-btn:active {
    transform: scale(0.98);
}

.action-icon {
    font-size: 24px;
}

/* ==========================================
   RESPONSIVE - MOBILE FIRST
   ========================================== */

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Passage Modal Optimization */
    .modal {
        align-items: center;
        justify-content: center;
        padding: 10px;
    }
    
    .modal.active {
        display: flex;
    }
    
    .modal .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 85vh;
        padding: 15px;
        margin: auto;
        border-radius: 12px;
    }
    
    #passageModal .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 85vh !important;
        margin: auto;
    }
    
    #passageModal .modal-header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    #passageModal .modal-header h2 {
        font-size: 1.1rem;
    }
    
    #passageModal .modal-body {
        max-height: 60vh !important;
        overflow-y: auto;
        padding: 15px !important;
        font-size: 0.95rem;
        line-height: 1.6;
        -webkit-overflow-scrolling: touch;
    }
    
    #passageModal .modal-actions {
        padding: 10px !important;
        margin-top: 10px;
    }
    
    #passageModal .modal-actions button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    #passageContent {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        text-align: justify;
        word-wrap: break-word;
    }
    
    .modal-close {
        font-size: 1.8rem;
        padding: 5px 10px;
    }
}

/* Desktop Adjustments */
@media (min-width: 769px) {
    body {
        position: static;
        height: auto;
    }
    
    .dashboard-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .exams-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .main-content {
        padding-bottom: 20px;
    }
    
    .exam-content {
        padding-bottom: 20px;
    }
    
    .exam-bottom-nav {
        position: static;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }
.visible { display: block !important; }
