/* =====================================================
   Examify – Global Stylesheet
   Navy + White + Electric Blue accent
   ===================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --navy:        #0A1628;
  --navy-mid:    #112240;
  --navy-light:  #1A3A5C;
  --electric:    #2979FF;
  --electric-hover: #1565C0;
  --electric-glow: rgba(41,121,255,.25);
  --white:       #FFFFFF;
  --gray-50:     #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-400:    #94A3B8;
  --gray-600:    #475569;
  --gray-800:    #1E293B;
  --success:     #10B981;
  --warning:     #F59E0B;
  --danger:      #EF4444;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.14);
  --transition:  all .22s ease;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --white:       #0A1628;
  --gray-50:     #112240;
  --gray-100:    #1A3A5C;
  --gray-200:    #243B55;
  --gray-400:    #64748B;
  --gray-600:    #94A3B8;
  --gray-800:    #CBD5E1;
  --navy:        #E2E8F0;
  --navy-mid:    #F1F5F9;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,.5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--navy); }
.text-electric { color: var(--electric) !important; }
.text-navy { color: var(--navy) !important; }
.display-gradient {
  background: linear-gradient(135deg, var(--navy) 0%, var(--electric) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Buttons ---------- */
.btn-electric {
  background: var(--electric);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  padding: .6rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--electric-glow);
}
.btn-electric:hover {
  background: var(--electric-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--electric-glow);
}
.btn-navy {
  background: var(--navy);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  padding: .6rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-outline-electric {
  border: 2px solid var(--electric);
  color: var(--electric) !important;
  background: transparent;
  border-radius: var(--radius-md);
  padding: .5rem 1.4rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-outline-electric:hover { background: var(--electric); color: #fff !important; }
.btn-lg-cta {
  padding: .85rem 2.2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ---------- Navbar ---------- */
.examify-navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.navbar-brand .logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.5px;
}
.navbar-brand .logo-text span { color: var(--electric); }
.examify-navbar .nav-link {
  color: var(--gray-600) !important;
  font-weight: 500;
  padding: .4rem .75rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.examify-navbar .nav-link:hover,
.examify-navbar .nav-link.active { color: var(--electric) !important; background: rgba(41,121,255,.07); }

/* ---------- Hero Section ---------- */
.hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #0D47A1 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(41,121,255,.3) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(41,121,255,.2);
  border: 1px solid rgba(41,121,255,.4);
  color: #93C5FD;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero-section h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.5rem); }
.hero-section p { color: rgba(255,255,255,.8); font-size: 1.1rem; }

/* ---------- Cards ---------- */
.examify-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.examify-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--electric), #1E40AF);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; margin-bottom: 1rem;
}

/* ---------- Pricing Cards ---------- */
.pricing-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
}
.pricing-card.popular {
  border-color: var(--electric);
  box-shadow: 0 8px 32px var(--electric-glow);
  transform: scale(1.03);
}
.pricing-card .price { font-size: 2.8rem; font-weight: 800; color: var(--navy); }
.pricing-card .price sup { font-size: 1.2rem; vertical-align: super; }
.pricing-card .price-period { font-size: .88rem; color: var(--gray-400); }
.popular-badge {
  position: absolute;
  top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--electric);
  color: #fff; font-size: .75rem; font-weight: 700;
  padding: .25rem .9rem; border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Sidebar App Layout ---------- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; height: 100vh;
  z-index: 1020;
  transition: transform .3s ease;
}
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 1.2rem; font-weight: 800; color: #fff;
}
.sidebar-logo span { color: var(--electric); }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav .nav-item { margin: .1rem .75rem; }
.sidebar-nav .nav-link {
  color: rgba(255,255,255,.7) !important;
  border-radius: var(--radius-sm);
  padding: .6rem .9rem !important;
  display: flex; align-items: center; gap: .6rem;
  font-weight: 500; font-size: .92rem;
  transition: var(--transition);
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: #fff !important;
  background: rgba(41,121,255,.25) !important;
}
.sidebar-nav .nav-link.active { border-left: 3px solid var(--electric); }
.sidebar-section-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,.35);
  padding: .8rem 1.5rem .25rem;
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .82rem; color: rgba(255,255,255,.6);
}
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  background: var(--gray-50);
}
.top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.content-area { padding: 1.5rem; }

/* ---------- Stat Cards ---------- */
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.stat-card .stat-label { font-size: .82rem; color: var(--gray-400); font-weight: 500; }
.stat-card .stat-change { font-size: .8rem; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---------- Chart Placeholder ---------- */
.chart-placeholder {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: .5rem;
  color: var(--gray-400); font-size: .9rem;
  border: 2px dashed var(--gray-200);
}
.chart-placeholder i { font-size: 2.5rem; opacity: .5; }

/* ---------- Progress Bar Custom ---------- */
.progress-custom {
  height: 8px; border-radius: 999px;
  background: var(--gray-200); overflow: hidden;
}
.progress-custom .fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--electric), #1E40AF);
  transition: width .5s ease;
}

/* ---------- Question UI ---------- */
.question-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.option-btn {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .85rem 1.2rem;
  margin-bottom: .6rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  display: flex; align-items: center; gap: .75rem;
  color: var(--gray-800);
}
.option-btn:hover { border-color: var(--electric); background: rgba(41,121,255,.04); }
.option-btn.selected { border-color: var(--electric); background: rgba(41,121,255,.08); color: var(--electric); }
.option-btn.correct { border-color: var(--success); background: rgba(16,185,129,.08); color: var(--success); }
.option-btn.incorrect { border-color: var(--danger); background: rgba(239,68,68,.08); color: var(--danger); }
.option-label {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-200); display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex-shrink: 0;
}

/* ---------- Timer ---------- */
.exam-timer {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-md);
  padding: .5rem 1rem;
  font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.exam-timer.warning { background: var(--warning); }
.exam-timer.danger { background: var(--danger); animation: pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ---------- Question Palette ---------- */
.q-palette { display: flex; flex-wrap: wrap; gap: .35rem; }
.q-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); background: var(--white);
  font-size: .78rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); color: var(--gray-600);
}
.q-btn.answered { background: var(--electric); border-color: var(--electric); color: #fff; }
.q-btn.flagged { background: var(--warning); border-color: var(--warning); color: #fff; }
.q-btn.current { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.q-btn.correct { background: var(--success); border-color: var(--success); color: #fff; }
.q-btn.incorrect { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Coach Panel ---------- */
.ai-panel {
  background: linear-gradient(180deg, #F0F7FF 0%, #EBF4FF 100%);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.ai-panel .ai-header {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; color: var(--electric); margin-bottom: .75rem;
}
.ai-badge {
  background: linear-gradient(135deg, var(--electric), #1E40AF);
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 999px;
}

/* ---------- Chat UI ---------- */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble {
  max-width: 75%; padding: .75rem 1rem;
  border-radius: var(--radius-md); font-size: .93rem; line-height: 1.5;
}
.chat-bubble.user {
  background: var(--electric); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
  background: var(--white); color: var(--gray-800); align-self: flex-start;
  border: 1px solid var(--gray-200); border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.chat-input-area {
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding: 1rem; display: flex; gap: .75rem; align-items: flex-end;
}
.chat-input {
  flex: 1; border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  padding: .6rem 1rem; resize: none; font-family: var(--font);
  transition: var(--transition);
}
.chat-input:focus { border-color: var(--electric); outline: none; }

/* ---------- Wizard Steps ---------- */
.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 2rem; }
.wizard-step {
  display: flex; align-items: center; gap: .5rem; flex: 1;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1; height: 2px; background: var(--gray-200); margin: 0 .5rem;
}
.wizard-step.done::after { background: var(--electric); }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--gray-200); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--gray-400);
  flex-shrink: 0; transition: var(--transition);
}
.wizard-step.active .step-circle { border-color: var(--electric); color: var(--electric); }
.wizard-step.done .step-circle { background: var(--electric); border-color: var(--electric); color: #fff; }

/* ---------- Badge Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.tag-blue { background: #DBEAFE; color: #1D4ED8; }
.tag-green { background: #D1FAE5; color: #065F46; }
.tag-orange { background: #FEF3C7; color: #92400E; }
.tag-red { background: #FEE2E2; color: #991B1B; }
.tag-purple { background: #EDE9FE; color: #5B21B6; }

/* ---------- Table ---------- */
.examify-table { width: 100%; border-collapse: collapse; }
.examify-table th {
  background: var(--gray-50); color: var(--gray-600);
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: .75rem 1rem; text-align: left;
  border-bottom: 2px solid var(--gray-200);
}
.examify-table td {
  padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100);
  font-size: .9rem; vertical-align: middle;
}
.examify-table tr:hover td { background: var(--gray-50); }

/* ---------- Auth Pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-input {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem; width: 100%;
  font-size: .95rem; transition: var(--transition);
  background: var(--white); color: var(--gray-800);
}
.auth-input:focus { border-color: var(--electric); outline: none; box-shadow: 0 0 0 3px var(--electric-glow); }

/* ---------- Breadcrumb ---------- */
.examify-breadcrumb { font-size: .82rem; color: var(--gray-400); margin-bottom: 1rem; }
.examify-breadcrumb a { color: var(--electric); text-decoration: none; }
.examify-breadcrumb a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.examify-footer {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  padding: 3rem 0 1.5rem;
}
.examify-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.examify-footer a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .88rem; display: block; margin-bottom: .4rem; transition: color .2s; }
.examify-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.25rem; font-size: .82rem; text-align: center; }

/* ---------- Dark Mode Toggle ---------- */
.dark-toggle {
  width: 44px; height: 24px; border-radius: 999px;
  background: var(--gray-200); border: none; cursor: pointer;
  position: relative; transition: background .3s;
}
.dark-toggle::after {
  content: '';
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; position: absolute; top: 3px; left: 3px;
  transition: transform .3s; box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .dark-toggle { background: var(--electric); }
[data-theme="dark"] .dark-toggle::after { transform: translateX(20px); }

/* ---------- Alerts ---------- */
.alert-electric {
  background: rgba(41,121,255,.1); border: 1px solid rgba(41,121,255,.3);
  color: #1D4ED8; border-radius: var(--radius-sm); padding: .75rem 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .pricing-card.popular { transform: none; }
}
@media (max-width: 576px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .auth-card { padding: 1.75rem; }
  .content-area { padding: 1rem; }
}

/* ---------- Animations ---------- */
.fade-in { animation: fadeIn .4s ease forwards; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.slide-in { animation: slideIn .3s ease forwards; }
@keyframes slideIn { from{transform:translateX(-20px);opacity:0} to{transform:translateX(0);opacity:1} }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
