@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ── UC ANR Official Color Palette ─────────────────────────────────────────
   Primary:
     ANR Blue  #005fae  (Pantone 2388C)
     ANR Gold  #fdbd10  (Pantone 3514C)
     Sky Blue  #3aa8e4  (Pantone 299C)
   Secondary Accent:
     Dark Blue  #003c61
     Oak Green  #67893e
     Brown      #956c26
     Warm Grey  #847d77
     Salmon     #d76f40
     Red        #ab312c
     Teal       #0aa9b3
     Bright Grn #9fc54d
  ──────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  /* UC ANR primary */
  --anr-blue:     #005fae;
  --anr-gold:     #fdbd10;
  --sky-blue:     #3aa8e4;

  /* UC ANR secondary */
  --dark-blue:    #003c61;
  --oak-green:    #67893e;
  --brown:        #956c26;
  --warm-grey:    #847d77;
  --salmon:       #d76f40;
  --anr-red:      #ab312c;
  --teal:         #0aa9b3;
  --bright-green: #9fc54d;
  --gold-light:   #f3cc30;

  /* Layout tones derived from palette */
  --bg-deep:      #00243d;   /* darkened dark-blue for page bg */
  --bg-mid:       #003256;   /* dark-blue slightly lighter */
  --bg-card:      #00395f;   /* card backgrounds */
  --bg-card2:     #004070;   /* slightly lighter card variant */
  --text-primary: #ffffff;
  --text-body:    #d8eaf8;   /* light blue-white for body text */
  --text-muted:   #8fb8d8;   /* muted blue-grey */
  --text-faint:   #5a8aaa;   /* faint accents */
  --gold:         #fdbd10;
  --gold-lt:      #fdd34a;
  --gold-pale:    #fee895;
  --green:        #67893e;
  --green-lt:     #9fc54d;
}

body { background: var(--bg-deep); font-family: 'Source Sans 3', sans-serif; color: var(--text-primary); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-mid); }
::-webkit-scrollbar-thumb { background: var(--anr-blue); border-radius: 3px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.hdr {
  background: linear-gradient(165deg, var(--dark-blue) 0%, var(--anr-blue) 55%, var(--bg-mid) 100%);
  border-bottom: 3px solid var(--anr-gold);
  padding: 0 56px;
  position: relative;
  overflow: hidden;
}
.hdr::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -55deg, transparent, transparent 60px,
    rgba(253,189,16,0.04) 60px, rgba(253,189,16,0.04) 61px
  );
  pointer-events: none;
}
/* UC seal-style decorative circle top-right */
.hdr::before {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 2px solid rgba(253,189,16,0.12);
  pointer-events: none;
}
.hdr-inner {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  padding: 28px 0 22px;
  position: relative; z-index: 1;
  flex-wrap: wrap; gap: 20px;
}
.brand { cursor: pointer; user-select: none; }
.brand-title {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--anr-gold);
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-grape { font-style: italic; font-weight: 300; }
.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-body);
  margin-top: 6px;
  opacity: 0.85;
  font-weight: 400;
}
.brand-credit {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--sky-blue);
  margin-top: 5px;
  opacity: 0.9;
  font-weight: 400;
  font-style: italic;
}
.hdr-cta {
  background: var(--anr-gold);
  border: none;
  color: var(--dark-blue);
  padding: 11px 24px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  align-self: center;
  position: relative; z-index: 1;
  white-space: nowrap;
}
.hdr-cta:hover { background: var(--gold-lt); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(253,189,16,0.3); }

/* ── TOP NAV ──────────────────────────────────────────────────────────────── */
.top-nav {
  background: var(--dark-blue);
  border-bottom: 1px solid rgba(253,189,16,0.2);
  padding: 0 56px;
  display: flex; gap: 0;
  overflow-x: auto;
}
.tnav-btn {
  padding: 13px 18px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.tnav-btn:hover { color: var(--anr-gold); }
.tnav-btn.on { color: var(--anr-gold); border-bottom-color: var(--anr-gold); }

/* ── YEAR BAR ─────────────────────────────────────────────────────────────── */
.year-bar {
  background: var(--bg-mid);
  border-bottom: 1px solid rgba(58,168,228,0.25);
  padding: 9px 56px;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
}
.year-bar-inner {
  display: flex; align-items: center; gap: 16px;
  width: 100%; max-width: 1400px; margin: 0 auto;
}
#year-selector-wrap { display: flex; align-items: center; gap: 12px; }
.year-selector-label {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; white-space: nowrap;
}
.year-sel-wrap { position: relative; }
.year-select {
  background: rgba(0,60,97,0.7);
  border: 1.5px solid var(--anr-gold);
  color: var(--anr-gold);
  padding: 6px 32px 6px 14px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.06em;
  outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color 0.2s, background 0.2s; cursor: pointer;
}
.year-select:focus { background: rgba(0,95,174,0.4); }
.year-select option { background: var(--dark-blue); color: var(--text-primary); }
.year-sel-wrap .select-arrow { right: 10px; color: var(--anr-gold); }
.year-bar-note {
  font-size: 0.72rem; color: var(--text-faint);
  letter-spacing: 0.04em; margin-left: auto; font-style: italic;
}

/* ── MAIN ─────────────────────────────────────────────────────────────────── */
.main { flex: 1; padding: 44px 56px 72px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ── PAGE SECTIONS ── */
.page-section { display: none; }
.page-section.active { display: block; }

/* ── TITLES ── */
.pg-title {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--anr-gold);
  margin-bottom: 6px;
}
.pg-sub {
  font-size: 0.9rem; color: var(--text-muted);
  font-weight: 300; max-width: 660px;
  line-height: 1.75; margin-bottom: 36px;
}
.rule { width: 48px; height: 3px; background: var(--anr-blue); margin: 16px 0 36px; }
.year-badge { color: var(--sky-blue); font-style: normal; }

/* ── SPOTLIGHT CARDS ────────────────────────────────────────────────────── */
.spotlight-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 52px;
}
.spot-card {
  background: linear-gradient(145deg, var(--bg-card2) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(58,168,228,0.2);
  border-top: 3px solid var(--anr-blue);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.spot-card:hover {
  border-color: var(--anr-gold);
  border-top-color: var(--anr-gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
.spot-state { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky-blue); margin-bottom: 4px; font-weight: 600; }
.spot-name { font-family: 'Merriweather', serif; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; line-height: 1.25; }
.spot-cat-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.spot-cat-lbl { font-size: 0.7rem; color: var(--text-muted); }
.spot-cat-val { font-size: 0.92rem; color: var(--text-body); }
.spot-dp { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(58,168,228,0.15); font-size: 0.68rem; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── LOOKUP ─────────────────────────────────────────────────────────────── */
.lookup-section {
  background: var(--bg-card);
  border: 1px solid rgba(58,168,228,0.2);
  border-left: 4px solid var(--anr-blue);
  padding: 32px 36px; margin-bottom: 52px;
}
.lookup-title { font-family: 'Merriweather', serif; font-size: 1.3rem; color: var(--anr-gold); margin-bottom: 18px; font-weight: 700; }
.lookup-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.ctrl-group { flex: 1; min-width: 220px; }
.ctrl-label { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sky-blue); margin-bottom: 7px; font-weight: 600; }
.ctrl-select {
  width: 100%; background: rgba(0,36,61,0.8);
  border: 1px solid rgba(58,168,228,0.4);
  color: var(--text-primary); padding: 10px 34px 10px 14px;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
}
.ctrl-select:focus { border-color: var(--anr-gold); }
.ctrl-select option { background: var(--bg-card); color: var(--text-primary); }
.select-wrap { position: relative; }
.select-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--sky-blue); pointer-events: none; font-size: 0.75rem; }

.lookup-result { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.lup-stat { background: rgba(0,36,61,0.6); border: 1px solid rgba(58,168,228,0.15); padding: 18px; }
.lup-icon { font-size: 1.4rem; margin-bottom: 8px; }
.lup-lbl { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.lup-val { font-size: 1.6rem; font-weight: 300; color: var(--text-primary); letter-spacing: -0.02em; }
.lup-range { font-size: 0.75rem; color: var(--green-lt); margin-top: 4px; }
.lup-total {
  background: rgba(253,189,16,0.08); border: 1px solid rgba(253,189,16,0.3);
  padding: 18px; grid-column: 1/-1;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.lup-total-lbl { font-family: 'Merriweather', serif; font-size: 1rem; color: var(--anr-gold); font-style: italic; }
.lup-total-val { font-size: 1.9rem; color: var(--anr-gold); font-weight: 700; }
.no-data-msg { margin-top: 22px; padding: 18px; border: 1px dashed rgba(58,168,228,0.25); color: var(--text-muted); font-size: 0.88rem; text-align: center; }
.no-data-link { background: none; border: none; color: var(--anr-gold); cursor: pointer; text-decoration: underline; font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem; }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.tbl-controls { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.tbl-search {
  flex: 1; min-width: 200px;
  background: rgba(0,36,61,0.7); border: 1px solid rgba(58,168,228,0.25);
  color: var(--text-primary); padding: 9px 14px;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem;
  outline: none; transition: border-color 0.2s;
}
.tbl-search:focus { border-color: var(--anr-gold); }
.tbl-search::placeholder { color: var(--text-faint); }
.state-filter {
  background: rgba(0,36,61,0.7); border: 1px solid rgba(58,168,228,0.25);
  color: var(--text-primary); padding: 9px 30px 9px 14px;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem;
  outline: none; appearance: none; -webkit-appearance: none; transition: border-color 0.2s;
}
.state-filter:focus { border-color: var(--anr-gold); }
.state-filter option { background: var(--bg-card); }
.tbl-wrap { overflow-x: auto; }
.data-tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 700px; }
.data-tbl th {
  background: var(--dark-blue); color: var(--anr-gold);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; font-weight: 700;
  padding: 12px 16px; text-align: left;
  border-bottom: 2px solid var(--anr-blue);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.data-tbl th:hover { background: var(--bg-mid); color: var(--gold-lt); }
.data-tbl td { padding: 11px 16px; border-bottom: 1px solid rgba(58,168,228,0.08); color: var(--text-body); }
.data-tbl tr:hover td { background: rgba(0,95,174,0.15); }
.td-ava { font-family: 'Merriweather', serif; font-size: 0.95rem; color: var(--text-primary); }
.td-state { font-size: 0.75rem; color: var(--sky-blue); }
.td-total { color: var(--anr-gold); font-weight: 700; }
.td-dp { color: var(--text-faint); font-size: 0.75rem; text-align: center; }
.sort-arrow { margin-left: 4px; opacity: 0.6; }

/* ── CATEGORY PAGES ─────────────────────────────────────────────────────── */
.cat-header { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.cat-icon { font-size: 2.5rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 32px; }
.cat-card {
  background: var(--bg-card); border: 1px solid rgba(58,168,228,0.14);
  border-top: 3px solid var(--anr-blue); padding: 20px;
  transition: border-color 0.2s, border-top-color 0.2s;
}
.cat-card:hover { border-color: rgba(253,189,16,0.4); border-top-color: var(--anr-gold); }
.cc-state { font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--sky-blue); margin-bottom: 3px; font-weight: 600; }
.cc-ava { font-family: 'Merriweather', serif; font-size: 1rem; color: var(--text-primary); margin-bottom: 12px; }
.cc-main { font-size: 1.7rem; font-weight: 300; color: var(--anr-gold); letter-spacing: -0.02em; }
.cc-per { font-size: 0.7rem; color: var(--text-muted); margin-left: 4px; }
.cc-bar-wrap { margin-top: 12px; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; }
.cc-bar { height: 100%; background: var(--anr-blue); border-radius: 2px; transition: width 0.5s ease; }
.cc-range { font-size: 0.74rem; color: var(--text-muted); margin-top: 8px; }
.cc-dp { font-size: 0.67rem; color: var(--text-faint); margin-top: 6px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── SUBMIT FORM ────────────────────────────────────────────────────────── */
.form-card {
  background: var(--bg-card); border: 1px solid rgba(58,168,228,0.2);
  border-top: 4px solid var(--anr-blue); padding: 40px; max-width: 720px;
}
.form-sec-title {
  font-family: 'Merriweather', serif; font-size: 1.1rem; color: var(--anr-gold);
  margin: 28px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(58,168,228,0.15);
  display: flex; align-items: center; gap: 10px;
}
.form-row { margin-bottom: 20px; }
.form-lbl { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sky-blue); margin-bottom: 7px; font-weight: 600; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.pfx-wrap { position: relative; }
.pfx { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--anr-gold); font-weight: 700; pointer-events: none; }
.form-inp {
  width: 100%; background: rgba(0,36,61,0.8);
  border: 1px solid rgba(58,168,228,0.3);
  color: var(--text-primary); padding: 11px 14px 11px 26px;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s;
}
.form-inp:focus { border-color: var(--anr-gold); }
.form-sel {
  width: 100%; background: rgba(0,36,61,0.8);
  border: 1px solid rgba(58,168,228,0.3);
  color: var(--text-primary); padding: 11px 34px 11px 14px;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
}
.form-sel:focus { border-color: var(--anr-gold); }
.form-sel option { background: var(--bg-card); }
.sub-btn {
  background: var(--anr-blue); border: none;
  color: #ffffff; padding: 14px 38px;
  font-family: 'Source Sans 3', sans-serif; font-weight: 700;
  font-size: 0.88rem; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.sub-btn:hover:not(:disabled) { background: var(--sky-blue); }
.sub-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.success-box {
  background: rgba(103,137,62,0.15); border: 1px solid var(--oak-green);
  padding: 14px 20px; color: var(--bright-green);
  font-size: 0.9rem; margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px;
}
.hidden { display: none !important; }

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--dark-blue);
  border-top: 3px solid var(--anr-gold);
  text-align: center; padding: 18px;
  font-size: 0.72rem; color: var(--text-faint);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── ANIMATION ───────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp 0.4s ease both; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .hdr, .top-nav, .main, .year-bar { padding-left: 18px; padding-right: 18px; }
  .form-card { padding: 24px 18px; }
  .lookup-section { padding: 22px 18px; }
  .year-bar-note { display: none; }
}

/* ── SPACING / TERRAIN FILTER ROWS ────────────────────────────────────────── */
.filter-row-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin: 18px 0 8px;
}
.spacing-group { min-width: 160px; }
.tbl-spacing-controls { margin-bottom: 10px; }

.filter-badge-row { margin-bottom: 16px; }
.filter-tag {
  display: inline-block;
  background: rgba(0,95,174,0.18);
  border: 1px solid rgba(58,168,228,0.3);
  color: var(--sky-blue);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  text-transform: uppercase;
}

/* lookup result gets its own grid wrapper */
.lookup-result-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ── FORM CONFIG ROW (vine spacing / row spacing / terrain side-by-side) ── */
.form-config-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 24px;
}
.form-config-item { margin-bottom: 20px; }

.form-year-note-box {
  background: rgba(253,189,16,0.07);
  border: 1px solid rgba(253,189,16,0.2);
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── LOCATION MODE TOGGLE ────────────────────────────────────────────────── */
.loc-mode-toggle {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
}
.loc-mode-toggle-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fb8d8;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.loc-mode-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: inline-block;
  margin: 0;
  padding: 6px 20px;
  border-radius: 20px;
  border: 1.5px solid rgba(58,168,228,0.4);
  background-color: #004070;
  background-color: var(--bg-card2);
  color: #8fb8d8;
  color: var(--text-muted);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  -webkit-box-shadow: none;
          box-shadow: none;
  text-shadow: none;
  outline: none;
  -webkit-transition: background-color 0.15s, color 0.15s, border-color 0.15s;
          transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.loc-mode-btn:hover {
  background-color: #003256;
  background-color: var(--bg-mid);
  color: #d8eaf8;
  color: var(--text-body);
  border-color: rgba(58,168,228,0.7);
}
.loc-mode-btn.active {
  background-color: #005fae;
  background-color: var(--anr-blue);
  border-color: #005fae;
  border-color: var(--anr-blue);
  color: #ffffff;
}
