/* ========================================
   EXAMEN SYSTEEM - GLOBAL STYLES
   ======================================== */

:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --secondary: #4a5568;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --info: #3182ce;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
.site-header {
  background: var(--primary);
  color: white;
  padding: 0 24px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
}

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

.user-name { font-weight: 500; }

.btn-logout {
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); }

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-nav, .btn-inleveren, .btn-bookmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover { background: var(--primary-light); }

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

.btn-secondary:hover { background: var(--bg); }

.btn-small {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

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

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-group input { width: auto; }

/* Tables */
.data-table {
  width: 100%;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-collapse: collapse;
}

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

.data-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-light);
}

.data-table tr:hover { background: var(--bg); }

/* Badges */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #c6f6d5; color: #22543d; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-info { background: #bee3f8; color: #2a4365; }
.badge-primary { background: #e2e8f0; color: var(--primary); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.alert-danger { background: #fed7d7; color: #742a2a; }
.alert-success { background: #c6f6d5; color: #22543d; }

/* ========================================
   EXAMEN PAGINA
   ======================================== */

.examen-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

/* Fraud Overlay */
.fraud-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.fraud-message {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 400px;
}

.fraud-message h2 {
  color: var(--danger);
  margin-bottom: 12px;
}

.fraud-message p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Header Bar */
.examen-header-bar {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.examen-titel {
  font-weight: 600;
  font-size: 1.125rem;
}

.timer {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.timer-warning { color: var(--warning); }
.timer-danger { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-label {
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.8;
}

.vraag-counter {
  font-size: 0.9375rem;
}

/* Body */
.examen-body {
  display: flex;
  flex: 1;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.examen-main {
  flex: 2;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.examen-sidebar {
  flex: 1;
  max-width: 320px;
}

/* Vraag */
.vraag-afbeelding {
  margin-bottom: 24px;
  text-align: center;
}

.vraag-afbeelding img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius);
}

.vraag-tekst {
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: var(--text);
}

/* Antwoord Opties */
.antwoord-opties {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.optie-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.optie-label:hover {
  border-color: var(--primary-light);
  background: var(--bg);
}

.optie-label.selected {
  border-color: var(--success);
  background: #f0fff4;
}

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

.optie-letter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.optie-tekst {
  font-size: 1rem;
}

/* Info Slide */
.info-slide-message {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--info);
}

/* Sidebar */
.overzicht-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
}

.overzicht-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.overzicht-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.vraag-nummer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid var(--border);
  color: var(--text);
}

.vraag-nummer.huidig {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.vraag-nummer.beantwoord {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.vraag-nummer.niet-beantwoord {
  background: var(--bg);
  color: var(--text-light);
}

.vraag-nummer.info {
  background: var(--info);
  color: white;
  border-color: var(--info);
  font-size: 1rem;
}

.overzicht-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-box.huidig { background: var(--primary); }
.legend-box.beantwoord { background: var(--success); }
.legend-box.niet-beantwoord { background: var(--bg); border: 1px solid var(--border); }

/* Navigation */
.examen-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}

.btn-nav {
  padding: 10px 24px;
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-nav.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-inleveren {
  padding: 12px 32px;
  background: var(--danger);
  color: white;
  font-size: 1rem;
}

.btn-inleveren:hover { background: #c53030; }

.btn-bookmark {
  padding: 10px 16px;
  background: white;
  border: 2px solid var(--border);
  font-size: 1.25rem;
}

/* ========================================
   EXAMEN START
   ======================================== */

.examen-start {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}

.start-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.start-card h1 {
  color: var(--primary);
  margin-bottom: 8px;
}

.beschrijving {
  color: var(--text-light);
  margin-bottom: 24px;
}

.examen-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-label { color: var(--text-light); font-size: 0.875rem; }
.info-value { font-weight: 600; }

.start-waarschuwing {
  background: #fffaf0;
  border: 1px solid #fbd38d;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.start-waarschuwing h3 {
  color: var(--warning);
  margin-bottom: 12px;
}

.start-waarschuwing ul {
  padding-left: 20px;
  color: var(--text-light);
}

.start-waarschuwing li { margin-bottom: 6px; }

.btn-start {
  width: 100%;
  padding: 16px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-start:hover { background: #2f855a; }

/* ========================================
   RESULTAAT & INZIEN
   ======================================== */

.resultaat-page,
.inzien-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.resultaat-card,
.inzien-summary {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.resultaat-score {
  margin: 32px 0;
}

.score-percentage {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 1.5rem;
  margin-top: 8px;
}

.resultaat-score.geslaagd .score-percentage { color: var(--success); }
.resultaat-score.gezakt .score-percentage { color: var(--danger); }

.resultaat-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.detail-item {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.detail-value.correct { color: var(--success); }
.detail-value.wrong { color: var(--danger); }

.resultaat-actions,
.inzien-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Inzien */
.vragen-lijst {
  margin-top: 24px;
}

.vraag-review {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}

.vraag-review.correct { border-left-color: var(--success); }
.vraag-review.fout { border-left-color: var(--danger); }
.vraag-review.niet-beantwoord { border-left-color: var(--warning); }

.vraag-review .vraag-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.vraag-review .vraag-nummer {
  font-weight: 700;
  color: var(--primary);
}

.vraag-review .vraag-tekst {
  font-size: 1.125rem;
  margin-bottom: 16px;
}

.opties-review {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optie-review {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
}

.optie-review.optie-correct {
  background: #f0fff4;
  border: 1px solid var(--success);
}

.optie-review.optie-gekozen {
  background: #ebf8ff;
  border: 1px solid var(--info);
}

.optie-review.optie-gekozen.optie-correct {
  background: #f0fff4;
  border: 2px solid var(--success);
}

.correct-mark { color: var(--success); font-weight: 700; }
.wrong-mark { color: var(--danger); font-weight: 700; }

.jouw-antwoord {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

/* ========================================
   ADMIN & DOCENT
   ======================================== */

.admin-dashboard,
.docent-dashboard,
.admin-kandidaten,
.admin-examens,
.admin-vragen,
.admin-toewijzen {
  max-width: 1200px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 4px;
}

.admin-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.toewijzen-form,
.nieuw-examen-form,
.nieuw-vraag-form {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.toewijzen-form h2,
.nieuw-examen-form h2,
.nieuw-vraag-form h2 {
  margin-bottom: 16px;
  font-size: 1.125rem;
}

.code-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.code-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-item label {
  font-weight: 600;
  color: var(--text-light);
}

.big-code {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
  letter-spacing: 2px;
}

.success-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.hint {
  color: var(--text-light);
  margin: 16px 0;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.vragen-lijst {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.vraag-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.vraag-card .vraag-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.vraag-card .vraag-nummer {
  font-weight: 700;
  color: var(--primary);
}

.vraag-card .vraag-tekst {
  font-size: 1rem;
}

.vraag-thumb {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius);
  margin-top: 12px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Error page */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
}

.error-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.error-card h1 {
  font-size: 3rem;
  margin-bottom: 16px;
}

.error-card p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .examen-body {
    flex-direction: column;
  }

  .examen-sidebar {
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resultaat-details {
    grid-template-columns: 1fr;
  }

  .examen-header-bar {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .timer {
    font-size: 1.5rem;
  }
}
