/* ==========================================================
   ExamCore CSS Design System (Aplikasi Asesmen CBT)
   Strict Implementation Based on Ground Truth Reference
   ========================================================== */

:root {
  /* Brand Header Colors */
  --cbt-header-blue: #0f4c81;
  --cbt-header-blue-dark: #093760;
  --cbt-header-accent: #38bdf8;
  
  /* Canvas & Cards */
  --cbt-bg-canvas: #f4f6f9;
  --cbt-card-bg: #ffffff;
  --cbt-card-border: #e2e8f0;
  --cbt-card-shadow: 0 4px 20px rgba(15, 76, 129, 0.09);
  
  /* Typography */
  --cbt-text-main: #1e293b;
  --cbt-text-muted: #64748b;
  --cbt-text-light: #94a3b8;
  
  /* Buttons */
  --cbt-btn-blue: #0084ff;
  --cbt-btn-blue-hover: #006fe0;
  --cbt-btn-green: #22c55e;
  --cbt-btn-green-hover: #16a34a;
  --cbt-btn-red: #ef4444;
  --cbt-btn-red-hover: #dc2626;
  --cbt-btn-yellow: #f59e0b;
  --cbt-btn-yellow-hover: #d97706;
  --cbt-btn-cyan: #0090ff;
  --cbt-btn-disabled: #cbd5e1;

  /* Font Scaling Variables */
  --font-scale-content: 15px;
  --font-scale-title: 20px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--cbt-bg-canvas);
  color: var(--cbt-text-main);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Allow text selection specifically inside question content for reading ease */
.selectable, .question-stimulus, .question-text {
  user-select: text;
  -webkit-user-select: text;
}

/* Top App Bar (Header Banner) */
.cbt-header {
  height: 64px;
  background: var(--cbt-header-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

/* Decorative curved abstract background on left of header */
.cbt-header::before {
  content: '';
  position: absolute;
  top: -30px;
  left: -20px;
  width: 180px;
  height: 140px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.cbt-header::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 60px;
  width: 120px;
  height: 100px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
}

.header-brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: #ffffff;
}

.header-brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: #93c5fd;
  letter-spacing: 0.8px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.header-username {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
}

.header-avatar-btn {
  width: 40px;
  height: 40px;
  background: #0284c7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.2s;
}

.header-avatar-btn:hover {
  background: #0369a1;
}

/* Background Canvas Graphics (Network Nodes at Bottom) */
.cbt-canvas {
  min-height: calc(100vh - 64px);
  position: relative;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#cbd5e1 1px, transparent 1px),
    linear-gradient(to bottom, #f8fafc 0%, #edf2f7 100%);
  background-size: 32px 32px, 100% 100%;
}

/* Network lines decoration at the bottom */
.cbt-canvas::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' opacity='0.25'%3E%3Cpath d='M100,160 L350,110 L600,150 L850,90 L1100,140' stroke='%230284c7' stroke-width='1.5' fill='none'/%3E%3Cpath d='M200,180 L450,130 L750,160 L1050,100' stroke='%2394a3b8' stroke-width='1' fill='none'/%3E%3Ccircle cx='100' cy='160' r='6' fill='%230284c7'/%3E%3Ccircle cx='350' cy='110' r='5' fill='%2338bdf8'/%3E%3Ccircle cx='600' cy='150' r='7' fill='%230284c7'/%3E%3Ccircle cx='850' cy='90' r='5' fill='%2338bdf8'/%3E%3Ccircle cx='1100' cy='140' r='6' fill='%230284c7'/%3E%3C/svg%3E") bottom center no-repeat;
  background-size: cover;
  pointer-events: none;
  z-index: 1;
}

/* Card Universal Container */
.cbt-card {
  background: var(--cbt-card-bg);
  border-radius: 14px;
  box-shadow: var(--cbt-card-shadow);
  border: 1px solid var(--cbt-card-border);
  position: relative;
  z-index: 10;
  width: 100%;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-blue {
  background-color: var(--cbt-btn-blue);
  color: #ffffff;
}
.btn-blue:hover:not(:disabled) {
  background-color: var(--cbt-btn-blue-hover);
}

.btn-green {
  background-color: var(--cbt-btn-green);
  color: #ffffff;
}
.btn-green:hover:not(:disabled) {
  background-color: var(--cbt-btn-green-hover);
}

.btn-red {
  background-color: var(--cbt-btn-red);
  color: #ffffff;
}
.btn-red:hover:not(:disabled) {
  background-color: var(--cbt-btn-red-hover);
}

.btn-yellow {
  background-color: var(--cbt-btn-yellow);
  color: #ffffff;
}
.btn-yellow:hover:not(:disabled) {
  background-color: var(--cbt-btn-yellow-hover);
}

.btn-pill {
  border-radius: 24px;
}

/* Input Fields */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.form-label.required::after {
  content: ' *';
  color: #ef4444;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  color: #1e293b;
  transition: border-color 0.15s;
  background-color: #ffffff;
}

.form-input:focus {
  border-color: #0084ff;
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.12);
}

.form-input[readonly] {
  background-color: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.form-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-with-icon .form-input {
  padding-right: 40px;
}

.input-icon-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal System */
.cbt-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.cbt-modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: scaleUp 0.18s ease-out;
}

.cbt-modal-header {
  background: #f1f5f9;
  padding: 14px 20px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.cbt-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}

.cbt-modal-body {
  padding: 24px;
  font-size: 14.5px;
  color: #334155;
  line-height: 1.6;
}

.cbt-modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

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

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================
   SECURITY LOCKDOWN & ANTI-CHEATING OVERLAY
   ========================================================== */
.exam-content-protected.breached {
  filter: blur(25px) !important;
  pointer-events: none !important;
  opacity: 0.1 !important;
  user-select: none !important;
}

.security-breach-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.12s ease-out;
}

.security-breach-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  padding: 32px 28px;
  text-align: center;
  border: 2px solid #ef4444;
  box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.35);
  animation: scaleUp 0.15s ease-out;
}

.security-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fef2f2;
  border: 3px solid #ef4444;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.security-title {
  font-size: 22px;
  font-weight: 900;
  color: #991b1b;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.security-subtitle {
  font-size: 14px;
  color: #475569;
  margin-bottom: 18px;
  line-height: 1.5;
}

.security-badge {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
  border: 1px solid #fca5a5;
}

.security-reason-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #334155;
  text-align: left;
  margin-bottom: 22px;
}

.btn-restore-fs {
  background: #0284c7;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: all 0.15s;
  width: 100%;
}

.btn-restore-fs:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.security-locked-box {
  border-color: #7f1d1d;
  background: #fff1f2;
}

