/* =============================================
   QUIZ APP v2 — MODERN DESIGN SYSTEM
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0f0e17;
  --bg-secondary: #1a1932;
  --bg-card: rgba(30, 29, 54, 0.75);
  --bg-card-hover: rgba(40, 39, 70, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);

  --text-primary: #fffffe;
  --text-secondary: #a7a9be;
  --text-muted: #6b6d85;

  --accent-primary: #7f5af0;
  --accent-primary-hover: #6b46e0;
  --accent-secondary: #2cb67d;
  --accent-tertiary: #ff6b6b;
  --accent-warning: #ffc857;
  --accent-info: #56c1f5;

  --gradient-primary: linear-gradient(135deg, #7f5af0 0%, #2cb67d 100%);
  --gradient-accent: linear-gradient(135deg, #7f5af0 0%, #e056a0 100%);
  --gradient-bg: linear-gradient(180deg, #0f0e17 0%, #1a1932 50%, #0f0e17 100%);

  --border-color: rgba(127, 90, 240, 0.15);
  --border-color-hover: rgba(127, 90, 240, 0.35);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(127, 90, 240, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(127, 90, 240, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(44, 182, 125, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(224, 86, 160, 0.04) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary-hover); }

/* ---------- Typography ---------- */
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }

/* =============================================
   HEADER
   ============================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 14, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.logo:hover { transform: scale(1.03); }

.logo-icon {
  font-size: 1.75rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(127, 90, 240, 0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(127, 90, 240, 0.6)); }
}

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

.tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
  padding: 0.3rem 0.75rem;
  background: rgba(44, 182, 125, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(44, 182, 125, 0.2);
}

/* =============================================
   CONTAINER & SCREENS
   ============================================= */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.screen {
  display: none;
  animation: fadeSlideIn 0.4s var(--transition-slow);
}

.screen.active {
  display: block;
}

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

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* =============================================
   AUTH SCREEN
   ============================================= */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideIn 0.5s ease;
}

.auth-logo {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

.auth-card h2 {
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}

.auth-tab.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(127, 90, 240, 0.3);
}

.auth-form {
  text-align: left;
}

.auth-hint {
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: rgba(44, 182, 125, 0.08);
  border: 1px solid rgba(44, 182, 125, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auth-hint strong {
  color: var(--accent-secondary);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(127, 90, 240, 0.3);
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 20px rgba(127, 90, 240, 0.4);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 16px rgba(127, 90, 240, 0.3);
}
.btn-accent:hover {
  box-shadow: 0 6px 24px rgba(127, 90, 240, 0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.1);
  color: var(--accent-tertiary);
  border: 1px solid rgba(255, 107, 107, 0.2);
}
.btn-danger:hover {
  background: rgba(255, 107, 107, 0.2);
}

.btn-large { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { font-size: 1.1em; }
.btn-back { margin-bottom: 1rem; }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

/* =============================================
   BADGE
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(127, 90, 240, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(127, 90, 240, 0.2);
}

.badge-essay {
  background: rgba(86, 193, 245, 0.12);
  color: var(--accent-info);
  border-color: rgba(86, 193, 245, 0.2);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

/* =============================================
   TOPIC GRID
   ============================================= */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.topic-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.topic-card:hover::before { opacity: 1; }

.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.topic-card-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); flex: 1; }

.topic-card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-card-count { font-size: 0.8rem; color: var(--text-muted); }

.topic-card-actions { display: flex; gap: 0.4rem; }
.topic-card-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 650px; }

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }

/* Modal - Import Large */
.modal-import-lg { max-width: 800px; }

/* =============================================
   IMPORT MODAL — ENHANCED
   ============================================= */

/* Step Indicator */
.import-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
}

.import-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.import-step.active {
  opacity: 1;
}

.import-step.completed {
  opacity: 0.7;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.import-step.active .step-number {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 10px hsla(var(--accent-h), 80%, 60%, 0.4);
}

.import-step.completed .step-number {
  background: hsl(145, 70%, 45%);
  color: white;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.import-step.active .step-label {
  color: var(--text-primary);
}

.import-step-divider {
  width: 40px;
  height: 2px;
  background: var(--border-color);
  margin: 0 0.75rem;
  border-radius: 1px;
}

/* Drag & Drop Zone */
.import-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: var(--bg-glass);
}

.import-dropzone:hover,
.import-dropzone.dragover {
  border-color: hsl(var(--accent-h), 70%, 55%);
  background: hsla(var(--accent-h), 70%, 55%, 0.06);
  transform: scale(1.01);
}

.import-dropzone.dragover {
  border-style: solid;
  box-shadow: 0 0 20px hsla(var(--accent-h), 70%, 55%, 0.2);
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.dropzone-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.dropzone-formats {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.format-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.format-json { background: hsla(210, 80%, 55%, 0.15); color: hsl(210, 80%, 55%); }
.format-txt { background: hsla(35, 80%, 50%, 0.15); color: hsl(35, 80%, 50%); }
.format-csv { background: hsla(145, 70%, 45%, 0.15); color: hsl(145, 70%, 45%); }
.format-excel { background: hsla(160, 80%, 40%, 0.15); color: hsl(160, 80%, 40%); }
.format-word { background: hsla(220, 80%, 55%, 0.15); color: hsl(220, 80%, 55%); }

/* File Info Badge */
.import-file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: hsla(var(--accent-h), 70%, 55%, 0.08);
  border: 1px solid hsla(var(--accent-h), 70%, 55%, 0.2);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
  animation: slideUp 0.3s ease;
}

.file-info-icon { font-size: 1.5rem; }
.file-info-details { flex: 1; }
.file-info-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.file-info-size { font-size: 0.75rem; color: var(--text-muted); }

/* Divider OR */
.import-divider-or {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 1rem;
}

.import-divider-or::before,
.import-divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.import-divider-or span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Format Selector Radio */
.format-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.format-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.format-radio:hover {
  border-color: hsl(var(--accent-h), 70%, 55%);
}

.format-radio.active,
.format-radio:has(input:checked) {
  border-color: hsl(var(--accent-h), 70%, 55%);
  background: hsla(var(--accent-h), 70%, 55%, 0.1);
  color: hsl(var(--accent-h), 70%, 55%);
}

.format-radio input { display: none; }

/* Format Guide */
.import-format-guide {
  margin-top: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.import-format-guide summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-glass);
  transition: background 0.2s;
}

.import-format-guide summary:hover {
  background: hsla(var(--accent-h), 70%, 55%, 0.05);
}

.format-guide-content {
  padding: 1rem;
}

.format-guide-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 0.2rem;
}

.guide-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.guide-tab:hover {
  color: var(--text-primary);
}

.guide-tab.active {
  background: var(--bg-secondary);
  color: hsl(var(--accent-h), 70%, 55%);
  box-shadow: var(--shadow-sm);
}

.guide-panel {
  display: none;
}

.guide-panel.active {
  display: block;
}

.guide-panel pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.75rem;
  overflow-x: auto;
  line-height: 1.5;
  color: var(--text-secondary);
}

.guide-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.guide-table th,
.guide-table td {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.guide-table th {
  background: var(--bg-glass);
  font-weight: 700;
  color: var(--text-secondary);
}

/* Preview Header */
.import-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-stat {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-glass);
  color: var(--text-secondary);
}

.preview-stat.preview-mc {
  background: hsla(210, 80%, 55%, 0.1);
  color: hsl(210, 80%, 55%);
}

.preview-stat.preview-essay {
  background: hsla(35, 80%, 50%, 0.1);
  color: hsl(35, 80%, 50%);
}

.preview-error-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: hsla(0, 80%, 55%, 0.12);
  color: hsl(0, 70%, 55%);
}

/* Preview Table */
.import-preview-table-wrap {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.import-preview-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.import-preview-table th {
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.import-preview-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-primary);
  line-height: 1.4;
}

.import-preview-table tr:hover td {
  background: hsla(var(--accent-h), 70%, 55%, 0.04);
}

.import-preview-table tr.row-error td {
  background: hsla(0, 80%, 55%, 0.06);
}

.import-preview-table .col-num { width: 35px; text-align: center; }
.import-preview-table .col-type { width: 70px; }
.import-preview-table .col-content { min-width: 150px; }
.import-preview-table .col-options { min-width: 120px; font-size: 0.75rem; }
.import-preview-table .col-answer { width: 70px; text-align: center; }
.import-preview-table .col-status { width: 70px; text-align: center; }

.status-ok { color: hsl(145, 70%, 45%); font-weight: 700; }
.status-error { color: hsl(0, 70%, 55%); font-weight: 700; font-size: 0.72rem; }

.type-badge-mc {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: hsla(210, 80%, 55%, 0.15);
  color: hsl(210, 80%, 55%);
}

.type-badge-essay {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: hsla(35, 80%, 50%, 0.15);
  color: hsl(35, 80%, 50%);
}

/* Error details */
.import-error-details {
  background: hsla(0, 80%, 55%, 0.05);
  border: 1px solid hsla(0, 80%, 55%, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.import-error-details h4 {
  font-size: 0.85rem;
  color: hsl(0, 70%, 55%);
  margin-bottom: 0.5rem;
}

.import-error-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.import-error-details li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.import-error-details li::before {
  content: '•';
  position: absolute;
  left: 0.25rem;
  color: hsl(0, 70%, 55%);
}

/* Result Screen */
.import-result-content {
  text-align: center;
  padding: 2rem 1rem;
}

.import-result-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.import-result-content h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.import-result-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.required { color: var(--accent-tertiary); }

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

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

textarea { resize: vertical; min-height: 60px; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.file-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-glass);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 1rem;
}
.file-input:hover { border-color: var(--accent-primary); }

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.option-label, .radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.label-a { background: #7f5af0; }
.label-b { background: #2cb67d; }
.label-c { background: #e056a0; }
.label-d { background: #ffc857; color: #1a1932; }

/* Correct Answer Selector */
.correct-answer-selector {
  display: flex;
  gap: 0.75rem;
}

.radio-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.radio-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-glass);
}

.radio-card input[type="radio"] { display: none; }

.radio-card:has(input:checked) {
  border-color: var(--accent-secondary);
  background: rgba(44, 182, 125, 0.1);
  box-shadow: 0 0 12px rgba(44, 182, 125, 0.2);
}

.radio-label {
  width: 36px; height: 36px;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* =============================================
   QUESTION TYPE SELECTOR
   ============================================= */
.type-selector {
  display: flex;
  gap: 0.75rem;
}

.type-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.type-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-glass);
}

.type-card input[type="radio"] { display: none; }

.type-card.active,
.type-card:has(input:checked) {
  border-color: var(--accent-primary);
  background: rgba(127, 90, 240, 0.1);
  box-shadow: 0 0 12px rgba(127, 90, 240, 0.15);
}

.type-icon { font-size: 1.5rem; }
.type-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }

/* =============================================
   QUESTION FORM CARD
   ============================================= */
.question-form-card {
  margin-bottom: 1.5rem;
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(127, 90, 240, 0.1);
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.question-form-card h3 {
  margin-bottom: 1.25rem;
  color: var(--accent-primary);
}

/* =============================================
   QUESTIONS LIST
   ============================================= */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  animation: fadeSlideIn 0.3s ease;
}

.question-item:hover { border-color: var(--border-color-hover); }

.question-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.question-item-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.question-item-content {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.question-item-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.question-item-option {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.question-item-option.correct {
  color: var(--accent-secondary);
  font-weight: 600;
}

.question-item-option .opt-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.question-item-essay-answer {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(86, 193, 245, 0.06);
  border: 1px solid rgba(86, 193, 245, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--accent-secondary);
}

.question-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.question-item-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* =============================================
   START QUIZ BAR
   ============================================= */
.start-quiz-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 1.5rem;
  background: rgba(15, 14, 23, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  z-index: 50;
  animation: slideUpBar 0.3s ease;
}

@keyframes slideUpBar {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* =============================================
   QUIZ SCREEN
   ============================================= */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.separator { color: var(--text-muted); }

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-glass);
  border-radius: 3px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quiz Card */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  animation: fadeSlideIn 0.4s ease;
}

.question-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.question-content {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Quiz Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-glass);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.quiz-option:hover:not(.disabled) {
  border-color: var(--accent-primary);
  background: rgba(127, 90, 240, 0.08);
  transform: translateX(4px);
}

.quiz-option .opt-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(127, 90, 240, 0.15);
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.quiz-option .opt-text { font-size: 0.95rem; font-weight: 500; flex: 1; }

.quiz-option.selected-correct {
  border-color: var(--accent-secondary);
  background: rgba(44, 182, 125, 0.1);
  animation: correctPulse 0.5s ease;
}
.quiz-option.selected-correct .opt-letter { background: var(--accent-secondary); color: white; }

.quiz-option.selected-wrong {
  border-color: var(--accent-tertiary);
  background: rgba(255, 107, 107, 0.1);
  animation: wrongShake 0.4s ease;
}
.quiz-option.selected-wrong .opt-letter { background: var(--accent-tertiary); color: white; }

.quiz-option.reveal-correct {
  border-color: var(--accent-secondary);
  background: rgba(44, 182, 125, 0.08);
}
.quiz-option.reveal-correct .opt-letter { background: var(--accent-secondary); color: white; }

.quiz-option.disabled { cursor: default; opacity: 0.6; }
.quiz-option.selected-correct.disabled,
.quiz-option.selected-wrong.disabled,
.quiz-option.reveal-correct.disabled { opacity: 1; }

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.quiz-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  animation: fadeSlideIn 0.3s ease;
}

/* =============================================
   ESSAY INPUT
   ============================================= */
.essay-input-area {
  margin-top: 1rem;
  animation: fadeSlideIn 0.3s ease;
}

.essay-input-area textarea {
  min-height: 80px;
  font-size: 1rem;
}

.essay-input-area .btn {
  margin-top: 0.75rem;
}

/* =============================================
   AI RESULT
   ============================================= */
.ai-result {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(127, 90, 240, 0.05);
  border: 1px solid var(--border-color);
  animation: fadeSlideIn 0.4s ease;
}

.ai-result-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ai-result-score {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.ai-result-feedback {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.ai-result-explanation,
.ai-result-example {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.ai-result-example {
  font-style: italic;
  border-left: 3px solid var(--accent-info);
}

.ai-result.correct {
  background: rgba(44, 182, 125, 0.08);
  border-color: rgba(44, 182, 125, 0.2);
}

.ai-result.wrong {
  background: rgba(255, 107, 107, 0.06);
  border-color: rgba(255, 107, 107, 0.2);
}

/* =============================================
   QUESTION EXPLANATION (for MC)
   ============================================= */
.question-explanation {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(86, 193, 245, 0.06);
  border: 1px solid rgba(86, 193, 245, 0.15);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.3s ease;
}

.explanation-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.example-sentence {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--accent-info);
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-info);
}

/* =============================================
   AI LOADING
   ============================================= */
.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: var(--text-secondary);
  animation: fadeIn 0.2s ease;
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   RESULTS SCREEN
   ============================================= */
.results-card {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  animation: fadeSlideIn 0.5s ease;
}

.results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.results-subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.score-circle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.score-circle {
  position: relative;
  width: 140px; height: 140px;
}

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

.score-bg { fill: none; stroke: var(--bg-glass); stroke-width: 8; }

.score-fill {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-percent {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.stat-number { font-size: 1.75rem; font-weight: 800; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

.stat-correct .stat-number { color: var(--accent-secondary); }
.stat-wrong .stat-number { color: var(--accent-tertiary); }
.stat-total .stat-number { color: var(--accent-primary); }

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

/* =============================================
   SETTINGS SCREEN
   ============================================= */
.settings-card {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-card h3 {
  margin-bottom: 0.5rem;
}

.settings-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.settings-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.json-format-guide {
  margin-top: 1rem;
}

.json-format-guide h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.json-format-guide pre {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.5;
}

.json-format-guide code {
  color: var(--accent-info);
  font-family: 'Consolas', 'Monaco', monospace;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeSlideIn 0.4s ease;
}

.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.7; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
}

.toast.toast-success { border-left: 3px solid var(--accent-secondary); }
.toast.toast-error { border-left: 3px solid var(--accent-tertiary); }
.toast.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* =============================================
   CONFIRM DIALOG
   ============================================= */
.confirm-overlay {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 250;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.confirm-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-dialog h3 { margin-bottom: 0.5rem; }
.confirm-dialog p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .header-content { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .header-right { width: 100%; justify-content: space-between; }
  .section-header { flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .topic-grid { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .question-item-options { grid-template-columns: 1fr; }
  .results-stats { grid-template-columns: 1fr; }
  .quiz-card { padding: 1.25rem; }
  .question-content { font-size: 1rem; }
  .type-selector { flex-direction: column; }
  .auth-card { padding: 1.5rem; }
  .admin-users-table-wrap { overflow-x: auto; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 0.5rem 0.4rem; }
  .user-detail-info { grid-template-columns: 1fr; }
}

/* =============================================
   AI REVIEW — User writes examples for AI feedback
   ============================================= */

.user-review-area {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(127, 90, 240, 0.08) 0%, rgba(44, 182, 125, 0.06) 100%);
  border: 1px solid rgba(127, 90, 240, 0.2);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.user-review-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-review-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.review-icon {
  font-size: 1.2rem;
}

.user-review-area textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(127, 90, 240, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem;
  width: 100%;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.user-review-area textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.15);
}

.user-review-area .btn {
  margin-top: 0.5rem;
}

.ai-review-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(127, 90, 240, 0.08);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(127, 90, 240, 0.3);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ai-review-result {
  margin-top: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(44, 182, 125, 0.1) 0%, rgba(127, 90, 240, 0.08) 100%);
  border: 1px solid rgba(44, 182, 125, 0.25);
  border-radius: var(--radius-sm);
  animation: fadeSlideUp 0.4s ease;
}

.ai-review-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-review-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

/* =============================================
   ADMIN — User Management Screen
   ============================================= */

.admin-users-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table thead {
  background: linear-gradient(135deg, rgba(127, 90, 240, 0.15) 0%, rgba(44, 182, 125, 0.08) 100%);
}

.admin-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

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

.admin-table tbody tr:hover {
  background: rgba(127, 90, 240, 0.06);
}

.admin-table tbody tr.admin-row {
  background: rgba(127, 90, 240, 0.04);
}

.admin-table tbody tr.admin-row:hover {
  background: rgba(127, 90, 240, 0.1);
}

.badge-admin {
  background: linear-gradient(135deg, var(--accent-primary), #e056a0) !important;
  color: white !important;
  font-size: 0.65rem !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 20px !important;
  margin-left: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: rgba(127, 90, 240, 0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-info);
  white-space: nowrap;
}

/* ---- User Detail Modal ---- */

.user-detail-content {
  padding: 0.5rem 0;
  max-height: 70vh;
  overflow-y: auto;
}

.user-detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(127, 90, 240, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.user-detail-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.user-detail-stat .stat-label {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.user-detail-stat span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.user-detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.user-detail-topic {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.user-detail-topic:hover {
  border-color: var(--border-color-hover);
}

.user-detail-topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.user-detail-topic-header .topic-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.user-detail-topic .topic-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.user-detail-questions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.user-detail-question {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.82rem;
}

.user-detail-question .q-idx {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 1.5rem;
}

.user-detail-question .q-content {
  color: var(--text-secondary);
  flex: 1;
}

/* =============================================
   COMBINED QUIZ (OPTION 2) STYLES
   ============================================= */
.combined-section {
  margin-bottom: 2rem;
}

.combined-card {
  background: linear-gradient(135deg, rgba(127, 90, 240, 0.18) 0%, rgba(44, 182, 125, 0.15) 100%);
  border: 1.5px solid rgba(127, 90, 240, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 4px 25px rgba(127, 90, 240, 0.15);
  transition: var(--transition-normal);
}

.combined-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px rgba(127, 90, 240, 0.25);
  border-color: rgba(127, 90, 240, 0.6);
}

.combined-card-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.combined-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 8px rgba(127, 90, 240, 0.4));
}

.combined-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.combined-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.combined-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  min-width: 220px;
}

.custom-combine-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-top: -6px;
  animation: fadeSlideDown 0.3s ease;
}

.custom-combine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.custom-combine-select-actions {
  display: flex;
  gap: 0.5rem;
}

.custom-combine-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.combine-topic-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.combine-topic-check:hover {
  background: rgba(127, 90, 240, 0.15);
  border-color: rgba(127, 90, 240, 0.3);
}

.combine-topic-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .combined-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
  }
  .combined-card-actions {
    width: 100%;
  }
}

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

/* =============================================
   REVIEW TOPIC STYLES
   ============================================= */

/* Review badge */
.badge-review {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.7rem !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 6px;
  animation: reviewPulse 2s ease-in-out infinite;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@keyframes reviewPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.2); }
}

/* Review topic card */
.topic-card-review {
  border: 1.5px solid rgba(245, 158, 11, 0.35) !important;
  background: rgba(245, 158, 11, 0.04) !important;
  position: relative;
}

.topic-card-review::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.topic-card-review:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.15);
}

/* Review button in results */
.btn-review {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.btn-review:hover {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-review:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* =============================================
   VOICE INPUT STYLES
   ============================================= */

.textarea-with-voice {
  position: relative;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.textarea-with-voice textarea {
  flex: 1;
}

.btn-voice {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-normal);
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-voice:hover {
  border-color: var(--accent-primary);
  background: rgba(127, 90, 240, 0.1);
  transform: scale(1.1);
}

.btn-voice.recording {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: voicePulse 1.5s ease-in-out infinite;
}

.btn-voice.recording::after {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.4);
  animation: voiceRing 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 16px 4px rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
  }
}

@keyframes voiceRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =============================================
   ADMIN TABS & REVIEW TOPICS
   ============================================= */

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.admin-tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: rgba(127, 90, 240, 0.05);
}

.admin-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

/* Admin review cards */
.admin-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-review-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.admin-review-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--bg-card-hover);
}

.admin-review-info {
  flex: 1;
  min-width: 0;
}

.admin-review-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-review-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .admin-review-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .textarea-with-voice {
    flex-direction: column;
  }
  .btn-voice {
    align-self: flex-end;
    margin-top: -0.25rem;
  }
}

/* =============================================
   AUTO-ADVANCE COUNTDOWN
   ============================================= */

.auto-advance-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: hsla(145, 70%, 45%, 0.08);
  border: 1px solid hsla(145, 70%, 45%, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  animation: slideUp 0.3s ease;
}

.auto-advance-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.82rem;
  color: hsl(145, 60%, 50%);
  font-weight: 500;
}

.auto-advance-icon {
  font-size: 1.1rem;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

.auto-advance-text strong {
  font-size: 1.05rem;
  color: hsl(145, 80%, 55%);
}

.auto-advance-progress {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.auto-advance-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, hsl(145, 70%, 45%), hsl(145, 90%, 55%));
  border-radius: 3px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px hsla(145, 80%, 55%, 0.5);
}

#btn-cancel-auto-advance {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  color: var(--text-muted);
}

#btn-cancel-auto-advance:hover {
  color: hsl(0, 70%, 60%);
}

/* Auto-advance setting options */
.auto-advance-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auto-advance-options .radio-card {
  min-width: 52px;
  text-align: center;
  justify-content: center;
}

.auto-advance-options .radio-card.active,
.auto-advance-options .radio-card:has(input:checked) {
  border-color: hsl(145, 70%, 45%);
  background: hsla(145, 70%, 45%, 0.1);
  box-shadow: 0 0 0 2px hsla(145, 70%, 45%, 0.2);
}

.auto-advance-options .radio-card.active .radio-label,
.auto-advance-options .radio-card:has(input:checked) .radio-label {
  color: hsl(145, 70%, 45%);
}
