/* ==============================================================
   CYNET SECURE PROCTORING & EXAMINATION ENGINE (exam.css)
   Military-Grade Anti-Cheat, Anti-AI, Proctoring HUD & Certification
   ============================================================== */

/* Examination Layout Container */
.exam-page-body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-persian);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Watermark Overlay */
.exam-watermark-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    -35deg,
    rgba(255, 42, 95, 0.4) 0px,
    rgba(255, 42, 95, 0.4) 1px,
    transparent 1px,
    transparent 180px
  );
  overflow: hidden;
}

.watermark-text-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 120px 180px;
  padding: 40px;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  transform: rotate(-15deg);
  pointer-events: none;
}

/* Proctoring Header / HUD */
.proctor-hud-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.proctor-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proctor-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-red);
}

.proctor-hud-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.proctor-hud-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Center HUD: Countdown Timer */
.proctor-timer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 42, 95, 0.3);
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgba(255, 42, 95, 0.15);
}

.proctor-timer-digits {
  font-family: var(--font-tech);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.proctor-timer-digits.warning {
  color: #fbbf24;
  animation: pulse-warning 1s infinite alternate;
}

.proctor-timer-digits.critical {
  color: #ef4444;
  animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-warning {
  from { transform: scale(1); text-shadow: 0 0 5px rgba(251, 191, 36, 0.4); }
  to { transform: scale(1.05); text-shadow: 0 0 15px rgba(251, 191, 36, 0.8); }
}

@keyframes pulse-danger {
  from { transform: scale(1); text-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  to { transform: scale(1.08); text-shadow: 0 0 20px rgba(239, 68, 68, 1); }
}

/* Right HUD: Anti-Cheat Badges & Strikes */
.proctor-hud-shields {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proctor-shield-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.proctor-strikes-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.strike-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  transition: all 0.3s ease;
}

.strike-dot.violated {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* Exam Main Content Container */
.proctor-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 20px 80px;
  position: relative;
  z-index: 10;
}

/* Pre-Check View Cards */
.exam-precheck-card {
  background: linear-gradient(180deg, rgba(14, 17, 24, 0.95) 0%, rgba(10, 12, 16, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.precheck-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 42, 95, 0.12);
  border: 1px solid rgba(255, 42, 95, 0.3);
  color: var(--accent-red);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.precheck-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.precheck-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

/* Course Selection Selector Grid */
.course-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.course-select-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.course-select-card:hover {
  border-color: rgba(255, 42, 95, 0.4);
  transform: translateY(-2px);
}

.course-select-card.selected {
  background: linear-gradient(180deg, rgba(255, 42, 95, 0.08) 0%, rgba(14, 17, 24, 0.8) 100%);
  border-color: var(--accent-red);
  box-shadow: 0 0 20px rgba(255, 42, 95, 0.2);
}

.course-select-card .cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.course-select-card h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.course-select-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 12px;
}

.course-select-card .cs-specs {
  display: flex;
  gap: 12px;
  font-size: 0.74rem;
  color: #cbd5e1;
  font-family: var(--font-tech);
}

/* Security Protocols Checklist Box */
.security-rules-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 42, 95, 0.25);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 28px;
}

.security-rules-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.security-rule-item:last-child {
  margin-bottom: 0;
}

.security-rule-icon {
  color: var(--accent-red);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Candidate Info Strip */
.candidate-info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  margin-bottom: 26px;
  font-size: 0.84rem;
  flex-wrap: wrap;
  gap: 12px;
}

/* Agreement Checkbox */
.precheck-agree-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #fff;
  cursor: pointer;
  margin-bottom: 26px;
}

.precheck-agree-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-red);
  cursor: pointer;
}

/* ==============================================================
   QUESTION WORKSPACE & ACTIVE PROCTORING
   ============================================================== */

/* Question Navigator Bar (1, 2, 3 ... N) */
.q-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  margin-bottom: 20px;
}

.q-nav-item {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(14, 17, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.q-nav-item:hover {
  border-color: rgba(255, 42, 95, 0.4);
  color: #fff;
}

.q-nav-item.current {
  border-color: var(--accent-red);
  background: rgba(255, 42, 95, 0.15);
  color: var(--accent-red);
  box-shadow: 0 0 12px rgba(255, 42, 95, 0.4);
}

.q-nav-item.answered {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

/* Active Question Card */
.proctor-question-card {
  background: linear-gradient(180deg, rgba(14, 17, 24, 0.95) 0%, rgba(10, 12, 16, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  position: relative;
}

.q-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-tech);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.q-text-body {
  font-size: 1.05rem;
  line-height: 2;
  color: #fff;
  font-weight: 600;
  margin-bottom: 28px;
  position: relative;
}

/* AI Honeypot Invisible Trap */
.ai-honeypot-trap {
  display: inline !important;
  opacity: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* Options Grid */
.proctor-options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proctor-option-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.proctor-option-label:hover {
  background: rgba(255, 42, 95, 0.03);
  border-color: rgba(255, 42, 95, 0.3);
}

.proctor-option-label.selected {
  background: linear-gradient(90deg, rgba(255, 42, 95, 0.1) 0%, rgba(14, 17, 24, 0.9) 100%);
  border-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(255, 42, 95, 0.2);
}

.proctor-option-label input[type="radio"] {
  margin-top: 5px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-red);
  flex-shrink: 0;
}

.proctor-opt-letter {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-red);
  padding: 2px 7px;
  background: rgba(255, 42, 95, 0.1);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

.proctor-opt-text {
  font-size: 0.93rem;
  line-height: 1.8;
  color: #e2e8f0;
}

/* Stepper Actions Bar */
.proctor-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Violation Modal (LOUD SECURITY WARNING) */
.violation-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.violation-modal-overlay.active {
  display: flex;
}

.violation-modal-box {
  background: #0f0a0d;
  border: 2px solid #ef4444;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
  max-width: 500px;
  width: 100%;
  padding: 32px;
  text-align: center;
  animation: shake-danger 0.4s ease;
}

@keyframes shake-danger {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.violation-icon-halo {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.violation-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.violation-desc {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #cbd5e1;
  margin-bottom: 24px;
}

/* Disqualification View */
.disqualification-view {
  background: #140508;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

/* Result Card Styles */
.exam-result-card {
  background: linear-gradient(180deg, rgba(14, 17, 24, 0.95) 0%, rgba(10, 12, 16, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.score-dial-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tech);
  font-size: 2.2rem;
  font-weight: 800;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.score-dial-wrap.pass {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 4px solid #10b981;
  color: #34d399;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.35);
}

.score-dial-wrap.fail {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 4px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.35);
}

.cert-card-preview {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 42, 95, 0.35);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 28px 0;
  text-align: right;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  html, body.exam-page-body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }
  .exam-watermark-overlay {
    max-width: 100vw !important;
    overflow: hidden !important;
    clip-path: inset(0) !important;
  }
  .watermark-text-grid {
    max-width: 100% !important;
    overflow: hidden !important;
    gap: 80px 100px !important;
    padding: 20px !important;
  }
  #portalNavHeader .nav-container {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 8px 12px !important;
  }
  #portalNavHeader .brand-sub {
    display: none !important;
  }
  #portalNavHeader .nav-actions {
    gap: 6px !important;
  }
  #portalNavHeader .nav-actions .btn {
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
  }
  .proctor-hud-header {
    padding: 10px 14px;
  }
  .proctor-container {
    padding: 18px 12px 60px;
  }
  .exam-precheck-card {
    padding: 22px 16px;
  }
  .proctor-question-card {
    padding: 22px 16px;
  }
  .precheck-title {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 480px) {
  #portalNavHeader .nav-actions a[href="dashboard"] {
    display: none !important;
  }
  .precheck-title {
    font-size: 1.15rem !important;
    line-height: 1.35 !important;
  }
}


