/* ExamPath — main.css
   Mobile-first, system fonts, CSS custom properties
   No framework dependencies */

/* ===== VARIABLES ===== */
:root {
  --ink: #1a2332;
  --ink-light: #4a5568;
  --muted: #718096;
  --bg: #f7fafc;
  --bg-card: #ffffff;
  --accent: #1a5276;
  --accent-light: #2980b9;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --border: #e2e8f0;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Fira Code", monospace;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== SKIP NAV ===== */
.skip-nav {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff; padding: 8px 16px;
  z-index: 100; transition: top 0.2s;
}
.skip-nav:focus { top: 0; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky; top: 0; z-index: 50;
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.1rem; font-weight: 700; color: var(--ink);
  text-decoration: none;
}
.nav-links {
  list-style: none; display: flex; gap: 16px; font-size: 0.9rem;
}
.nav-links a { color: var(--ink-light); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ===== MAIN CONTENT ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}
h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.2rem; margin: 24px 0 12px; }

/* ===== HERO ===== */
.hero, .page-hero {
  text-align: center; padding: 40px 16px 32px; margin-bottom: 24px;
}
.hero-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: #e8f4fd; color: var(--accent);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 16px; border: 1px solid #d0e7f9;
}
.hero h1 { font-size: 2rem; color: var(--ink); font-weight: 800; }
.hero-subtitle { font-size: 1.05rem; color: var(--ink-light); margin-top: 12px; max-width: 680px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.hero-trust-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; font-size: 0.85rem; color: var(--ink-light);
  flex-wrap: wrap;
}
.trust-item { font-weight: 600; }
.trust-dot { color: var(--muted); }

/* ===== SECTION HEADERS ===== */
.section-header { margin-bottom: 16px; }
.section-header h2 { margin: 0 0 4px; font-size: 1.3rem; font-weight: 700; }
.section-subtitle { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ===== CARDS ===== */
.exams-grid {
  margin: 32px 0;
}

.exam-card-wrapper {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.exam-card {
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.exam-card h3 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.exam-card__desc { font-size: 0.85rem; margin-bottom: 12px; line-height: 1.4; }

.exam-card--active {
  background: #f0fdf4; /* Ultra-soft medical green background */
  border: 1px solid #bbf7d0;
  border-top: 5px solid #16a34a; /* Medical Green Accent */
}
.exam-card--active h3 { color: #14532d; }
.exam-card--active .exam-card__desc { color: #166534; }
.exam-card--active .exam-card__badge { background: #dcfce7; color: #15803d; }

.exam-card--jee {
  background: #eff6ff; /* Ultra-soft tech blue background */
  border: 1px solid #bfdbfe;
  border-top: 5px solid #2563eb; /* Tech Blue Accent */
}
.exam-card--jee h3 { color: #1e3a8a; }
.exam-card--jee .exam-card__desc { color: #1e40af; }
.exam-card--jee .exam-card__badge { background: #dbeafe; color: #1d4ed8; }
.exam-card--jee .exam-card__status {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.exam-card--cuet {
  background: #faf5ff; /* Ultra-soft academic purple background */
  border: 1px solid #e9d5ff;
  border-top: 5px solid #8b5cf6; /* Academic Purple Accent */
}
.exam-card--cuet h3 { color: #581c87; }
.exam-card--cuet .exam-card__desc { color: #6b21a8; }
.exam-card--cuet .exam-card__badge { background: #f3e8ff; color: #6d28d9; }
.exam-card--cuet .exam-card__status {
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  color: #6b21a8;
}

.exam-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.exam-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.exam-card__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
}

.exam-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px 0 16px;
}
.exam-action {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: #15803d;
  transition: all 0.2s ease;
}
.exam-action:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  text-decoration: none;
}
.exam-actions--muted { opacity: 0.85; }
.exam-action--disabled {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--muted);
  cursor: not-allowed;
}
.exam-card--planned .exam-action--disabled {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: var(--muted) !important;
}

.exam-card .btn--primary {
  background: #16a34a;
  color: #ffffff;
  font-weight: 700;
  margin-top: auto;
  align-self: stretch;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.exam-card .btn--primary:hover {
  background: #15803d;
  color: #ffffff;
}

.exam-card__status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: auto;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  display: block; color: var(--ink); text-decoration: none;
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--accent);
}
.tool-card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.tool-card p { color: var(--ink-light); font-size: 0.9rem; }
.tool-card__cta {
  display: inline-block; margin-top: 12px;
  color: var(--accent-light); font-weight: 600; font-size: 0.9rem;
}

.tools-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 24px 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 10px 20px;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background 0.2s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-light); text-decoration: none; }
.btn--secondary { background: var(--border); color: var(--ink); }
.btn--secondary:hover { background: #cbd5e0; text-decoration: none; }
.btn--sm { padding: 6px 12px; font-size: 0.8rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 4px; color: var(--ink-light);
}
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem;
  background: var(--bg-card);
}
.form-group input:focus, .form-group select:focus {
  outline: 2px solid var(--accent-light); border-color: transparent;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.filter-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== TABLES ===== */

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin: 16px 0; flex-wrap: wrap;
}
.pagination__btn {
  padding: 6px 12px; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.pagination__btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.pagination__btn--active {
  background: var(--accent); color: white; border-color: var(--accent); font-weight: 600;
}
.pagination__ellipsis { padding: 6px 8px; color: var(--muted); }
.pagination-container { margin: 16px 0; }

/* ===== SEARCH RESULTS (Choice Builder) ===== */
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  gap: 8px;
}
.search-result-item:hover { background: var(--bg); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-info strong { display: block; font-size: 0.9rem; }
.search-result-meta { font-size: 0.75rem; color: var(--muted); }
.search-no-results { padding: 16px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ===== CHOICE ITEMS ===== */
.choice-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 4px 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all 0.15s;
  cursor: grab;
}
.choice-item:hover { border-color: var(--accent-light); box-shadow: var(--shadow); }
.choice-item.dragging { opacity: 0.5; border-style: dashed; }
.choice-item__rank {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: white; border-radius: 50%;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.choice-item__info { flex: 1; min-width: 0; }
.choice-item__name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-item__meta { font-size: 0.75rem; color: var(--muted); }
.choice-item__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tier-select { font-size: 0.75rem; padding: 2px 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.btn-icon {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.btn-icon:hover:not(:disabled) { background: var(--bg); border-color: var(--accent-light); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon--danger:hover:not(:disabled) { background: #fee; border-color: var(--danger); color: var(--danger); }
.rank-badge { background: var(--bg); padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; }
.choice-list__summary { margin-top: 16px; }
.summary-table td { padding: 4px 12px; font-size: 0.85rem; }

/* ===== TABLE HELPERS ===== */
.table-container { overflow-x: auto; }
.table-empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.text-right { text-align: right; }
.input-error { border-color: var(--danger) !important; animation: shake 0.3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.error-message {
  padding: 12px 16px; background: #fee; border: 1px solid var(--danger);
  border-radius: var(--radius-sm); color: var(--danger); margin-bottom: 16px;
}

/* ===== BUTTON VARIANTS ===== */
.btn--sm { padding: 4px 10px; font-size: 0.8rem; }
.btn--disabled { opacity: 0.5; cursor: not-allowed; }

.table-container { overflow-x: auto; margin: 16px 0; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.data-table th, .data-table td {
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--bg); font-weight: 600; position: sticky; top: 0;
  cursor: pointer; user-select: none;
}
.data-table th:hover { background: #edf2f7; }
.data-table tr:hover { background: #f0f4f8; }

/* ===== STATS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin: 16px 0;
}
.stat {
  text-align: center; padding: 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.stat__value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stat__label { font-size: 0.8rem; color: var(--muted); }

.stat--medical {
  background: #f0fdf4;
  border-color: #dcfce7;
}
.stat--medical .stat__value {
  color: #16a34a;
}
.stat--medical .stat__label {
  color: #15803d;
}

/* ===== TABLE & SCHEDULES ===== */
.schedule-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 16px 0;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-card);
}
.schedule-table th, .schedule-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.schedule-table th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
}
.schedule-table tr:last-child td {
  border-bottom: none;
}
.schedule-table tr:hover {
  background: #f8fafc;
}

/* ===== GUIDE CARDS ===== */
.guide-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (min-width: 768px) {
  .guide-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
.guide-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
  text-decoration: none;
}
.guide-card__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.guide-card__info {
  flex: 1;
}
.guide-card__info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.guide-card__info p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.guide-card__arrow {
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 700;
  transition: transform 0.2s;
}
.guide-card:hover .guide-card__arrow {
  transform: translateX(4px);
  color: var(--accent);
}


/* ===== SUMMARY BAR ===== */
.summary-bar {
  display: flex; gap: 24px; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  margin: 16px 0;
}

/* ===== CHOICE BUILDER ===== */
.builder-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.builder-list__header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.builder-list__header h2 { flex: 1; }
.builder-actions { display: flex; gap: 8px; }
.choice-list-container {
  min-height: 200px; margin: 12px 0; padding: 8px;
  border: 2px dashed var(--border); border-radius: var(--radius);
}
.choice-list__empty { text-align: center; padding: 32px; color: var(--muted); }
.choice-list__empty .hint { font-size: 0.8rem; margin-top: 8px; }

/* ===== WORKFLOW & ORIGIN ===== */
.workflow {
  margin: 40px 0;
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.workflow-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.workflow-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.workflow-number {
  position: absolute;
  top: -12px;
  left: 20px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(26, 82, 118, 0.3);
}
.workflow-step h3 {
  font-size: 1.05rem;
  margin: 4px 0 8px;
  font-weight: 700;
}
.workflow-step p {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
  margin: 0;
}

.origin-story {
  margin: 40px 0;
}
.origin-story__card {
  background: linear-gradient(135deg, #fdfefe 0%, #f4f9f4 100%);
  border: 1px solid #d4edda;
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.origin-story__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #d4edda;
  color: #155724;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.origin-story__content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}
.origin-story__content p {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin: 0 0 12px;
}
.origin-story__content p:last-child {
  margin-bottom: 0;
}

/* ===== DATA SOURCES & TRUST ===== */
.data-sources {
  margin: 40px 0 20px;
}
.data-sources__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) {
  .data-sources__card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.data-sources__info h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }
.data-sources__info p { font-size: 0.88rem; color: var(--ink-light); margin: 0 0 12px; }
.source-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.source-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  transition: all 0.2s ease;
}
.source-badge:hover {
  background: #e8f4fd;
  border-color: var(--accent-light);
  text-decoration: none;
}
.source-badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
}
.data-sources__meta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
@media (min-width: 768px) {
  .data-sources__meta { align-items: flex-end; }
}
.verified-tag {
  font-size: 0.72rem; font-weight: 700;
  background: #d4edda; color: #155724;
  padding: 3px 8px; border-radius: 12px;
}
.last-updated { font-size: 0.78rem; color: var(--muted); margin: 0; }

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 48px; padding: 24px 16px;
  border-top: 1px solid var(--border); text-align: center;
  font-size: 0.85rem; color: var(--muted);
}
.footer-container { max-width: var(--max-width); margin: 0 auto; }
.footer-links { margin: 8px 0; }
.footer-links a { margin: 0 8px; }
.footer-note { font-size: 0.75rem; margin-top: 8px; }

/* ===== UTILITY ===== */
.source-note { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.last-updated { font-size: 0.8rem; color: var(--muted); }
.results-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-count { font-size: 0.85rem; color: var(--muted); }
.results-note { font-size: 0.8rem; color: var(--warning); margin-top: 12px; }
.noscript-message {
  padding: 24px; background: #fff3cd; border: 1px solid #ffc107;
  border-radius: var(--radius); margin: 24px 0;
}
[hidden] { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  h1 { font-size: 1.8rem; }
  .builder-layout { grid-template-columns: 1fr 2fr; }
  main { padding: 32px 24px; }
}

@media (min-width: 1024px) {
  .filter-row { grid-template-columns: repeat(4, 1fr); }
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e2e8f0;
    --ink-light: #a0aec0;
    --muted: #718096;
    --bg: #1a202c;
    --bg-card: #2d3748;
    --border: #4a5568;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .data-table th { background: #2d3748; }
  .data-table th:hover { background: #4a5568; }
  .data-table tr:hover { background: #374151; }
}
