/* Akuzumishi CBT - Modern Styles v2.0 */
/* Brand: #1a3a8f (primary), #3a9e3f (accent), #0d1b4b (dark navy) */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f0f4ff;
  -webkit-font-smoothing: antialiased;
}

/* ── Custom scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ── Focus ring ───────────────────────────────────────────── */
input:focus, select:focus, textarea:focus, button:focus { outline: none; }

/* ── Logo ─────────────────────────────────────────────────── */
nav img[alt*="Logo"], footer img[alt*="Logo"] {
  background-color: #ffffff;
  display: block;
}
.logo-wrap {
  background: #ffffff;
  border-radius: 12px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26,58,143,0.15);
}

/* ── Page transitions ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
main { animation: fadeInUp 0.3s ease both; }

/* ── Button hover effects ─────────────────────────────────── */
a, button { transition: all 0.2s ease; }

/* ── Card hover lift ──────────────────────────────────────── */
.card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
  box-shadow: 0 8px 32px rgba(26,58,143,0.14);
  transform: translateY(-2px);
}

/* ── Toast notifications ──────────────────────────────────── */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.95); }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  pointer-events: all;
  cursor: pointer;
  min-width: 280px;
  max-width: 380px;
  animation: toastSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  border-left: 4px solid;
}
.toast.toast-success { background: #fff; border-color: #3a9e3f; }
.toast.toast-error   { background: #fff; border-color: #ef4444; }
.toast.toast-info    { background: #fff; border-color: #1a3a8f; }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast-success .toast-icon { color: #3a9e3f; }
.toast-error   .toast-icon { color: #ef4444; }
.toast-info    .toast-icon { color: #1a3a8f; }
.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}
.toast-closing { animation: toastSlideOut 0.3s ease forwards; }

/* ── Exam timer warning ───────────────────────────────────── */
@keyframes pulse-red {
  0%, 100% { opacity: 1; color: #ef4444; }
  50%       { opacity: 0.6; color: #dc2626; }
}
.timer-warning { animation: pulse-red 1s infinite; }

/* ── Loading spinner ──────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }

/* ── Animated counter ─────────────────────────────────────── */
.counter-value { transition: all 0.5s ease; }

/* ── Score progress bar animation ────────────────────────── */
.progress-bar-animated {
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── OTP input boxes ──────────────────────────────────────── */
.otp-digit:focus {
  border-color: #1a3a8f !important;
  background: #eef1f9;
}

/* ── Scroll to top button ─────────────────────────────────── */
#scrollTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a3a8f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26,58,143,0.3);
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: none;
}
#scrollTopBtn.visible { opacity: 1; transform: translateY(0); }
#scrollTopBtn:hover { background: #0d1b4b; }

/* ── Navbar blur effect ───────────────────────────────────── */
.navbar-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Analytics bar chart ──────────────────────────────────── */
.stat-bar { transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  nav, footer, .no-print { display: none; }
  main { padding: 0; animation: none; }
}

/* ── Mobile table ─────────────────────────────────────────── */
@media (max-width: 640px) {
  table { font-size: 0.875rem; }
}

/* ── Glassmorphism ────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
}

/* ── Line clamp ───────────────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
