/* ==========================================
   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;
}

/* 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);
}

/* Authentication Pages Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    color: #333;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
}

.register-card {
    max-width: 600px;
}

.auth-card h1 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.auth-card h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #555;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.success-message {
    background-color: #efe;
    color: #3c3;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #3c3;
}

/* Dashboard Styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: block;
}

.user-info {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    transition: all 0.3s;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    transition: all 0.3s;
}

.user-info p, .admin-label {
    transition: opacity 0.3s;
}

.user-info p {
    margin: 5px 0;
    color: #666;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    gap: 10px;
}

.nav-icon {
    font-size: 1.2em;
    min-width: 24px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
    transition: opacity 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #f0f0f0;
    border-left: 4px solid #667eea;
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .user-info p,
.sidebar.collapsed .admin-label,
.sidebar.collapsed .nav-text {
    display: none;
    opacity: 0;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.sidebar.collapsed .user-info {
    padding: 15px 10px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .toggle-btn {
    margin: 0 auto;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.dashboard-header {
    background: white;
    color: #333;
    padding: 20px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.dashboard-content {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 48px;
}

.stat-info h3 {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

.notifications-section {
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notifications-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.notification-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.notification-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.notification-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item.unread {
    background: #f0f4ff;
}

.notification-message {
    color: #333;
    margin-bottom: 5px;
}

.notification-time {
    color: #999;
    font-size: 12px;
}

.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .toggle-btn {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .dashboard-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .dashboard-header .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .exam-card, .question-card {
        padding: 15px;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Admin Specific Styles */
.admin-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.admin-label {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 8px;
    font-weight: 600;
}

.admin-card {
    border-left: 4px solid #f5576c;
}

.quick-actions {
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.quick-actions h2 {
    margin-bottom: 20px;
    color: #333;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: 600;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-icon {
    font-size: 24px;
}

.admin-section {
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table thead {
    background: #f5f5f5;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    color: #333 !important;
}

.data-table th {
    font-weight: 600;
    color: #555;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    color: #333;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

.modal-large {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    color: #333;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Exam Card Styles */
.exams-list, .exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.exam-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.exam-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.exam-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.exam-info {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.exam-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #777;
}

.exam-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.exam-actions .btn {
    flex: 1;
    min-width: 100px;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    width: 100%;
}

/* Notification Form Styles */
.notification-form-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-card, .preview-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-description, .preview-description {
    color: #666;
    margin-bottom: 20px;
}

.char-count {
    display: block;
    text-align: right;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.notification-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.templates-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.templates-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.template-card {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-3px);
}

.template-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.template-card p {
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

/* Exam Taking Styles */
.exam-container {
    min-height: 100vh;
    background: #f5f5f5;
}

.exam-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.exam-title h1 {
    color: #333;
    margin-bottom: 5px;
    font-size: 24px;
}

.exam-title p {
    color: #666;
    font-size: 14px;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.timer-icon {
    font-size: 20px;
}

/* Exam Stats Tiles - Compact Header Version */
.exam-stats-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.stat-tile {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border-left: 3px solid #667eea;
}

.stat-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-tile.answered {
    border-left-color: #28a745;
}

.stat-tile.pending {
    border-left-color: #ffc107;
}

.stat-tile .stat-icon {
    font-size: 20px;
}

.stat-tile .stat-content {
    flex: 1;
}

.stat-tile .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.stat-tile .stat-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.exam-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    padding-bottom: 20px;
}

.exam-progress {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.progress-info {
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.question-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.question-card {
    margin-bottom: 15px;
}

.question-number {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.question-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.question-marks {
    display: inline-block;
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.options-grid {
    display: grid;
    gap: 12px;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    color: #333;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.option-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.option-btn.wrong {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.option-label {
    font-weight: 600;
    margin-right: 10px;
}

/* Bottom Navigation - Fixed */
.exam-bottom-nav {
    background: white;
    padding: 12px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.nav-controls-top {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.nav-controls-bottom {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.exam-bottom-nav .btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Remove old navigation styles */
.exam-navigation {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.exam-navigation .nav-controls {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.exam-navigation .btn {
    min-width: 120px;
}

.exam-navigation #leaveExamBtn {
    margin-right: auto;
}

/* Exam Statistics Tiles */

/* Results Styles */
.results-container {
    min-height: 100vh;
    background: #f5f5f5;
    padding: 20px;
}

.results-header {
    background: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.results-content {
    max-width: 900px;
    margin: 0 auto;
}

.score-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.score-main {
    margin-bottom: 30px;
}

.score-display {
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
    margin: 20px 0;
}

.score-total {
    color: #999;
    font-size: 36px;
}

.score-percentage {
    font-size: 28px;
    color: #28a745;
    font-weight: 600;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.detail-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.detail-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.detail-value.correct {
    color: #28a745;
}

.detail-value.wrong {
    color: #dc3545;
}

.results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.detailed-results {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.detailed-results h2 {
    margin-bottom: 25px;
    color: #333;
}

.answer-review {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.answer-review.correct-answer {
    border-left-color: #28a745;
    background: #d4edda;
}

.answer-review.wrong-answer {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.answer-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.answer-status.correct {
    background: #28a745;
    color: white;
}

.answer-status.wrong {
    background: #dc3545;
    color: white;
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    .notification-form-container {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .exam-header {
        padding: 10px 15px;
    }
    
    .exam-title h1 {
        font-size: 16px;
    }
    
    .exam-timer {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .exam-stats-tiles {
        padding: 6px 15px;
        gap: 6px;
    }
    
    .stat-tile {
        padding: 6px;
        gap: 6px;
    }
    
    .stat-tile .stat-icon {
        font-size: 18px;
    }
    
    .stat-tile .stat-value {
        font-size: 16px;
    }
    
    .stat-tile .stat-label {
        font-size: 9px;
    }
    
    .exam-content {
        padding: 10px 15px;
    }
    
    .question-container {
        padding: 15px;
    }
    
    .question-text {
        font-size: 15px;
    }
    
    .option-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .exam-bottom-nav {
        padding: 10px 15px;
        gap: 8px;
    }
    
    .nav-controls-top,
    .nav-controls-bottom {
        gap: 8px;
    }
    
    .exam-bottom-nav .btn {
        padding: 10px;
        font-size: 13px;
    }
    
    .score-display {
        font-size: 36px;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .exam-title h1 {
        font-size: 20px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .option-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .score-display {
        font-size: 28px;
    }
    
    .score-percentage {
        font-size: 22px;
    }
}

/* User Profile Modal Styles */
.user-profile-modal {
    max-width: 800px !important;
}

.profile-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.profile-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
}

.detail-value {
    color: #333;
    text-align: right;
    flex: 1;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    color: #333;
    background: #f0f0f0;
}

.percentage-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
}

.percentage-badge.excellent {
    background: #d4edda;
    color: #155724;
}

.percentage-badge.good {
    background: #cce5ff;
    color: #004085;
}

.percentage-badge.average {
    background: #fff3cd;
    color: #856404;
}

.percentage-badge.poor {
    background: #f8d7da;
    color: #721c24;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.user-row {
    transition: all 0.3s;
}

.user-row:hover {
    background: #f0f0ff !important;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .user-profile-modal {
        max-width: 95% !important;
        padding: 15px !important;
    }
    
    .profile-section {
        padding: 15px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 13px;
    }
    
    .detail-value {
        text-align: left;
        font-size: 14px;
        font-weight: 600;
    }
}

/* Question Bank Styles */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #6366f1;
    background: #f9f9f9;
}

.tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

.questions-list {
    display: grid;
    gap: 20px;
}

.question-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.question-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-easy {
    background: #d4edda;
    color: #155724;
}

.badge-medium {
    background: #fff3cd;
    color: #856404;
}

.badge-hard {
    background: #f8d7da;
    color: #721c24;
}

.usage-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    background: #e7f3ff;
    color: #0066cc;
}

.question-text {
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.question-options {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.option {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
    font-weight: 600;
}

.question-tags {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.question-explanation {
    padding: 12px;
    background: #f0f8ff;
    border-left: 4px solid #0066cc;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.question-actions {
    display: flex;
    gap: 10px;
}

.import-section {
    max-width: 800px;
}

.import-instructions {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.import-instructions h3 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.import-instructions ol {
    margin-left: 20px;
}

.import-instructions pre {
    background: white;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #ddd;
    font-size: 13px;
}

.import-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.random-exam-section {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.subject-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.subject-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subject-section-header h4 {
    color: var(--accent-primary);
    font-size: 16px;
    margin: 0;
}

.remove-subject-btn {
    background: var(--accent-danger);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.remove-subject-btn:hover {
    opacity: 0.8;
}

.success-message {
    padding: 20px;
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    color: #155724;
}

.error-message {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 8px;
    color: #721c24;
}

@media (max-width: 768px) {
    .tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        font-size: 14px;
        padding: 10px 16px;
        white-space: nowrap;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters select {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-header button {
        width: 100%;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions button {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Google AdSense Styles */
.bottom-ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 25px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px 10px 0 0;
}

.bottom-ad-banner ins {
    display: block;
    max-height: 90px;
}

/* Dashboard ad inside notifications section */
.dashboard-ad-container {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    min-height: 100px;
}

.results-ad-container {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}
    /* Course selector (Question Bank) */
    .course-actions {
        display: flex;
        gap: 10px;
        align-items: center;
        margin-left: auto;
        flex-wrap: wrap;
    }

    #qbCourseSelect {
        min-width: 200px;
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid var(--border-primary, #30363d);
        background: var(--bg-secondary, #161b22);
        color: var(--text-primary, #e6edf3);
    }

    .pill {
        padding: 6px 10px;
        border-radius: 20px;
        background: var(--bg-secondary, #161b22);
        color: var(--text-primary, #e6edf3);
        font-size: 12px;
        border: 1px solid var(--border-primary, #30363d);
    }

.pre-exam-ad {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    min-height: 90px;
}

/* Start Exam Modal */
.start-exam-modal {
    max-width: 500px;
}

.start-exam-message {
    padding: 15px;
    background: #f0f8ff;
    border-radius: 8px;
    margin-bottom: 15px;
}

.start-exam-message p {
    margin: 10px 0;
    color: #333;
}

.start-exam-message p:first-child {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

/* Adjust exam container for bottom ad */
.exam-container {
    padding-bottom: 130px;
}

@media (max-width: 768px) {
    .bottom-ad-banner {
        padding: 10px 15px;
    }
    
    .bottom-ad-banner ins {
        max-height: 70px;
    }
    
    .dashboard-ad-container {
        padding: 10px;
        min-height: 80px;
    }
    
    .exam-container {
        padding-bottom: 100px;
    }
}

/* Privacy Policy and About Page Styles */
.policy-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.policy-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.policy-header h1 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.last-updated {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.tagline {
    color: #666;
    font-size: 18px;
    font-style: italic;
    margin-top: 10px;
}

.policy-content {
    line-height: 1.8;
}

.policy-content section {
    margin-bottom: 30px;
}

.policy-content h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.policy-content p {
    color: #555;
    margin-bottom: 15px;
}

.policy-content ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.policy-content li {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.policy-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.policy-content a:hover {
    text-decoration: underline;
}

.policy-content strong {
    color: #333;
    font-weight: 600;
}

.policy-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.policy-footer .btn {
    margin: 0 10px;
}

.policy-footer .btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.policy-footer .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.3);
}

/* Policy Links on Login Page */
.policy-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}

.policy-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.policy-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.policy-links span {
    margin: 0 10px;
    color: #999;
}

/* Dashboard container padding for bottom ad */
.dashboard-container {
    padding-bottom: 20px;
}

@media (max-width: 768px) {
    .policy-container {
        margin: 20px;
        padding: 15px;
    }
    
    .policy-header h1 {
        font-size: 28px;
    }
    
    .policy-content h2 {
        font-size: 20px;
    }
    
    .policy-footer .btn {
        display: block;
        margin: 10px auto;
        width: 100%;
        max-width: 300px;
    }
}

/* ==========================================
   ADMIN DASHBOARD MODAL FIX
   ========================================== */

/* Modal container fix for fixed body */
#modalContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

#modalContainer .modal {
    pointer-events: all;
}

/* Ensure modal displays above everything */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
}

/* User profile modal specific styles */
.user-profile-modal {
    max-width: 700px !important;
    padding: 40px 30px 30px 30px;
}

.user-profile-modal h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Stats grid inside modal */
.user-profile-modal .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.user-profile-modal .stat-card {
    padding: 15px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

.user-profile-modal .stat-card .stat-icon {
    font-size: 28px;
}

.user-profile-modal .stat-card .stat-info h3 {
    font-size: 24px;
    margin-bottom: 2px;
}

.user-profile-modal .stat-card .stat-info p {
    font-size: 12px;
}

@media (max-width: 600px) {
    .user-profile-modal .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .user-profile-modal {
        padding: 30px 20px 20px 20px;
    }
}

/* Force dark text for all admin content */
.dashboard-content, .tab-content, .modal-content, .admin-section { color: #333 !important; }
