/* examen/assets/css/exam.css - Dark mode modern theme */
:root {
  --bg-dark: #080c14;
  --bg-darker: #05080e;
  --bg-card: #0f172a;
  --bg-card-hover: #17233d;
  --bg-editor: #090d16;
  --bg-input: #0b1120;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.25);
  --danger: #ef4444;
  --info: #38bdf8;
  --font-mono: 'Fira Code', Consolas, 'Courier New', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header & Nav */
.exam-navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.student-badge-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.student-code-nav {
  font-family: var(--font-mono);
  font-weight: bold;
  color: #a5b4fc;
  font-size: 0.82rem;
}

/* Stepper Bar */
.exam-stepper {
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.step-item.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.step-item.completed {
  color: var(--success);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
}

.step-item.active .step-num {
  background: var(--primary);
  color: white;
}

.step-item.completed .step-num {
  background: var(--success);
  color: white;
}

/* Layout Container */
.exam-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Login Screen */
.login-view-wrapper {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.login-input {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: #818cf8;
  outline: none;
  transition: all 0.2s;
  margin: 1.5rem 0;
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* Driving-Test Style Question Layout */
.driving-test-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.q-category-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.q-counter-big {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
}
.q-counter-big strong {
  font-size: 1.5rem;
  color: white;
}

/* Auto-école Large Typography */
.q-main-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.q-code-box {
  background: var(--bg-editor);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 2rem;
  white-space: pre-wrap;
  position: relative;
  overflow-x: auto;
}

/* Question Navigator Grid */
.nav-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  background: var(--bg-darker);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nav-pill {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-pill.answered {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
}

.nav-pill.hint-used {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

.nav-pill.current {
  outline: 2px solid white;
  outline-offset: 2px;
  background: var(--primary) !important;
  color: white !important;
}

/* Code Editor Answer Box */
.editor-box {
  background: var(--bg-editor);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  transition: border-color 0.2s;
}

.editor-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 15px var(--primary-glow);
}

.editor-topbar {
  background: #0f1523;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.editor-textarea {
  width: 100%;
  min-height: 140px;
  padding: 1.25rem;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

/* 4 Choices Cards (Auto-école QCM) */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.choice-card {
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.choice-card.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.choice-letter {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.choice-card.selected .choice-letter {
  background: var(--primary);
  color: white;
}

.choice-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: #f1f5f9;
  flex: 1;
}

/* Bottom Controls */
.q-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.q-actions-left {
  display: flex;
  gap: 0.75rem;
}

.q-actions-right {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 15px var(--primary-glow); }

.btn-secondary { background: rgba(255, 255, 255, 0.08); color: white; border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

.btn-warning-outline {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.btn-warning-outline:hover {
  background: rgba(245, 158, 11, 0.2);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; box-shadow: 0 0 15px var(--success-glow); }

.btn-lg { padding: 1rem 1.8rem; font-size: 1.1rem; border-radius: 10px; }

/* Warning Box */
.warning-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.warning-icon { font-size: 1.8rem; }
.warning-title { font-weight: 800; color: #f87171; font-size: 1.1rem; margin-bottom: 0.25rem; }
.warning-desc { color: #cbd5e1; font-size: 0.95rem; line-height: 1.5; }

/* Download & Upload Cards */
.download-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon { font-size: 3rem; margin-bottom: 1rem; color: #818cf8; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.text-gradient {
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.completed-celebration {
  text-align: center;
  padding: 3rem 1.5rem;
}

.celebration-icon { font-size: 5rem; margin-bottom: 1.5rem; animation: float 3s ease-in-out infinite; }

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

