/* ==========================================================================
   CERTIFICATE EXAM PAGE STYLING (components/certificate-exam.css)
   Beugem - Göz & Sekme Korumalı Online Sertifika Sınavı
   Site Kimliği: Beyaz & Beugem İmzalı Turuncu (#C85A17) Tema
   ========================================================================== */

:root {
  /* Beyaz & Açık Zemin Paleti */
  --exam-bg: #F8FAFC;             /* Ferah açık gri-beyaz arka plan */
  --exam-card-bg: #FFFFFF;        /* Temiz saf beyaz kart yüzeyi */
  --exam-card-secondary: #F1F5F9; /* İkincil yüzey */
  --exam-border: #E2E8F0;         /* Zarif açık gri kenarlık */
  --exam-border-light: #CBD5E1;   /* Belirgin kenarlık */
  --exam-text: #0F172A;           /* Okunaklı koyu başlık rengi */
  --exam-text-sub: #334155;       /* Koyu gri gövde metni */
  --exam-muted: #64748B;          /* Yumuşak nötr gri etiketler */

  /* Beugem İmzalı Turuncu */
  --exam-primary: #C85A17;        /* Beugem imza turuncusu */
  --exam-primary-hover: #B44F13;  /* Derin turuncu hover */
  --exam-primary-light: #FEF3EC;  /* Açık krem turuncu */
  --exam-primary-border: #FDDAB8; /* Açık turuncu kenarlık */
  --exam-primary-glow: rgba(200, 90, 23, 0.25);
  --exam-primary-tint: rgba(200, 90, 23, 0.08);

  /* Güvenlik & Durum Renkleri */
  --exam-success: #10B981;
  --exam-warning: #F59E0B;
  --exam-danger: #EF4444;
}

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

body.exam-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--exam-bg);
  color: var(--exam-text);
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   1. EXAM TOP HEADER (Beyaz Zemin & Turuncu Detaylar)
   ========================================================================== */
.exam-header {
  height: 68px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--exam-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.exam-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.exam-logo {
  height: 32px;
  width: auto;
}

.exam-title-badge {
  display: flex;
  flex-direction: column;
}

.exam-title-badge h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--exam-text);
}

.exam-title-badge span {
  font-size: 11px;
  color: var(--exam-muted);
}

.exam-hud-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid var(--exam-border);
  color: #334155;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.hud-pill.active {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.hud-pill.warning {
  border-color: var(--exam-primary-border);
  background: var(--exam-primary-light);
  color: var(--exam-primary);
}

.hud-pill.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
  animation: hudPulse 1.5s infinite;
}

@keyframes hudPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--exam-border);
  padding: 6px 14px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--exam-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.exam-timer-box svg {
  color: var(--exam-primary);
}

.exam-timer-box.warning {
  color: #EF4444;
  border-color: #EF4444;
}

/* ==========================================================================
   2. EXAM MAIN LAYOUT
   ========================================================================== */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 68px);
  overflow: hidden;
  background: var(--exam-bg);
}

/* Left: Questions Area */
.exam-main {
  padding: 32px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.exam-progress-bar-wrap {
  margin-bottom: 24px;
}

.exam-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.exam-tab-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--exam-border);
  background: #FFFFFF;
  color: var(--exam-muted);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.exam-tab-btn:hover {
  border-color: var(--exam-primary);
  color: var(--exam-primary);
  background: var(--exam-primary-light);
}

.exam-tab-btn.active {
  background: var(--exam-primary);
  border-color: var(--exam-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--exam-primary-glow);
}

.exam-tab-btn.answered {
  border-color: var(--exam-success);
  color: #059669;
}

.exam-tab-btn.active.answered {
  background: var(--exam-primary);
  color: #FFFFFF;
}

/* Question Box (Beyaz Kart & Turuncu Vurgu) */
.question-container {
  background: var(--exam-card-bg);
  border: 1px solid var(--exam-border);
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

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

.question-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--exam-primary);
  background: var(--exam-primary-light);
  border: 1px solid var(--exam-primary-border);
  padding: 5px 12px;
  border-radius: 8px;
}

.question-points {
  font-size: 12px;
  font-weight: 600;
  color: var(--exam-muted);
}

.question-text {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--exam-text);
  margin-bottom: 28px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #FFFFFF;
  border: 1.5px solid var(--exam-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.option-item:hover {
  border-color: var(--exam-primary-border);
  background: var(--exam-primary-light);
  transform: translateY(-1px);
}

.option-item.selected {
  border-color: var(--exam-primary);
  background: var(--exam-primary-light);
  box-shadow: 0 0 0 1px var(--exam-primary);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-item.selected .option-letter {
  background: var(--exam-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--exam-primary-glow);
}

.option-text {
  font-size: 15px;
  color: var(--exam-text-sub);
  flex-grow: 1;
  line-height: 1.5;
}

.option-item.selected .option-text {
  color: #0F172A;
  font-weight: 600;
}

/* Exam Bottom Controls */
.exam-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
}

.btn-exam-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #FFFFFF;
  border: 1.5px solid var(--exam-border-light);
  border-radius: 10px;
  color: var(--exam-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-exam-nav:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: var(--exam-primary);
  color: var(--exam-primary);
}

.btn-exam-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-exam-finish {
  background: var(--exam-primary);
  border-color: var(--exam-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 16px var(--exam-primary-glow);
}

.btn-exam-finish:hover {
  background: var(--exam-primary-hover);
  border-color: var(--exam-primary-hover);
  color: #FFFFFF;
}

/* ==========================================================================
   3. RIGHT SIDEBAR: PROCTORING & WEBCAM (Beyaz Zemin & Şık Kartlar)
   ========================================================================== */
.exam-sidebar {
  background: #FFFFFF;
  border-left: 1px solid var(--exam-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.proctor-cam-card {
  background: #FFFFFF;
  border: 1px solid var(--exam-border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.proctor-cam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--exam-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--exam-text);
  background: #F8FAFC;
}

.proctor-cam-view {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000000;
  overflow: hidden;
}

#proctor-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#proctor-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
  pointer-events: none;
}

.proctor-gaze-status-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.proctor-status-text {
  font-weight: 600;
  color: #34D399;
}

.proctor-status-text.away {
  color: #EF4444;
}

/* Violation Audit Timeline (Beyaz & Turuncu Çizgili) */
.audit-log-card {
  background: #FFFFFF;
  border: 1px solid var(--exam-border);
  border-radius: 16px;
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.audit-log-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--exam-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 220px;
  font-size: 11px;
}

.audit-log-item {
  padding: 9px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--exam-border);
  border-left: 3px solid var(--exam-primary);
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-log-item.violation {
  border-left-color: #EF4444;
  background: #FEF2F2;
  border-color: #FEE2E2;
  color: #991B1B;
}

.audit-log-time {
  font-size: 10px;
  color: #64748B;
}

/* ==========================================================================
   4. MODALS & OVERLAYS (Beyaz Kart & Turuncu Butonlar)
   ========================================================================= */
.exam-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.exam-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.exam-modal-box {
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  border: 1px solid var(--exam-border);
  border-radius: 22px;
  padding: 38px 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  text-align: center;
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-circle.danger {
  background: #FEF2F2;
  color: #EF4444;
  border: 2px solid #FEE2E2;
  animation: pulseDanger 2s infinite;
}

@keyframes pulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.modal-icon-circle.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
  border: 2px solid rgba(16, 185, 129, 0.25);
}

.modal-icon-circle.info {
  background: var(--exam-primary-light);
  color: var(--exam-primary);
  border: 2px solid var(--exam-primary-border);
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--exam-text);
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 14px;
  color: var(--exam-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-strike-box {
  background: #F8FAFC;
  border: 1px solid var(--exam-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.strike-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strike-label {
  font-size: 11px;
  color: var(--exam-muted);
}

.strike-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--exam-primary);
}

.btn-modal-action {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--exam-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 18px var(--exam-primary-glow);
}

.btn-modal-action:hover {
  background: var(--exam-primary-hover);
}

.btn-modal-action.danger-action {
  background: #EF4444;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.25);
}

.btn-modal-action.danger-action:hover {
  background: #DC2626;
}

/* Responsive */
@media (max-width: 900px) {
  .exam-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow-y: auto;
  }
  .exam-sidebar {
    border-left: none;
    border-top: 1px solid var(--exam-border);
  }
}
