/* Custom CSS - Library Science MCQ Hub */
/* Dark Mode-First Design System */

:root {
    --bg-dark: hsl(145, 20%, 97%); /* Clean off-white background with a hint of green */
    --bg-card: hsla(145, 20%, 100%, 0.9); /* Pure white glass card */
    --bg-card-hover: hsla(145, 20%, 96%, 0.95);
    --border-color: hsla(145, 15%, 70%, 0.3); /* Subtle green-gray borders */
    
    --primary-color: hsl(145, 60%, 28%); /* Professional rich emerald/forest green */
    --primary-glow: hsla(145, 60%, 28%, 0.15);
    
    --accent-color: hsl(160, 50%, 35%); /* Slightly lighter teal green */
    --accent-glow: hsla(160, 50%, 35%, 0.15);
    
    --success-color: hsl(145, 65%, 32%); /* Success green */
    --success-glow: hsla(145, 65%, 32%, 0.15);
    
    --error-color: hsl(355, 65%, 45%); /* Professional deep crimson red */
    --error-glow: hsla(355, 65%, 45%, 0.15);
    
    --text-primary: hsl(215, 28%, 12%); /* Very dark charcoal text for high readability */
    --text-secondary: hsl(215, 15%, 35%);
    --text-muted: hsl(215, 12%, 55%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --sidebar-width: 280px;
    --card-radius: 16px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== SCROLLBARS ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 24px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: hsla(250, 85%, 65%, 0.3);
}

.max-width-600 {
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), hsl(270, 85%, 60%));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(250, 85%, 65%, 0.5);
}

.btn-secondary {
    background: hsla(225, 15%, 25%, 0.5);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: hsla(225, 15%, 35%, 0.8);
    border-color: var(--text-secondary);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), hsl(340, 80%, 55%));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(320, 80%, 60%, 0.5);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 6px 12px;
}

.btn-link:hover {
    color: hsl(250, 85%, 75%);
    text-decoration: underline;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color var(--transition-speed) ease;
}

.input-icon-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-icon-wrapper input:focus + i {
    color: var(--primary-color);
}

textarea, select {
    width: 100%;
    padding: 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
    resize: vertical;
}

textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: hsla(225, 25%, 15%, 0.95);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-weight: 500;
}

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

/* ==================== VIEW 1: AUTH ==================== */
#view-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    background: var(--border-color);
    padding: 4px;
    border-radius: 8px;
    margin-top: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.auth-tab.active {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.auth-info-alert {
    background: hsla(250, 85%, 65%, 0.1);
    border: 1px solid var(--primary-glow);
    padding: 14px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-info-alert i {
    color: var(--primary-color);
    font-size: 18px;
}

/* ==================== LAYOUT VIEWPORT ==================== */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 30px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon-sm {
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-header h2 {
    font-size: 20px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 30px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 14px 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-speed) ease;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: hsla(250, 85%, 65%, 0.15);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    transform: none;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 0 10px;
}

.avatar-icon {
    font-size: 32px;
    color: var(--text-muted);
}

.user-details {
    display: flex;
    flex-direction: column;
    max-width: 170px;
}

.user-email {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: hsla(355, 80%, 55%, 0.1);
    color: var(--error-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
}

.btn-logout:hover {
    background: var(--error-color);
    color: white;
}

.content-viewport {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

/* ==================== VIEW 2: DASHBOARD ==================== */
.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 32px;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 28px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-purple .stat-icon { background: hsla(250, 85%, 65%, 0.15); color: var(--primary-color); }
.card-blue .stat-icon { background: hsla(200, 85%, 55%, 0.15); color: hsl(200, 85%, 55%); }
.card-orange .stat-icon { background: hsla(30, 85%, 55%, 0.15); color: hsl(30, 85%, 55%); }

.stat-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.section-title {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.quick-exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.exam-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exam-card-icon {
    font-size: 32px;
    color: var(--primary-color);
}

.exam-card h4 {
    font-size: 22px;
}

.exam-card p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 600px;
}

.exam-card .btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 10px;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px hsla(250, 85%, 65%, 0.15);
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.unit-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
}

.unit-card .u-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.unit-num-badge {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    background: hsla(250, 85%, 65%, 0.15);
    color: var(--primary-color);
}

.unit-card h4 {
    font-size: 18px;
    margin-top: 14px;
    line-height: 1.3;
}

.unit-card .u-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.unit-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

/* Unit Progress Bar Styles */
.unit-progress-container {
    margin-top: auto;
    margin-bottom: 12px;
}

.unit-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.unit-progress-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.unit-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ==================== VIEW 3: EXAM SETUP ==================== */
.setup-container {
    padding: 40px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-weight: 600;
}

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

.setup-container h2 {
    font-size: 28px;
    margin-bottom: 6px;
}

.setup-container p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-bubble {
    background: hsla(200, 85%, 55%, 0.08);
    border: 1px solid hsla(200, 85%, 55%, 0.2);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-bubble i {
    color: hsl(200, 85%, 55%);
    font-size: 18px;
    margin-top: 2px;
}

/* ==================== VIEW 4: ACTIVE EXAM ==================== */
.exam-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.exam-question-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 500px;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-dark);
    font-size: 13px;
}

.badge-purple { background: hsla(250, 85%, 65%, 0.15); color: var(--primary-color); }

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

.timer-wrapper i {
    color: var(--accent-color);
}

.progress-container {
    background: hsla(225, 15%, 20%, 0.6);
    height: 6px;
    border-radius: 3px;
    width: 100%;
    overflow: hidden;
}

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

.question-body {
    flex: 1;
}

.q-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.q-header .q-num {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    background: var(--primary-color);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.q-header h3 {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
    margin-top: 4px;
}

.sub-options-box {
    background: hsla(145, 60%, 28%, 0.05);
    border: 1px dashed var(--primary-color);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sub-options-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-opt-item {
    font-size: 15px;
    color: var(--text-primary);
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.sub-opt-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.option-btn .opt-prefix {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    background: var(--border-color);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.option-btn .opt-text {
    font-size: 15px;
    font-weight: 500;
}

.option-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
}

.option-btn.selected {
    background: var(--primary-glow);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.option-btn.selected .opt-prefix {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Response correctness classes */
.option-btn.correct {
    background: var(--success-glow);
    border-color: var(--success-color);
}
.option-btn.correct .opt-prefix {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.option-btn.incorrect {
    background: var(--error-glow);
    border-color: var(--error-color);
}
.option-btn.incorrect .opt-prefix {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.explanation-box {
    margin-top: 30px;
    padding: 20px;
    background: hsla(145, 60%, 28%, 0.06);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explanation-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 16px;
}

.explanation-box p {
    font-size: 14px;
    color: var(--text-secondary);
}

.explanation-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.pane-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Right Navigation Pane */
.exam-nav-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.exam-nav-pane h3 {
    font-size: 18px;
    text-align: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.grid-btn {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-btn:hover {
    border-color: var(--text-primary);
}

.grid-btn.current {
    border-color: var(--primary-color);
    background: var(--primary-glow);
    color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.grid-btn.answered {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.grid-btn.flagged {
    position: relative;
}

.grid-btn.flagged::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.current { border: 1px solid var(--primary-color); background: var(--primary-glow); }
.dot.answered { background: var(--primary-color); }
.dot.flagged { background: var(--accent-color); }

/* ==================== VIEW 5: EXAM RESULTS ==================== */
.results-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    margin-bottom: 40px;
}

.results-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 8px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 30px var(--primary-glow);
}

.results-circle .percentage {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
}

.results-circle .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-stats h2 {
    font-size: 32px;
    margin-bottom: 4px;
}

.results-stats p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.stat-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-pill.correct { background: hsla(145, 80%, 45%, 0.15); color: var(--success-color); }
.stat-pill.incorrect { background: hsla(355, 80%, 55%, 0.15); color: var(--error-color); }

.results-stats .actions {
    display: flex;
    gap: 12px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    border-left: 4px solid var(--border-color);
    padding: 24px;
}

.review-item.correct { border-left-color: var(--success-color); }
.review-item.incorrect { border-left-color: var(--error-color); }

.review-q-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
}

.review-q-header h4 {
    font-size: 18px;
    line-height: 1.4;
}

.review-q-status {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.review-q-status.correct { color: var(--success-color); }
.review-q-status.incorrect { color: var(--error-color); }

.review-sub-options {
    background: var(--bg-dark);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.review-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.choice-pill {
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.choice-pill.user-selected {
    border-color: var(--error-color);
    background: hsla(355, 80%, 55%, 0.05);
    color: var(--error-color);
}

.choice-pill.correct-answer {
    border-color: var(--success-color);
    background: hsla(145, 80%, 45%, 0.05);
    color: var(--success-color);
}

.review-expl {
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.review-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

/* ==================== VIEW 6: BOOKMARKS ==================== */
.bookmarks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.bookmarks-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.bookmark-card {
    border-left: 4px solid var(--primary-color);
}

.bookmark-q {
    font-size: 18px;
    margin-bottom: 14px;
}

.bookmark-card .actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* ==================== VIEW 7: BULK UPLOAD ==================== */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background: hsla(250, 85%, 65%, 0.02);
}

.cloud-icon {
    font-size: 48px;
    color: var(--text-muted);
}

.upload-dropzone h3 {
    font-size: 20px;
}

.upload-dropzone p {
    color: var(--text-muted);
    font-size: 14px;
}

.upload-dropzone .or {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.selected-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.selected-file-info .file-icon {
    font-size: 24px;
    color: var(--primary-color);
}

.selected-file-info .f-details {
    flex: 1;
    margin: 0 16px;
    display: flex;
    flex-direction: column;
}

.selected-file-info .f-name {
    font-weight: 600;
    font-size: 14px;
}

.selected-file-info .f-size {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-info-card h3 {
    font-size: 18px;
    margin-bottom: 14px;
}

.upload-info-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.tabs-mini {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.tab-mini {
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.code-box {
    background: hsl(225, 25%, 7%);
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 12px;
    color: hsl(120, 40%, 65%);
    border: 1px solid var(--border-color);
    max-height: 250px;
    margin-bottom: 20px;
}

.info-alert {
    background: hsla(30, 85%, 55%, 0.08);
    border: 1px solid hsla(30, 85%, 55%, 0.2);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    align-items: flex-start;
}

.info-alert i {
    color: hsl(30, 85%, 55%);
    font-size: 16px;
}

/* ==================== GLOBAL MODALS ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 24px;
}

.options-grid-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opt-input-wrapper {
    display: flex;
    width: 100%;
}

.opt-input-wrapper .prefix {
    width: 44px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-secondary);
}

.opt-input-wrapper input {
    flex: 1;
    border-radius: 0 10px 10px 0;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.opt-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.edit-sub-opt-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.edit-sub-opt-row .sub-prefix {
    font-family: monospace;
    font-weight: 600;
    width: 20px;
}

.edit-sub-opt-row input {
    flex: 1;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

.edit-sub-opt-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-remove-sub-opt {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 18px;
}

.btn-remove-sub-opt:hover {
    color: hsl(355, 80%, 65%);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 991px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar-header h2, .sidebar-footer .user-details, .btn-logout span {
        display: none;
    }
    
    .logo-icon-sm {
        font-size: 28px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
        border-radius: 50%;
        margin: 0 auto;
        width: 50px;
        height: 50px;
    }
    
    .nav-item.active {
        border-left: none;
        border-radius: 50%;
        background: var(--primary-color);
        color: white;
    }
    
    .content-viewport {
        margin-left: 80px;
        padding: 24px;
    }
    
    .exam-layout {
        grid-template-columns: 1fr;
    }
    
    .grid-container {
        grid-template-columns: repeat(10, 1fr);
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 64px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        border-left: none;
        border-right: none;
        border-radius: 0;
        z-index: 1000;
        background: var(--bg-card);
        backdrop-filter: blur(10px);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        flex: 1;
        margin: 0;
        gap: 8px;
        height: 100%;
    }
    
    .nav-item {
        width: auto;
        height: auto;
        border-radius: 8px;
        padding: 6px 12px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        margin: 0;
        flex: 1;
    }
    
    .nav-item i {
        font-size: 18px;
        margin: 0;
        width: auto;
    }
    
    .nav-item span {
        display: block !important;
        font-size: 10px;
        font-weight: 600;
    }
    
    .nav-item:hover, .nav-item.active {
        transform: none;
    }
    
    .nav-item.active {
        border-left: none;
        border-radius: 8px;
        background: var(--primary-glow);
        color: var(--primary-color);
    }
    
    .sidebar-footer {
        display: flex;
        padding: 0;
        border-top: none;
        margin: 0;
        align-items: center;
    }
    
    .sidebar-footer .user-info {
        display: none;
    }
    
    .sidebar-footer .btn-logout {
        width: auto;
        padding: 10px;
        border: none;
        background: none;
        color: var(--error-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        gap: 2px;
    }
    
    .sidebar-footer .btn-logout span {
        display: block !important;
        font-size: 10px;
        font-weight: 600;
    }
    
    .content-viewport {
        margin-left: 0;
        padding: 20px 20px 90px 20px;
        height: auto;
        min-height: calc(100vh - 64px);
    }
    
    /* Collapsible Question Map Grid placement on mobile */
    .exam-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }
    
    .exam-nav-pane {
        order: 2; /* Put map grid below the question pane */
    }
    
    .exam-pane {
        order: 1;
    }
    
    .grid-container {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .results-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-container {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .section-header h2 {
        font-size: 26px;
    }
    
    .pane-footer {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .pane-footer button {
        flex: 1;
    }
}

/* ==================== ADMIN PANEL ==================== */
.admin-table th, .admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background: hsla(39, 100%, 50%, 0.15);
    color: hsl(39, 100%, 50%);
}

.status-badge.approved {
    background: hsla(145, 63%, 42%, 0.15);
    color: hsl(145, 63%, 42%);
}

.status-badge.rejected {
    background: hsla(339, 81%, 55%, 0.15);
    color: hsl(339, 81%, 55%);
}
