@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Premium Dark Theme */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-surface: rgba(25, 25, 35, 0.6);
  --bg-surface-hover: rgba(35, 35, 50, 0.8);
  
  --text-primary: #ffffff;
  --text-secondary: #a0a5ba;
  --text-muted: #6b7280;

  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --accent-glow: rgba(99, 102, 241, 0.4);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --glass-bg: rgba(18, 18, 26, 0.65);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-surface: rgba(241, 245, 249, 0.6);
  --bg-surface-hover: rgba(226, 232, 240, 0.8);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: rgba(15, 23, 42, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 23, 42, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.12), transparent 25%);
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="1" cy="1" r="1" fill="rgba(128,128,128,0.05)"/></svg>');
  pointer-events: none;
  z-index: -1;
}

.theme-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.theme-toggle:hover {
  background: var(--bg-surface-hover);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}
[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon,
:root:not([data-theme="light"]) .theme-toggle .moon-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun-icon,
:root:not([data-theme="light"]) .theme-toggle .sun-icon {
  display: block;
}

button, input, textarea, select {
  font: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 20px 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.primary-btn {
  background: var(--accent-gradient);
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: 12px;
}

.primary-btn:hover::before {
  opacity: 1;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
}

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

.danger-btn {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
}

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

.text-btn {
  color: var(--accent-primary);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.text-btn:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.input-group input, .input-group textarea, .input-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px;
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.input-group input::placeholder, .input-group textarea::placeholder {
  color: var(--text-muted);
}

.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg-primary);
}

/* Radio indicator for correct answer in inputs */
.relative-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.relative-input input[type="text"], .relative-input input:not([type]) {
  width: 100%;
}
.radio-indicator {
  position: absolute;
  right: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-indicator input[type="radio"] {
  display: none;
}
.radio-indicator .radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  transition: all 0.2s ease;
}
.radio-indicator input[type="radio"]:checked + .radio-circle {
  border-color: var(--success);
  background: var(--success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
.radio-indicator input[type="radio"]:checked + .radio-circle::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  margin: 5px auto;
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 40px;
}

/* --- Auth/Login Specific --- */
.auth-layout {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  width: 100%;
  min-height: 600px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.auth-banner {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #151525 100%);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-right: 1px solid var(--border-color);
}

[data-theme="light"] .auth-banner {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #e2e8f0 100%);
}

.auth-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at top right, rgba(99,102,241,0.2), transparent 50%);
  pointer-events: none;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: white;
  padding: 6px;
}

.auth-copy h1 {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.1;
}

.auth-copy p {
  color: var(--text-secondary);
  font-size: 18px;
}

.auth-form-wrapper {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

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

.auth-header h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

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

.auth-hint {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}

.auth-hint .text-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent-primary);
  white-space: nowrap;
}

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

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
  }
  .auth-banner {
    display: none;
  }
  .auth-form-wrapper {
    padding: 40px 24px;
  }
}

/* --- Student Workspace (Test Interface) --- */
.workspace {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

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

.student-info .name {
  font-weight: 700;
  font-size: 18px;
}

.student-info .progress {
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 600;
}

.timer {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--glass-bg);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.question-card {
  padding: 40px;
}

.question-text {
  font-size: 24px;
  margin-bottom: 30px;
  line-height: 1.4;
}

.question-media {
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #fff; /* For contrast with SVGs/images */
  display: flex;
  justify-content: center;
  padding: 20px;
}

.question-media img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.options-grid {
  display: grid;
  gap: 16px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.option-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
  transform: translateX(4px);
}

.option-btn.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border-radius: 10px;
  font-weight: 700;
  color: var(--accent-primary);
}

.option-btn.selected .option-letter {
  background: var(--accent-gradient);
  color: white;
}

.test-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

/* Result Panel */
.result-panel {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.success-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.result-panel h2 {
  font-size: 36px;
  margin-bottom: 16px;
}

.result-panel p {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 32px;
}


/* --- Admin Dashboard --- */
.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
}

.sidebar .auth-brand {
  margin-bottom: 40px;
  font-size: 22px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item:hover svg {
  transform: scale(1.1);
  color: var(--accent-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.nav-item.active svg {
  color: var(--accent-primary);
}

.admin-main {
  padding: 40px;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.03) 100%);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px 30px;
  margin-bottom: 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 300px; height: 100%;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
}

.welcome-text h2 {
  font-size: 26px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.welcome-text p {
  color: var(--text-secondary);
  font-size: 15px;
}

.welcome-meta {
  text-align: right;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

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

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px !important;
  border-radius: 20px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
  transition: transform 0.6s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-focus);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.12);
}

.stat-card:hover::before {
  transform: translate(10%, 10%);
}

.stat-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Recent Activity Panel */
.recent-activity-panel {
  margin-top: 30px;
}

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

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.activity-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
  transform: translateX(4px);
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.activity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.activity-details {
  display: flex;
  flex-direction: column;
}

.activity-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.activity-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
}

.activity-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.activity-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.activity-score {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1200px) {
  .admin-grid {
    grid-template-columns: 350px 1fr;
  }
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

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

/* Lists and Tables */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.item-details strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--glass-bg);
}
.status-active { color: var(--success); background: var(--success-bg); }
.status-inactive { color: var(--text-secondary); background: rgba(255,255,255,0.05); }

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 15px;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Mobile Optimizations --- */
@media (max-width: 600px) {
  body {
    padding: 0;
  }
  
  .auth-layout {
    padding: 0;
    margin: 0;
    align-items: flex-start;
  }

  .workspace {
    padding: 0 16px;
    margin: 20px auto;
  }

  .form-row-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-container, .glass-panel, .test-header {
    width: 100%;
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }
  
  .auth-container {
    min-height: 100vh;
    border-bottom: none;
  }

  .auth-form-wrapper, .question-card, .result-panel {
    padding: 30px 20px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .test-actions {
    flex-direction: column-reverse;
    gap: 16px;
  }
  
  .test-actions button {
    width: 100%;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
  }

  .auth-header h2 { font-size: 26px; }
  .question-text { font-size: 20px; margin-bottom: 24px; }
  .result-panel h2 { font-size: 28px; }
  
  .timer {
    font-size: 18px;
    padding: 6px 12px;
  }
  
  .student-info .name {
    font-size: 16px;
  }
  
  /* Admin adjustments */
  .admin-layout {
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .admin-main {
    padding: 20px;
  }
  .panel-header h3 { font-size: 18px; }
  
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .nav-item {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    font-size: 13px;
    padding: 10px 8px;
  }
}

/* Custom Flatpickr Styles */
.flatpickr-calendar {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 16px !important;
  padding: 10px !important;
  font-family: var(--font-main) !important;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after {
  display: none !important;
}
.flatpickr-month, .flatpickr-current-month, .flatpickr-weekday {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}
span.flatpickr-weekday {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}
.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  border: none !important;
  transition: all 0.2s ease !important;
}
.flatpickr-day:hover {
  background: var(--bg-surface-hover) !important;
}
.flatpickr-day.selected {
  background: var(--accent-primary) !important;
  color: white !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 4px 10px var(--accent-glow) !important;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: var(--text-muted) !important;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--accent-primary) !important;
}

.flatpickr-monthDropdown-months {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  outline: none !important;
  padding: 2px 4px !important;
  cursor: pointer;
}
.flatpickr-monthDropdown-months:hover {
  background: var(--bg-surface-hover) !important;
}
.flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}
.flatpickr-current-month input.cur-year {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}
.flatpickr-current-month input.cur-year:hover {
  background: var(--bg-surface-hover) !important;
}

/* Modal and Details view styles */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-content {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 30px !important;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 24px;
  margin-bottom: 4px;
}
.close-btn {
  font-size: 32px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.close-btn:hover {
  color: var(--text-primary);
}
.modal-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 8px;
}
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.detail-question-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}
.detail-question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.detail-question-text {
  font-size: 16px;
  font-weight: 600;
}
.detail-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .detail-options-list {
    grid-template-columns: 1fr;
  }
}
.detail-option {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-option-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  background: var(--bg-surface);
}
.detail-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
}
.detail-option.correct .detail-option-badge {
  background: var(--success);
  color: white;
}
.detail-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.detail-option.incorrect .detail-option-badge {
  background: var(--danger);
  color: white;
}

/* Custom file upload button styles */
.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
}
.file-upload-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Live Proctoring indicator styles */
.live-dot {
  width: 10px;
  height: 10px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--success);
}
.pulse-glow {
  animation: livePulse 1.5s infinite alternate;
}
@keyframes livePulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 6px var(--success);
  }
  100% {
    transform: scale(1.2);
    box-shadow: 0 0 16px var(--success);
  }
}
