/* =====================================================
   APARAITECH TEST PORTAL — Main Stylesheet
   Corporate Blue Design System
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── CSS Variables ─────────────────────────────────── */
:root {
  --primary:       #0d47a1;
  --primary-dark:  #0a2e6e;
  --primary-light: #1565c0;
  --accent:        #2196f3;
  --accent-light:  #e3f2fd;
  --success:       #2e7d32;
  --success-light: #e8f5e9;
  --danger:        #c62828;
  --danger-light:  #ffebee;
  --warning:       #f57f17;
  --warning-light: #fff8e1;
  --gray-50:       #fafafa;
  --gray-100:      #f5f5f5;
  --gray-200:      #eeeeee;
  --gray-300:      #e0e0e0;
  --gray-500:      #9e9e9e;
  --gray-700:      #616161;
  --gray-900:      #212121;
  --font-main:     'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(13,71,161,0.12);
  --shadow-lg:     0 8px 32px rgba(13,71,161,0.18);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --transition:    0.2s ease;
}

/* ── Base Reset ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Navbar ────────────────────────────────────────── */
.aparai-navbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon svg { transition: transform var(--transition); }
.navbar-brand:hover .brand-icon svg { transform: rotate(-5deg) scale(1.05); }

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.5px;
}

.brand-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.aparai-navbar .nav-link {
  color: rgba(255,255,255,0.82) !important;
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  padding: 0.45rem 0.85rem !important;
}

.aparai-navbar .nav-link:hover,
.aparai-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.15);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  border: 2px solid rgba(255,255,255,0.35);
}

.user-dropdown { border-radius: var(--radius-sm) !important; }

/* ── Footer ────────────────────────────────────────── */
.aparai-footer { background: var(--gray-900); color: #ccc; }

.footer-top { padding: 3rem 0 2rem; }

.footer-brand-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--primary-light);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.3rem;
  font-family: var(--font-main);
}

.footer-brand-name { font-size: 1.1rem; font-weight: 800; color: #fff; letter-spacing: 1px; }
.footer-brand-sub  { font-size: 0.72rem; color: var(--gray-500); text-transform: uppercase; }
.footer-desc       { font-size: 0.83rem; color: var(--gray-500); margin-top: 0.5rem; line-height: 1.7; }

.footer-heading { color: #fff; font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { font-size: 0.83rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.footer-links a { color: var(--gray-500); text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }

.footer-badge {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--gray-500);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 50px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1.2rem 0;
  font-size: 0.8rem;
  color: var(--gray-700);
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* ── Stat Cards ────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-value { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.75); margin-top: 0.2rem; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: all var(--transition);
  padding: 0.5rem 1.25rem;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,71,161,0.35);
}

.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); transform: translateY(-1px); }

/* ── Forms ─────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  transition: all var(--transition);
  background: #fff;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
  outline: none;
}

.form-label { font-weight: 600; font-size: 0.875rem; color: var(--gray-700); margin-bottom: 0.4rem; }
.form-text  { font-size: 0.78rem; }

/* ── Tables ─────────────────────────────────────────── */
.table {
  font-size: 0.88rem;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--gray-100);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-300);
  padding: 0.85rem 1rem;
}

.table tbody td { padding: 0.85rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--gray-200); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }

/* ── Badges ─────────────────────────────────────────── */
.badge { font-family: var(--font-main); font-weight: 600; letter-spacing: 0.3px; }

/* ── Page Header ─────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 2rem 0 1.5rem;
  margin-bottom: 2rem;
}

.page-header h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.page-header p  { opacity: 0.8; margin: 0.3rem 0 0; font-size: 0.9rem; }

/* ── Login Page ──────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -100px; right: -100px;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px; left: -80px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: #fff;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(13,71,161,0.35);
}

.login-title    { font-size: 1.4rem; font-weight: 800; color: var(--primary); text-align: center; }
.login-subtitle { font-size: 0.85rem; color: var(--gray-500); text-align: center; margin-bottom: 1.5rem; }

/* Tab styles */
.auth-tabs .nav-link {
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.6rem 1rem;
  transition: all var(--transition);
}

.auth-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: none;
}

/* ── Test Page ───────────────────────────────────────── */
.test-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: #fff;
  padding: 1rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  letter-spacing: 2px;
  min-width: 110px;
  text-align: center;
}

.timer-display.warning { background: rgba(255,152,0,0.3); border-color: rgba(255,152,0,0.6); color: #ffe082; }
.timer-display.danger  { background: rgba(244,67,54,0.4); border-color: rgba(244,67,54,0.7); animation: pulse 1s infinite; }

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

/* ── Question Cards ──────────────────────────────────── */
.question-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition);
  background: #fff;
  overflow: hidden;
}

.question-card:hover { box-shadow: var(--shadow-md); }

.question-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  letter-spacing: 0.5px;
}

.question-text { font-size: 1rem; font-weight: 600; color: var(--gray-900); line-height: 1.6; }

/* Option Buttons */
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  margin-bottom: 0.5rem;
  background: #fff;
}

.option-label:hover    { border-color: var(--accent); background: var(--accent-light); }
.option-label.selected { border-color: var(--primary); background: #e8eaf6; }

.option-input { display: none; }

.option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.option-label:hover .option-letter    { background: var(--accent); color: #fff; }
.option-label.selected .option-letter { background: var(--primary); color: #fff; }

/* Result Option States */
.option-label.correct   { border-color: var(--success); background: var(--success-light); }
.option-label.incorrect { border-color: var(--danger);  background: var(--danger-light);  }
.option-label.correct   .option-letter { background: var(--success); color: #fff; }
.option-label.incorrect .option-letter { background: var(--danger);  color: #fff; }

/* ── Progress Bar ────────────────────────────────────── */
.progress { height: 8px; border-radius: 50px; background: var(--gray-200); }
.progress-bar { border-radius: 50px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s ease; }

/* ── Score Circle ────────────────────────────────────── */
.score-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; margin: 0 auto;
  border: 6px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 6px rgba(13,71,161,0.15);
  position: relative;
}

.score-value { font-size: 2.2rem; line-height: 1; }
.score-total { font-size: 0.85rem; opacity: 0.7; }

/* ── Utility ─────────────────────────────────────────── */
.text-mono { font-family: var(--font-mono); }

.code-badge {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(33,150,243,0.25);
  letter-spacing: 2px;
}

.section-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0;
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--gray-500);
}

.empty-state i { font-size: 3rem; color: var(--gray-300); display: block; margin-bottom: 1rem; }

/* ── Warning Modal ───────────────────────────────────── */
#tab-warning-modal .modal-content {
  border: 2px solid var(--warning);
  border-radius: var(--radius);
}

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.35s ease both; }
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 576px) {
  .login-card { padding: 2rem 1.25rem; }
  .stat-value { font-size: 1.6rem; }
  .timer-display { font-size: 1.25rem; }
  .question-text { font-size: 0.92rem; }
  .page-header h1 { font-size: 1.3rem; }
}

/* ── Print Styles ────────────────────────────────────── */
@media print {
  .aparai-navbar, .aparai-footer, .btn, .alert { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
