/* ═══════════════════════════════════════════════════════════════
   Lanza Exam Platform — Custom Styles
   Gordian Logistic Experts
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand-color: #002C3D;
  --accent-color: #E09D00;
  --muted-color: #7B9099;
  --teal-color: #499394;
  --light-bg: #F4F7F9;
  --sidebar-width: 240px;
}

/* ── General ─────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--light-bg);
  color: #2a2a2a;
}

a { color: var(--accent-color); }
a:hover { color: var(--brand-color); }

.text-brand { color: var(--brand-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-muted-brand { color: var(--muted-color) !important; }

.bg-brand { background-color: var(--brand-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-brand {
  background-color: var(--brand-color);
  border-color: var(--brand-color);
  color: #fff;
}
.btn-brand:hover {
  background-color: #003d55;
  border-color: #003d55;
  color: #fff;
}
.btn-accent {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.btn-accent:hover {
  background-color: #c88a00;
  border-color: #c88a00;
  color: #fff;
}

/* ── Admin Layout: Sidebar ───────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--brand-color);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-logo {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
}
.sidebar-platform-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(224,157,0,0.45);
  border-radius: 3px;
  display: inline-block;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}
.sidebar-nav .nav-item { list-style: none; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: var(--accent-color);
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 0.95rem; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

/* ── Admin Layout: Main content ──────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e0e7ec;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}
.admin-topbar .page-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-color);
  margin: 0;
}
.admin-topbar .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-user {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.admin-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,44,61,0.08);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e8eef3;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-color);
  padding: 14px 20px;
  border-radius: 10px 10px 0 0 !important;
}

/* ── Stat cards (dashboard) ──────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 22px 24px;
  color: #fff;
  background-color: var(--brand-color);
}
.stat-card.accent { background-color: var(--accent-color); }
.stat-card.teal { background-color: var(--teal-color); }
.stat-card .stat-number {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 4px;
}
.stat-card .stat-icon {
  font-size: 2rem;
  opacity: 0.25;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
  border-bottom: 2px solid #e8eef3;
  background: #f9fbfc;
}
.table td { vertical-align: middle; font-size: 0.875rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-pass {
  background-color: #d4edda;
  color: #155724;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
}
.badge-fail {
  background-color: #f8d7da;
  color: #721c24;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
}
.badge-active {
  background-color: #d4edda;
  color: #155724;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
}
.badge-inactive {
  background-color: #e9ecef;
  color: #6c757d;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* ── Topic pill ──────────────────────────────────────────────── */
.topic-pill {
  background-color: rgba(73,147,148,0.12);
  color: var(--teal-color);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Flash messages ──────────────────────────────────────────── */
.flash-container { position: sticky; top: 58px; z-index: 800; }

/* ── Login page ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-color) 0%, #004d6b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.login-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand-color);
  letter-spacing: -0.01em;
}
.login-subtitle { color: var(--muted-color); font-size: 0.85rem; }

/* ── Drag & drop upload zone ─────────────────────────────────── */
.drop-zone {
  border: 2px dashed #c0d0d8;
  border-radius: 12px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f9fbfc;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-color);
  background: #fffdf4;
}
.drop-zone i { font-size: 2.5rem; color: var(--muted-color); }
.drop-zone .drop-text { color: var(--muted-color); margin-top: 12px; font-size: 0.9rem; }
.drop-zone .drop-text strong { color: var(--brand-color); }

/* ── Exam taking interface ───────────────────────────────────── */
.exam-wrapper {
  min-height: 100vh;
  background: #f4f7f9;
}

.exam-header {
  background: var(--brand-color);
  color: #fff;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.exam-header .exam-title {
  font-size: 1rem;
  font-weight: 600;
}

.timer-box {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.timer-box.danger {
  background: #dc3545;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.exam-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.question-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 5px rgba(0,44,61,0.07);
  margin-bottom: 22px;
  overflow: hidden;
}
.question-number {
  background: var(--brand-color);
  color: #fff;
  padding: 10px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.question-text {
  padding: 18px 20px 6px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1a2e38;
  line-height: 1.5;
}
.question-options {
  padding: 6px 20px 18px;
}
.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: background 0.15s;
  border: 1px solid #e8eef3;
  font-size: 0.9rem;
}
.option-label:hover { background: #f0f7f8; border-color: var(--teal-color); }
.option-label input[type="radio"] { accent-color: var(--brand-color); transform: scale(1.15); }
.option-label input[type="radio"]:checked + span { font-weight: 600; color: var(--brand-color); }
.option-label:has(input:checked) {
  background: rgba(0,44,61,0.06);
  border-color: var(--brand-color);
}

/* ── Exam start / result page ────────────────────────────────── */
.exam-centered-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--brand-color) 0%, #005070 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.exam-panel {
  background: #fff;
  border-radius: 16px;
  padding: 44px 48px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.2);
}
.exam-panel h2 { color: var(--brand-color); font-weight: 700; }

.result-score {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--brand-color);
}
.result-pass {
  background: #d4edda;
  color: #155724;
  border-radius: 12px;
  padding: 16px 20px;
}
.result-fail {
  background: #f8d7da;
  color: #721c24;
  border-radius: 12px;
  padding: 16px 20px;
}

/* ── Misc ────────────────────────────────────────────────────── */
.shareable-link-box {
  background: #f4f7f9;
  border: 1px solid #d0dde6;
  border-radius: 8px;
  padding: 14px 18px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--brand-color);
}

.import-summary { border-radius: 10px; }

.page-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-color);
  margin: 0;
}

/* ── Responsive: collapse sidebar on small screens ───────────── */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .admin-sidebar .sidebar-logo,
  .admin-sidebar .sidebar-platform-label,
  .admin-sidebar .nav-link span,
  .admin-sidebar .sidebar-footer { display: none; }
  .admin-main { margin-left: 60px; }
  .exam-panel { padding: 28px 22px; }
}
