/* ============================================================
   upcoming-exams.css — Upcoming Exams page only
   ============================================================ */

.exams-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 72px; }

/* ── Hero ── */
.exams-hero {
  background: linear-gradient(135deg, #0d47a1 0%, #1976d2 60%, #42a5f5 100%);
  color: #fff; border-radius: 16px; padding: 32px 36px;
  margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
[data-theme="dark"] .exams-hero {
  background: linear-gradient(135deg, #0a2a5e 0%, #0d3b8a 55%, #1565c0 100%);
}
.hero-text { flex: 1 1 300px; }
.exams-hero h2 { margin: 0 0 8px; font-size: 1.5rem; font-family: 'Playfair Display', serif; color: #fff; }
.exams-hero p  { margin: 0; opacity: 0.9; font-size: 0.9rem; line-height: 1.55; max-width: 560px; color: #fff; }

/* Stats pills in hero */
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,0.18); border-radius: 10px;
  padding: 10px 18px; min-width: 90px;
}
[data-theme="dark"] .stat-pill {
  background: rgba(255,255,255,0.10);
}
.stat-pill .stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1; color: #fff; }
.stat-pill span:last-child { font-size: 0.7rem; opacity: 0.88; margin-top: 3px; text-align: center; color: #fff; }
.stat-open    { border-bottom: 3px solid #a5d6a7; }
.stat-upcoming { border-bottom: 3px solid #90caf9; }
.stat-results { border-bottom: 3px solid #ce93d8; }

/* ── Search + filter row ── */
.search-filter-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-box {
  position: relative; flex: 1 1 220px; max-width: 360px;
}
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: #888; pointer-events: none;
}
[data-theme="dark"] .search-icon { color: #666; }

#search-input {
  width: 100%; padding: 9px 36px 9px 34px;
  border: 2px solid var(--border, #ddd); border-radius: 22px;
  font-family: 'Poppins', sans-serif; font-size: 0.88rem;
  background: var(--bg, #fff); color: var(--text, #222);
  outline: none; transition: border-color 0.15s;
}
#search-input::placeholder { color: #aaa; }
#search-input:focus { border-color: #1976d2; }
[data-theme="dark"] #search-input {
  background: #1a1a2e; border-color: #333; color: #e0e0e0;
}
[data-theme="dark"] #search-input::placeholder { color: #555; }
[data-theme="dark"] #search-input:focus { border-color: #5b8fd4; }

.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 0.8rem;
  color: #888; padding: 2px 4px;
}
.search-clear:hover { color: var(--text, #222); }
[data-theme="dark"] .search-clear { color: #555; }
[data-theme="dark"] .search-clear:hover { color: #ccc; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 18px; border: 2px solid #0d47a1; border-radius: 20px;
  background: none; color: #0d47a1; font-family: 'Poppins', sans-serif;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn.active,
.filter-btn:hover { background: #0d47a1; color: #fff; }

[data-theme="dark"] .filter-btn {
  border-color: #90caf9; color: #90caf9;
}
[data-theme="dark"] .filter-btn.active,
[data-theme="dark"] .filter-btn:hover {
  background: #1565c0; color: #fff; border-color: #1565c0;
}

/* Results count */
.results-info { font-size: 0.82rem; color: #888; margin-bottom: 14px; min-height: 1.2em; }
[data-theme="dark"] .results-info { color: #666; }

/* ── Grid ── */
.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

/* ── Card ── */
.exam-card {
  background: #fff;
  border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  border-left: 5px solid #0d47a1;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform 0.15s, box-shadow 0.15s;
  /* prevent any child from bursting the card boundary */
  min-width: 0; overflow-wrap: break-word; word-break: break-word;
}
.exam-card:hover { transform: translateY(-3px); box-shadow: 0 7px 22px rgba(0,0,0,0.11); }
[data-theme="dark"] .exam-card {
  background: #1e1e2e;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  border-left-color: #2a4a8a;
}
[data-theme="dark"] .exam-card:hover { box-shadow: 0 7px 22px rgba(0,0,0,0.5); }

/* Status-based left border — light */
.exam-card--status-open     { border-left-color: #2e7d32; }
.exam-card--status-upcoming { border-left-color: #1565c0; }
.exam-card--status-closed   { border-left-color: #757575; }
.exam-card--status-results  { border-left-color: #6a1b9a; }
/* Status-based left border — dark */
[data-theme="dark"] .exam-card--status-open     { border-left-color: #43a047; }
[data-theme="dark"] .exam-card--status-upcoming { border-left-color: #1976d2; }
[data-theme="dark"] .exam-card--status-closed   { border-left-color: #555; }
[data-theme="dark"] .exam-card--status-results  { border-left-color: #8e24aa; }

/* Card header row */
.exam-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}

/* Category badge */
.exam-category-badge {
  padding: 2px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 600;
  background: #e3f2fd; color: #0d47a1;
  white-space: nowrap;
}
[data-theme="dark"] .exam-category-badge { background: #1a3a5c; color: #90caf9; }

/* Status badges — light */
.exam-status-badge {
  padding: 2px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 700;
  white-space: nowrap;
}
.status-open     { background: #e8f5e9; color: #2e7d32; }
.status-upcoming { background: #e3f2fd; color: #1565c0; }
.status-closed   { background: #f5f5f5; color: #616161; }
.status-results  { background: #f3e5f5; color: #6a1b9a; }

/* Status badges — dark */
[data-theme="dark"] .status-open     { background: #1b3a1e; color: #81c784; }
[data-theme="dark"] .status-upcoming { background: #1a2f4a; color: #90caf9; }
[data-theme="dark"] .status-closed   { background: #2a2a2a; color: #9e9e9e; }
[data-theme="dark"] .status-results  { background: #2e1a3a; color: #ce93d8; }

/* Title */
.exam-card-title {
  font-size: 1rem; font-weight: 700; color: #0d47a1;
  font-family: 'Poppins', sans-serif; line-height: 1.35;
  overflow-wrap: break-word; word-break: break-word;
}
[data-theme="dark"] .exam-card-title { color: #90caf9; }

/* Description */
.exam-description {
  font-size: 0.8rem; color: #666; line-height: 1.5;
  border-left: 2px solid #e0e0e0; padding-left: 8px;
  overflow-wrap: break-word; word-break: break-word;
}
[data-theme="dark"] .exam-description { color: #aaa; border-left-color: #333; }

/* Detail rows */
.exam-detail-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.85rem; color: #555; line-height: 1.45;
  min-width: 0;
}
[data-theme="dark"] .exam-detail-row { color: #bbb; }
.exam-detail-row .label {
  font-weight: 600; color: #222; min-width: 100px; flex-shrink: 0; font-size: 0.82rem;
}
[data-theme="dark"] .exam-detail-row .label { color: #ddd; }
/* value side of each detail row must shrink and wrap */
.exam-detail-row span:last-child {
  flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word;
}

/* Vacancies + Fee chips */
.exam-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.meta-chip {
  font-size: 0.73rem; font-weight: 600; border-radius: 8px;
  padding: 3px 9px;
  /* allow long fee strings to wrap rather than overflow */
  white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.meta-vac { background: #fff3e0; color: #e65100; }
.meta-fee { background: #e8f5e9; color: #2e7d32; }
[data-theme="dark"] .meta-vac { background: #2a1a00; color: #ffb74d; }
[data-theme="dark"] .meta-fee { background: #1b3a1e; color: #81c784; }

/* Latest news strip */
.exam-news {
  font-size: 0.78rem; background: #fffde7; border-radius: 6px;
  padding: 6px 10px; color: #555; border-left: 3px solid #f9a825; line-height: 1.4;
  overflow-wrap: break-word; word-break: break-word;
}
.exam-news a { color: #e65100; text-decoration: none; overflow-wrap: break-word; }
.exam-news a:hover { text-decoration: underline; }
[data-theme="dark"] .exam-news { background: #2a2000; color: #ccc; border-color: #f9a825; }
[data-theme="dark"] .exam-news a { color: #ffb74d; }

/* CTA footer */
.exam-card-footer { margin-top: auto; padding-top: 6px; }
.exam-link {
  display: inline-block; padding: 8px 20px; background: #0d47a1;
  color: #fff; border-radius: 6px; text-decoration: none;
  font-size: 0.82rem; font-weight: 600; font-family: 'Poppins', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.exam-link:hover { background: #1565c0; transform: translateY(-1px); }
[data-theme="dark"] .exam-link { background: #1565c0; }
[data-theme="dark"] .exam-link:hover { background: #1976d2; }

.exam-link-apply { background: #2e7d32; }
.exam-link-apply:hover { background: #1b5e20; }
[data-theme="dark"] .exam-link-apply { background: #388e3c; }
[data-theme="dark"] .exam-link-apply:hover { background: #2e7d32; }

/* Empty / loading */
.exams-status { text-align: center; padding: 60px 20px; color: #888; font-size: 1rem; grid-column: 1/-1; }
[data-theme="dark"] .exams-status { color: #555; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .exams-hero { padding: 22px 20px; flex-direction: column; }
  .exams-hero h2 { font-size: 1.2rem; }
  .hero-stats { width: 100%; justify-content: space-between; }
  .stat-pill { flex: 1 1 80px; }
  .search-filter-row { flex-direction: column; align-items: flex-start; }
  .search-box { max-width: 100%; width: 100%; }
  .exams-grid { grid-template-columns: 1fr; }
}
