/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --navy:        #0d1b2e;
  --navy-mid:    #122240;
  --navy-light:  #1a3458;
  --orange:      #f5821f;
  --orange-dark: #d9680f;
  --white:       #ffffff;
  --gray-50:     #f7f9fc;
  --gray-100:    #edf1f7;
  --gray-200:    #dce4ef;
  --gray-400:    #9aadc7;
  --gray-600:    #5a6f8a;
  --gray-800:    #1e3048;
  --text:        #1a2a3c;
  --radius-sm:   6px;
  --radius-md:   10px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.18);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top nav ───────────────────────────────────────────────────────────────── */
.top-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--navy-light);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-logo { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; object-fit: cover; border: 2px solid var(--orange); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.9rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: var(--navy-light);
}

.nav-links a.active { color: var(--orange); }

/* ── Hamburger button ──────────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ─────────────────────────────────────────────────────── */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-light);
  padding: 0.5rem 0;
}

@media (max-width: 640px) {
  .nav-mobile.open { display: flex; }
}

.nav-mobile a {
  padding: 0.75rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-mobile a:hover { background: var(--navy-light); color: var(--white); }
.nav-mobile a.active { color: var(--orange); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 55%, #1a3a60 100%);
  padding: 4rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 110%, rgba(245,130,31,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at -10% 50%,  rgba(26,52,88,0.6)   0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--gray-400);
  margin-bottom: 2rem;
}

/* ── Search card (inside hero) ─────────────────────────────────────────────── */
.search-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.search-card h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
}

.field input, .field select {
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--white);
  color: var(--text);
}

.field input:focus, .field select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,31,0.15);
}

.field input[type="text"] { width: 135px; }
.field select { width: 130px; }

button.search-btn {
  padding: 0.62rem 1.6rem;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  align-self: flex-end;
  letter-spacing: 0.02em;
}

button.search-btn:hover  { background: var(--orange-dark); transform: translateY(-1px); }
button.search-btn:active { transform: translateY(0); }
button.search-btn:disabled { background: var(--gray-400); cursor: default; transform: none; }

/* ── Status ────────────────────────────────────────────────────────────────── */
.status {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.status.error { color: #c0392b; }

/* ── Main container (results area) ────────────────────────────────────────── */
.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  flex: 1;
}

/* ── Results header ────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.results-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.results-header span { font-size: 0.82rem; color: var(--gray-600); }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.filter-bar .field input[type="text"] { width: 210px; }
.filter-bar .field select { width: 140px; }

/* ── Type dropdown filter ──────────────────────────────────────────────────── */
.type-dropdown { position: relative; }

.type-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 170px;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.type-dropdown-btn:focus,
.type-dropdown-btn.open {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,31,0.15);
  outline: none;
}

.type-dropdown-arrow { font-size: 0.7rem; color: var(--gray-600); flex-shrink: 0; }

.type-dropdown-menu {
  display: none !important;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 0.4rem 0;
}

.type-dropdown-menu.open { display: block !important; }

.type-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}

.type-option:hover { background: var(--gray-50); }
.type-option input[type="checkbox"] { accent-color: var(--orange); width: 15px; height: 15px; cursor: pointer; }
.type-option-all { font-weight: 700; }
.type-divider { border: none; border-top: 1px solid var(--gray-200); margin: 0.25rem 0; }

/* ── Table ─────────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

thead th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--navy);
  border-bottom: 2px solid var(--navy-light);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  font-weight: 700;
}

tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f5ff; }
tbody td { padding: 0.65rem 0.9rem; }

a.link {
  color: var(--orange);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

a.link:hover { text-decoration: underline; color: var(--orange-dark); }

.dist-col { color: var(--gray-600); white-space: nowrap; }

.state-badge {
  display: inline-block;
  background: rgba(245,130,31,0.12);
  color: var(--orange-dark);
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  letter-spacing: 0.04em;
}

/* ── Note ──────────────────────────────────────────────────────────────────── */
.note {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  background: #fffbeb;
  border: 1.5px solid #f6e05e;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #744210;
  line-height: 1.5;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination .page-info { white-space: nowrap; }
.page-btns { display: flex; gap: 0.4rem; align-items: center; }

.page-btns button {
  padding: 0.3rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  cursor: pointer;
  color: var(--gray-800);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.page-btns button:hover:not(:disabled) {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.page-btns button:disabled { opacity: 0.4; cursor: default; }

/* ── Expandable district rows ──────────────────────────────────────────────── */
tbody tr.district-row {
  cursor: pointer;
}

tbody tr.district-row:hover { background: #eef3fb; }
tbody tr.district-row.expanded { background: #eef3fb; }

.row-num   { color: var(--gray-400); width: 2rem; }
.row-name  { font-weight: 600; }

.has-site {
  font-size: 0.75rem;
  vertical-align: middle;
  margin-left: 0.25rem;
  opacity: 0.7;
}

.row-chevron {
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--gray-400);
  font-size: 1rem;
  transition: transform 0.2s ease;
  line-height: 1;
}

tr.district-row.expanded .row-chevron { transform: rotate(90deg); }

/* Detail panel row */
tr.detail-row td.detail-cell {
  padding: 0;
  border-bottom: 2px solid var(--orange);
}

.detail-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--navy);
  animation: slideDown 0.18s ease;
}

.detail-panel.loading,
.detail-panel.error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-400);
  font-size: 0.88rem;
  padding: 0.9rem 1.25rem;
}

.detail-panel.error { color: #e87a6a; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.detail-icon { font-size: 1rem; margin-top: 0.1rem; flex-shrink: 0; }

.detail-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  margin-bottom: 0.15rem;
}

.detail-value {
  display: block;
  font-size: 0.88rem;
  color: var(--white);
  line-height: 1.4;
  word-break: break-word;
}

.detail-value a.link { color: var(--orange); font-size: 0.88rem; }

/* ── Sortable headers ──────────────────────────────────────────────────────── */
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--white); background: var(--navy-light); }

thead th .sort-icon {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.4;
  font-size: 0.68rem;
}

thead th.sort-asc .sort-icon::after  { content: '▲'; opacity: 1; color: var(--orange); }
thead th.sort-desc .sort-icon::after { content: '▼'; opacity: 1; color: var(--orange); }
thead th:not(.sort-asc):not(.sort-desc) .sort-icon::after { content: '⇅'; }

/* ── Classroom banner ──────────────────────────────────────────────────────── */
.classroom-banner {
  width: 100%;
  height: 340px;
  background: url('/img/classroom.jpg') center center / cover no-repeat;
  position: relative;
}

.classroom-banner.animate {
  transition: height 0.4s ease, opacity 0.4s ease;
}

.classroom-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,27,46,0.25) 0%, rgba(13,27,46,0.08) 60%, rgba(247,249,252,0.9) 100%);
}

.classroom-banner.hidden {
  height: 0;
  opacity: 0;
  overflow: hidden;
}

/* ── Info pages (About / Help) ─────────────────────────────────────────────── */
.info-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.info-page-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.info-page-lead {
  font-size: 1.05rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 1.5rem;
}

.info-section {
  margin-bottom: 1.75rem;
}

.info-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--orange);
  margin-bottom: 0.5rem;
}

.info-section p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gray-800);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: var(--gray-400);
  font-size: 0.8rem;
  padding: 1rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-inner a { color: var(--orange); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ── Erin's page ───────────────────────────────────────────────────────────── */
.erin-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0;
}

.erin-tab-btn {
  padding: 0.55rem 1.4rem;
  border: 2px solid var(--gray-200);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.erin-tab-btn:hover { background: var(--gray-200); }
.erin-tab-btn.active { background: var(--white); color: var(--navy); border-color: var(--gray-200); }

.erin-badge {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.erin-panel {
  display: none;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
}

.erin-panel.active { display: block; }

.erin-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.erin-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.95rem;
}

.erin-search-wrap input {
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem 2.3rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.erin-search-wrap input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,31,0.15);
}

.erin-count {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 0.6rem;
}

.erin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

.erin-table thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--navy);
  border-bottom: 2px solid var(--navy-light);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  font-weight: 700;
}

.erin-table tbody tr.erin-district-row { border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.erin-table tbody tr.erin-district-row:hover { background: #eef3fb; }
.erin-table tbody tr.erin-district-row.expanded { background: #eef3fb; }
.erin-table tbody td { padding: 0.65rem 0.75rem; }

.erin-check {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: var(--orange);
}

/* Detail row (mobile) */
.erin-detail-row { display: none; }
.erin-detail-row.open { display: table-row; }

.erin-detail-cell { padding: 0 !important; border-bottom: 2px solid var(--orange) !important; }

.erin-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--navy);
}

.erin-detail-panel a { color: var(--orange); text-decoration: none; font-size: 0.9rem; }
.erin-detail-panel a:hover { text-decoration: underline; }

.erin-applied-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray-400);
  cursor: pointer;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem 3rem; }
  .hero-title { font-size: 1.5rem; }
  .search-card { padding: 1.25rem; }
  .field input[type="text"] { width: 110px; }
  .filter-bar .field input[type="text"] { width: 150px; }
  thead th:nth-child(3), tbody td:nth-child(3) { display: none; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Erin's page mobile */
  .ecol-num, .ecol-jobs, .ecol-dist, .ecol-app { display: none; }
  .erin-detail-row.open { display: table-row; }
}
