/* 
   Goldfrank Toxicology QBank Stylesheet
   Premium UWorld/Rosh Review Theme (Sleek Dark Mode by default)
*/

:root {
    /* Color Palette Variables (HSL for curated, premium styling) */
    --bg-base: hsl(222, 47%, 10%); /* Deep Navy/Slate Black */
    --bg-surface: hsla(217, 33%, 17%, 0.65); /* Glassmorphic Surface */
    --bg-surface-hover: hsla(217, 33%, 22%, 0.85);
    --border-color: hsla(217, 33%, 25%, 0.4);
    --border-color-glow: hsla(172, 66%, 50%, 0.4);
    
    --primary: hsl(172, 66%, 50%); /* Bright Teal Accent */
    --primary-hover: hsl(172, 66%, 40%);
    --primary-glow: hsla(172, 66%, 50%, 0.15);
    
    --secondary: hsl(190, 90%, 50%); /* Electric Cyan Accent */
    --secondary-hover: hsl(190, 90%, 40%);
    
    --accent-amber: hsl(38, 92%, 50%); /* Amber for Timer/Flag */
    --accent-danger: hsl(355, 78%, 56%); /* Red for errors/incorrects */
    --accent-success: hsl(145, 63%, 49%); /* Green for corrects */
    
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 65%);
    --text-muted: hsl(215, 15%, 45%);
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(172, 66, 50, 0.2);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Theme-specific fixed backgrounds (sidebar and header) */
    --bg-sidebar: rgba(15, 23, 42, 0.95);
    --bg-header: rgba(15, 23, 42, 0.4);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-base: hsl(210, 20%, 95%);
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-glow: rgba(172, 66, 50, 0.5);
    --primary: hsl(172, 66%, 42%);
    --primary-hover: hsl(172, 66%, 34%);
    --primary-glow: rgba(172, 66, 50, 0.1);
    --text-primary: hsl(222, 47%, 12%);
    --text-secondary: hsl(215, 15%, 35%);
    --text-muted: hsl(215, 12%, 55%);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.1);

    /* Light Theme fixed backgrounds */
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-header: rgba(255, 255, 255, 0.4);
}

/* Base Resets & Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    transition: background-color var(--transition-normal);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Scrollbar Customization */
.scrollable::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: all var(--transition-normal);
}

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

.brand-logo {
    font-size: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-item i {
    font-size: 16px;
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item:hover i {
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--primary-glow);
    border: 1px solid var(--border-color-glow);
    color: var(--primary);
    font-weight: 600;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-profile .avatar {
    width: 38px;
    height: 38px;
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
}

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

/* Main Content Workspace */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Navbar */
.app-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-header);
    backdrop-filter: blur(10px);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.streak-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

/* Views Container & Routing system */
.views-wrapper {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.app-view {
    display: none;
    animation: fadeIn var(--transition-normal) forwards;
}

.app-view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: hsl(222, 47%, 10%);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: hsl(355, 78%, 46%);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 10px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 4px 8px;
    font-size: 13px;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card.gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: hsl(222, 47%, 10%);
    border: none;
}

.stat-card.gradient-primary .stat-header span,
.stat-card.gradient-primary .stat-desc {
    color: rgba(15, 23, 42, 0.7);
}

.stat-card.gradient-primary .stat-val {
    color: hsl(222, 47%, 10%);
}

.stat-card.gradient-primary .progress-bar-container {
    background: rgba(15, 23, 42, 0.15);
}

.stat-card.gradient-primary .progress-bar {
    background: hsl(222, 47%, 10%);
}

.bg-glass {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stat-header i {
    font-size: 18px;
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Progress bar styles */
.progress-bar-container {
    height: 6px;
    background: hsla(217, 33%, 25%, 0.4);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

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

/* Dashboard Sections layout */
.dashboard-sections {
    display: flex;
    gap: 32px;
}

.dashboard-block {
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-col { display: flex; flex-direction: column; }
.mt-auto { margin-top: auto; }
.mt-2 { margin-top: 8px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

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

.block-header h2, .dashboard-block h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

/* Search Box element */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
    width: 250px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    width: 100%;
}

/* Tables System */
.table-container {
    overflow-x: auto;
    max-height: 400px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-sidebar);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: hsla(217, 33%, 22%, 0.3);
}

.table-group-header-row {
    background: hsla(217, 33%, 12%, 0.5);
}

.table-group-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--primary);
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Badges and meters */
.badge {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--border-color-glow);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-secondary {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.text-teal { color: var(--primary); }
.text-cyan { color: var(--secondary); }
.text-amber { color: var(--accent-amber); }
.text-danger { color: var(--accent-danger); }
.text-sm { font-size: 12px; color: var(--text-secondary); }

.quick-actions-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    display: flex;
    gap: 12px;
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.15);
    padding: 16px;
    border-radius: 12px;
    margin-top: 24px;
}

.info-card i {
    font-size: 20px;
    margin-top: 2px;
}

.info-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Exam Creator Interface Layout */
.exam-creator-card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.exam-creator-layout {
    display: flex;
    gap: 40px;
}

.creator-left {
    flex: 5;
    border-right: 1px solid var(--border-color);
    padding-right: 40px;
    display: flex;
    flex-direction: column;
    height: 550px;
}

.creator-right {
    flex: 4;
    display: flex;
    flex-direction: column;
    height: 550px;
    overflow-y: auto;
    padding-right: 8px;
}

.categories-selector {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    background: var(--bg-base);
    border-radius: 10px;
    padding: 12px;
}

.category-checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 13px;
    user-select: none;
}

.category-checkbox-item:hover {
    background: var(--bg-surface);
}

.category-checkbox-item input {
    margin-right: 12px;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.category-checkbox-item .cat-q-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

.category-group {
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.category-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-sidebar);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    user-select: none;
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.category-group-header:hover {
    background: var(--bg-surface-hover);
}

.category-group-header i {
    margin-right: 8px;
    font-size: 12px;
    color: var(--primary);
}

.group-badge {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--border-color-glow);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.category-group-content {
    padding: 8px;
    background: var(--bg-base);
}

/* Settings Group elements */
.settings-group {
    margin-bottom: 24px;
}

.setting-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.mode-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-card:hover {
    border-color: var(--text-muted);
    background: hsla(217, 33%, 22%, 0.2);
}

.mode-card.active {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.mode-card i {
    font-size: 24px;
    color: var(--text-muted);
    width: 32px;
    text-align: center;
}

.mode-card.active i {
    color: var(--primary);
}

.mode-info h3 {
    font-size: 14px;
    font-weight: 600;
}

.mode-info p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.pool-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.pool-checkbox {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.pool-checkbox input {
    margin-right: 10px;
    accent-color: var(--primary);
}

.pool-checkbox.active {
    border-color: var(--primary);
    background: var(--primary-glow);
}

/* Slider Controls */
.label-with-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-container {
    margin-top: 8px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    accent-color: var(--primary);
}

.slider-limits {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.input-fallback-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-fallback-container input {
    width: 70px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 4px 8px;
    outline: none;
    font-size: 13px;
    text-align: center;
}

/* Active Examination Interface */
.exam-layout {
    display: flex;
    gap: 32px;
    height: calc(100vh - var(--header-height) - 64px);
    overflow: hidden;
}

.exam-left-panel {
    flex: 3;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.exam-panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-meta-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-display {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-amber);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
}

.exam-question-body {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
}

.question-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.qbank-question-image-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.qbank-question-image {
    max-width: 100%;
    max-height: 450px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    background: hsla(217, 33%, 12%, 0.2);
    display: block;
    object-fit: contain;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.qbank-question-image:hover {
    transform: scale(1.015);
    border-color: var(--primary);
}

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

/* Choice card */
.choice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    line-height: 1.5;
}

.choice-card:hover {
    border-color: var(--text-secondary);
    background: var(--bg-surface-hover);
}

.choice-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.choice-card:hover .choice-letter {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.choice-card.selected {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.choice-card.selected .choice-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: hsl(222, 47%, 10%);
}

/* Tutor Mode Results classes */
.choice-card.correct {
    border-color: var(--accent-success);
    background: rgba(34, 197, 94, 0.08);
}

.choice-card.correct .choice-letter {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #fff;
}

.choice-card.incorrect {
    border-color: var(--accent-danger);
    background: rgba(244, 63, 94, 0.08);
}

.choice-card.incorrect .choice-letter {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #fff;
}

/* Explanation Block (Tutor/Results view) */
.explanation-box {
    background: rgba(20, 184, 166, 0.04);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    animation: slideUp var(--transition-normal) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(20, 184, 166, 0.15);
    padding-bottom: 8px;
}

.explanation-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.correct-answer-label {
    margin-bottom: 12px;
    font-size: 15px;
}

/* Exam navigation panel */
.exam-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.ml-auto { margin-left: auto; }

/* Right Panel: Navigator Grid */
.exam-right-panel {
    width: 250px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.navigator-header {
    margin-bottom: 16px;
}

.navigator-header h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.navigator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-content: start;
    gap: 10px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-grid-btn {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

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

.nav-grid-btn.active {
    border: 2px solid var(--primary);
    color: var(--text-primary);
}

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

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

/* Nav grid feedback states (Review Mode) */
.nav-grid-btn.correct {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
    border-color: rgba(34, 197, 94, 0.3);
}

.nav-grid-btn.incorrect {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-danger);
    border-color: rgba(244, 63, 94, 0.3);
}

.navigator-legend {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-dot.unanswered { background: var(--bg-base); border: 1px solid var(--border-color); }
.legend-dot.answered { background: var(--primary-glow); border: 1px solid var(--border-color-glow); }
.legend-dot.flagged { background: var(--accent-amber); }

/* Results Score Panel layout */
.results-layout {
    display: flex;
    gap: 40px;
}

.results-left {
    flex: 4;
    min-width: 0;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.results-right {
    flex: 5;
    min-width: 0;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 32px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

/* Circular score meter */
.results-circle-container {
    width: 180px;
    height: 180px;
    position: relative;
    margin-bottom: 24px;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--bg-base);
    stroke-width: 8;
}

.circle-fg {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circle-text span:first-child {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.circle-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.results-score-breakdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.breakdown-row .val {
    font-weight: 700;
}

.questions-review-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding-right: 4px;
}

.review-item-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 0;
}

.review-item-card:hover {
    border-color: var(--text-secondary);
}

.review-item-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.review-item-status.correct {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
}

.review-item-status.incorrect {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-danger);
}

.review-item-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    min-width: 0;
}

.review-item-badge {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   11. Authorization Lock Screen (Glassmorphism)
   ========================================================================== */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), rgba(7, 10, 19, 0.99));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: opacity var(--transition-normal);
}

.password-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.password-card h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.password-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.password-input-group {
    position: relative;
    margin-bottom: 20px;
}

.password-input-group input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    transition: all var(--transition-fast);
}

.password-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.password-input-group input::placeholder {
    letter-spacing: normal;
    color: var(--text-muted);
}

.password-error {
    color: var(--accent-danger);
    font-size: 13px;
    margin-top: 16px;
    font-weight: 500;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.mb-4 { margin-bottom: 16px; }
.mt-6 { margin-top: 24px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ==========================================================================
   12. Multi-Profile Selector & Modal (Netflix style)
   ========================================================================== */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.96), rgba(7, 10, 19, 0.99));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    padding: 20px;
    transition: opacity var(--transition-normal);
}

.profile-selection-card {
    width: 100%;
    max-width: 800px;
    text-align: center;
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-selection-card h2 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 120px;
    position: relative;
    user-select: none;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 24px; /* Slightly rounded squares like Netflix */
    background: rgba(30, 41, 59, 0.4);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    position: relative;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-item:hover .profile-avatar {
    transform: scale(1.08) translateY(-5px);
    border-color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow, rgba(20, 184, 166, 0.4));
}

.profile-name {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.profile-item:hover .profile-name {
    color: var(--text-primary);
}

/* Special Add Profile Button styling */
.add-avatar {
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
}

.profile-item:hover .add-avatar {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    border-style: solid;
}

/* Delete badge */
.delete-profile-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: transparent;
    border: none;
    color: var(--accent-danger);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 10;
    transition: transform var(--transition-fast);
}

.delete-profile-badge:hover {
    transform: scale(1.2);
}

.profile-actions-row {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Modal Overlay & Card (Glassmorphism Modal System) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-2xl), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

.modal-body {
    padding: 28px;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.modal-input:focus {
    border-color: var(--primary);
}

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

/* Avatar Theme Selector */
.avatar-theme-selector {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.avatar-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.avatar-color-dot:hover {
    transform: scale(1.1);
}

.avatar-color-dot.active {
    border-color: #fff;
    transform: scale(1.15);
}

/* ==========================================================================
   13. Exam Prep Tools (Highlighting & Strike-through) & Charts
   ========================================================================== */
.custom-highlight {
    background-color: rgba(245, 158, 11, 0.35); /* Translucent Amber */
    border-radius: 4px;
    padding: 2px 4px;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.choice-card.stricken {
    opacity: 0.35 !important;
    pointer-events: auto; /* Allow click and right-click to still toggle */
}

.choice-card.stricken .choice-letter,
.choice-card.stricken .choice-text {
    text-decoration: line-through;
    color: var(--text-muted) !important;
}

/* Performance Trend SVG styling */
#performance-trend-svg path.trend-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

#performance-trend-svg circle.trend-point {
    fill: var(--primary);
    stroke: var(--bg-base);
    stroke-width: 2;
    cursor: pointer;
    transition: transform var(--transition-fast), fill var(--transition-fast);
}

#performance-trend-svg circle.trend-point:hover {
    transform: scale(1.3);
    fill: var(--secondary);
}

#performance-trend-svg line.grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

#performance-trend-svg text.axis-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-body);
    font-weight: 500;
}

/* ==========================================================================
   13.5. Immersion Mode (Maximizing Viewport for Exams and Reviews)
   ========================================================================== */
.immersion-mode .app-sidebar {
    display: none !important;
}

.immersion-mode .app-header {
    display: none !important;
}

.immersion-mode .app-main {
    height: 100vh !important;
    margin-bottom: 0 !important; /* Clear bottom nav space */
}

/* In immersion mode, we remove padding completely from views-wrapper to allow full-screen layout */
.immersion-mode .views-wrapper {
    padding: 0 !important;
    height: 100vh !important;
}

.immersion-mode .exam-layout {
    height: 100vh !important;
    gap: 0 !important;
}

.immersion-mode .exam-left-panel {
    border: none !important;
    border-radius: 0 !important;
    height: 100vh !important;
}

.immersion-mode .exam-right-panel {
    border: none !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--border-color) !important;
    height: 100vh !important;
}

.immersion-mode .results-layout {
    padding: 24px;
    height: 100vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .immersion-mode .views-wrapper {
        padding: 0 !important;
    }
    
    .immersion-mode .results-layout {
        padding: 16px;
    }
}

/* ==========================================================================
   14. Mobile Responsiveness Queries
   ========================================================================== */
@media (max-width: 768px) {
    /* Base reset for body overflow to allow vertical scrolling on mobile */
    body {
        overflow-y: auto;
        height: auto;
    }
    
    .app-container {
        flex-direction: column-reverse; /* Bottom navigation style */
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    /* Convert sidebar to a Bottom Navigation bar */
    .app-sidebar {
        width: 100%;
        height: 60px;
        position: fixed;
        bottom: 0;
        left: 0;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        background: var(--bg-sidebar);
        padding: 0;
        z-index: 1000;
        justify-content: space-between;
    }
    
    .sidebar-brand {
        display: none; /* Hide logo on bottom navbar */
    }
    
    .sidebar-nav {
        flex-direction: row;
        padding: 0;
        gap: 0;
        flex-grow: 1;
        justify-content: space-around;
        align-items: center;
        height: 100%;
    }
    
    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 10px;
        font-weight: 600;
        border-radius: 0;
        border: none !important;
        background: transparent !important;
        color: var(--text-secondary);
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item:hover i {
        transform: none;
    }
    
    .nav-item.active {
        color: var(--primary);
    }
    
    .sidebar-footer {
        padding: 0;
        border-top: none;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
    }
    
    .user-profile {
        padding: 6px;
        border: none;
        background: transparent;
    }
    
    .user-profile .avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .user-info {
        display: none; /* Hide profile info text on bottom navbar */
    }
    
    /* Workspace container adjustments */
    .app-main {
        height: auto;
        min-height: calc(100vh - 60px);
        margin-bottom: 60px; /* Leave space for bottom nav */
        overflow: visible;
    }
    
    .app-header {
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .views-wrapper {
        padding: 16px;
        overflow-y: visible;
        height: auto;
    }
    
    /* Dashboard Grid & Blocks */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .dashboard-sections {
        flex-direction: column;
        gap: 16px;
    }
    
    .dashboard-block {
        padding: 16px;
    }
    
    .block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .table th, .table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    /* Hide Completed and Performance columns on mobile */
    #dash-categories-table th:nth-child(2),
    #dash-categories-table td:nth-child(2),
    #dash-categories-table th:nth-child(4),
    #dash-categories-table td:nth-child(4) {
        display: none;
    }
    
    /* Exam Creator View */
    .exam-creator-card {
        padding: 16px;
    }
    
    .exam-creator-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .creator-left, .creator-right {
        border-right: none;
        padding-right: 0;
        height: auto;
    }
    
    .categories-selector {
        height: 300px;
    }
    
    .slider-container {
        padding: 8px 0;
    }
    
    /* Active Exam View */
    .exam-layout {
        position: relative;
        flex-direction: column;
        gap: 0 !important;
        height: 100vh !important;
        overflow: hidden;
    }
    
    .exam-left-panel {
        padding: 0 !important;
        height: 100vh !important;
        display: flex;
        flex-direction: column;
        border: none !important;
        border-radius: 0 !important;
    }
    
    .exam-panel-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 16px !important;
        gap: 8px !important;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-sidebar);
    }
    
    .question-meta-info {
        display: flex;
        align-items: center;
        gap: 6px !important;
        min-width: 0;
        flex-shrink: 1;
    }
    
    #exam-q-category {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px !important;
        padding: 3px 8px !important;
    }
    
    #exam-q-number-indicator {
        font-size: 10px !important;
        padding: 3px 8px !important;
        white-space: nowrap;
    }
    
    .exam-panel-header .header-tools {
        width: auto !important;
        gap: 8px !important;
        flex-shrink: 0;
    }
    
    .exam-panel-header .header-tools .btn-text {
        display: none !important;
    }
    
    .exam-panel-header .header-tools button {
        padding: 0 !important;
        width: 34px !important;
        height: 34px !important;
        justify-content: center !important;
        border-radius: 50% !important;
        font-size: 12px !important;
        gap: 0 !important;
    }
    
    .exam-panel-header .header-tools .mobile-only-btn {
        display: flex !important;
    }
    
    .timer-display {
        font-size: 12px !important;
        padding: 4px 10px !important;
        gap: 4px !important;
    }
    
    .exam-question-body {
        flex-grow: 1;
        padding: 20px 16px !important;
        overflow-y: auto !important;
    }
    
    .question-text {
        font-size: 15px !important;
        line-height: 1.5;
        margin-bottom: 20px !important;
    }
    
    .choices-container {
        gap: 10px !important;
        margin-bottom: 24px !important;
    }
    
    .choice-card {
        padding: 12px 16px !important;
        gap: 12px !important;
        font-size: 13px !important;
    }
    
    .choice-letter {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
    
    /* Exam Actions Footer mobile pinning */
    .exam-panel-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 12px 16px !important;
        background: var(--bg-sidebar);
        border-top: 1px solid var(--border-color);
        margin-top: auto;
    }
    
    .exam-panel-footer button {
        font-size: 12px !important;
        padding: 10px 12px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        margin: 0 !important;
    }
    
    #exam-btn-prev {
        order: 1 !important;
        width: 100% !important;
    }
    
    #exam-btn-next {
        order: 2 !important;
        width: 100% !important;
    }
    
    #exam-btn-flag {
        order: 3 !important;
        width: 100% !important;
    }
    
    #exam-btn-pause {
        order: 4 !important;
        width: 100% !important;
    }
    
    #exam-btn-submit-exam {
        order: 5 !important;
        grid-column: span 2 !important;
        width: 100% !important;
    }
    
    /* Navigator sliding drawer on mobile */
    .exam-right-panel {
        position: fixed !important;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh !important;
        z-index: 1001;
        background: var(--bg-sidebar);
        border: none !important;
        border-radius: 0 !important;
        border-left: 1px solid var(--border-color) !important;
        padding: 20px !important;
        transition: right var(--transition-normal);
        display: flex !important;
        flex-direction: column;
    }
    
    .exam-layout.show-navigator .exam-right-panel {
        right: 0;
    }
    
    .exam-right-panel .mobile-only-btn {
        display: block !important;
    }
    
    .navigator-grid {
        max-height: calc(100% - 140px) !important;
        grid-template-columns: repeat(4, 1fr) !important;
        overflow-y: auto !important;
    }
    
    .navigator-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-normal);
    }
    
    .exam-layout.show-navigator .navigator-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Results View */
    .results-layout {
        flex-direction: column;
        gap: 16px;
    }
    
    .results-left, .results-right {
        width: 100%;
        padding: 16px;
    }
    
    .results-circle-container {
        margin: 0 auto 16px auto;
    }
    
    /* Modals & Dialogs */
    .modal-card {
        width: 95%;
        padding: 16px;
    }
    
    /* Question Images Mobile Scale-down */
    .qbank-question-image-container {
        margin: 12px 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .qbank-question-image {
        max-width: 100%;
        max-height: 250px;
        height: auto;
        object-fit: contain;
    }
    
    .zoom-close-btn {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.5);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
}

/* Image Zoom Modal */
#image-zoom-modal {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zoom-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    object-fit: contain;
}

.zoom-close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.zoom-close-btn:hover {
    opacity: 0.8;
}
