/* ═══════════════════════════════════════════════════════════════
   SV Diana – Competitiewebsite  ·  style.css
   Gedeelde stijlen voor alle pagina's.
   Geïnspireerd op diana-etten.nl: donkerblauw, goud accent,
   rustige typografie, professionele uitstraling.
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts worden geladen vanuit HTML ──────────────────── */

/* ══════════════════════════════════════════
   CSS-VARIABELEN
══════════════════════════════════════════ */
:root {
  /* Kleuren */
  --navy:       #1b2641;
  --navy-mid:   #243058;
  --navy-light: #2e3e6e;
  --gold:       #c9a84c;
  --gold-light: #e8ca6e;
  --gold-pale:  rgba(201,168,76,.1);
  --cream:      #f5f2ec;
  --cream-dark: #ece8e0;
  --white:      #ffffff;
  --border:     #ddd7cc;
  --text:       #1b2641;
  --text-soft:  #3d4a6a;
  --muted:      #7a8097;
  --green:      #2e7d5e;
  --red:        #b93b3b;

  /* Schaduwen */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 18px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.13);

  /* Vormen */
  --radius:     7px;
  --radius-lg:  12px;

  /* Typografie */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Layout */
  --header-h:   64px;
  --filter-h:   60px;         /* hoogte sticky filterbar */
  --max-w:      1280px;
}

/* ══════════════════════════════════════════
   RESET
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 300;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;   /* cirkel bijsnijden als logo vierkant is */
  flex-shrink: 0;
}
/* Kleur-logo: geen filter nodig */
.brand-logo--color {
  filter: none;
  opacity: 1;
}
.brand-text  { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name  {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-sub {
  font-size: .63rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Navigatie */
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .15rem;
}
.nav-link {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border-radius: 5px;
  transition: color .18s, background .18s;
  letter-spacing: .03em;
  white-space: nowrap;
}
.nav-link:hover   { color: var(--gold-light); background: rgba(255,255,255,.07); }
.nav-link--active { color: var(--gold); background: rgba(201,168,76,.13); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  background: var(--navy-mid);
  padding: 3rem 1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}
/* Subtiele radiale gloed rechtsboven */
.hero::after {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.hero-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 1;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.hero-copy { flex: 1; }
.hero-label {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .4rem;
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--white);
  line-height: 1.1;
}
.hero-title em { color: var(--gold); font-style: italic; }

/* ══════════════════════════════════════════
   CONTAINER
══════════════════════════════════════════ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ══════════════════════════════════════════
   FILTERBAR  (sticky onder header)
══════════════════════════════════════════ */
.filters-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: .85rem 0;
  position: sticky;
  top: var(--header-h);
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  /* Hoogte is dynamisch (groter op desktop, compact op mobiel ingeklapt) */
}
.filters-bar .container {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

/* Zoekrij bovenaan filterbar */
.search-row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: .9rem;
  line-height: 1;
}
.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .48rem .75rem .48rem 2.25rem;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--text);
  background: var(--cream);
  transition: border-color .18s, box-shadow .18s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}
.search-clear {
  display: none;   /* zichtbaar via JS als er tekst is */
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: .2rem .4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s;
}
.search-clear:hover { color: var(--red); }
.search-clear.visible { display: inline-flex; align-items: center; }

/* Rij met dropdowns */
.filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1 1 130px;
  min-width: 110px;
}
.filter-field label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Select */
select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a8097'/%3E%3C/svg%3E") no-repeat right .7rem center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .46rem 2rem .46rem .7rem;
  font-family: var(--font-body);
  font-size: .84rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}

/* Reset-knop */
.filter-actions { justify-content: flex-end; flex: 0 0 auto; }
.btn-reset {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .46rem 1.1rem;
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  white-space: nowrap;
  align-self: flex-end;
}
.btn-reset:hover {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--gold-pale);
}

/* ══════════════════════════════════════════
   ZOEKSUGGESTIES DROPDOWN
══════════════════════════════════════════ */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 320px;
  overflow-y: auto;
  display: none;  /* zichtbaar via JS */
}
.search-suggestions.open { display: block; }

.suggestion-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item:focus { background: var(--cream); outline: none; }

.suggestion-naam {
  font-weight: 600;
  font-size: .88rem;
  flex: 1;
}
.suggestion-naam mark {
  background: rgba(201,168,76,.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.suggestion-meta {
  font-size: .73rem;
  color: var(--muted);
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.suggestion-empty {
  padding: 1rem .85rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

/* ══════════════════════════════════════════
   SCHUTTERKAART (inline preview na zoeken)
══════════════════════════════════════════ */
.schutter-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: none;  /* zichtbaar via JS */
}
.schutter-preview.open { display: block; }
.preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.preview-naam {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}
.preview-link {
  font-size: .78rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  transition: opacity .15s;
}
.preview-link:hover { opacity: .75; }
.preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .8rem;
}
.preview-stat {
  font-size: .78rem;
  color: var(--muted);
}
.preview-stat strong {
  font-weight: 600;
  color: var(--navy-mid);
}

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.main-content { padding: 1.75rem 0 4rem; }

/* Status-balk */
.results-status {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .85rem;
  min-height: 1.2em;
}

/* Sectietitels */
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

/* Filter-context omschrijving */
.filter-context {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding: .55rem .9rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
}

/* ══════════════════════════════════════════
   TABEL
══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

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

/* Thead */
thead { background: var(--navy); }
thead th {
  padding: .7rem .8rem;
  text-align: left;
  color: var(--white);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.07);
}
thead th:last-child { border-right: none; }

/* Kolom-breedtes */
.col-rank   { width: 36px; text-align: center; }
.col-naam   { min-width: 140px; }
.col-disc   { width: 58px; }
.col-klasse { width: 46px; text-align: center; }
.col-ronde  { width: 58px; text-align: center; }
.col-score  { width: 40px; text-align: right; }
.col-totaal { width: 58px; text-align: right; }
.col-gem    { width: 58px; text-align: right; }

/* Tbody */
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(201,168,76,.04); }

/* Groep-header rij */
tbody tr.group-row td {
  background: var(--cream);
  padding: .42rem .8rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy-mid);
  border-top: 2px solid var(--border);
}

tbody td {
  padding: .58rem .8rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* Rang */
.rank-cell {
  text-align: center;
  font-weight: 700;
  font-size: .78rem;
  color: var(--muted);
}
.rank-1 { color: #b8860b; }
.rank-2 { color: #888; }
.rank-3 { color: #a0522d; }

/* Naam */
.naam-cell { font-weight: 500; }
.naam-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(201,168,76,.5);
  transition: color .15s, border-color .15s;
}
.naam-link:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* Badges & pills */
.pill {
  display: inline-block;
  padding: .14rem .5rem;
  border-radius: 20px;
  font-size: .69rem;
  font-weight: 600;
  background: rgba(27,38,65,.08);
  color: var(--navy-mid);
  letter-spacing: .04em;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: .73rem;
  font-weight: 700;
  background: var(--navy);
  color: var(--gold);
}
.badge-E { background: #4a2d82; color: #cbb8f0; }

/* Score-cellen */
.score-cell { text-align: right; color: var(--muted); }
.score-null { color: #ccc; font-style: italic; }
.totaal-cell { text-align: right; font-weight: 700; }
.gem-cell    { text-align: right; }
.gem-high    { color: var(--green); font-weight: 700; }
.gem-low     { color: var(--red); }

/* ══════════════════════════════════════════
   LAAD / LEEG-STAAT
══════════════════════════════════════════ */
.no-results, .loading-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: .95rem;
}
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.38);
  font-size: .78rem;
  text-align: center;
  padding: 1.25rem 1rem;
}
.site-footer code {
  font-size: .74rem;
  background: rgba(255,255,255,.08);
  padding: .1rem .3rem;
  border-radius: 3px;
}
.footer-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  opacity: .55;
  margin: 0 auto .65rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE  –  TABLET  (≤ 860px)
══════════════════════════════════════════ */
@media (max-width: 860px) {
  :root { --header-h: 58px; }

  .hero { padding: 2rem 1rem 1.75rem; }
  .hero-inner { gap: 1.25rem; }
  .hero-logo  { width: 54px; height: 54px; }

  .filters-bar { padding: .75rem 0; }
  .filters-grid { gap: .55rem; }
  .filter-field { flex: 1 1 calc(50% - .55rem); }
  .filter-actions { flex: 0 0 100%; }
  .btn-reset { width: 100%; }

  .search-wrap { max-width: 100%; }
}

/* ══════════════════════════════════════════
   RESPONSIVE  –  MOBIEL  (≤ 560px)
══════════════════════════════════════════ */
@media (max-width: 560px) {
  :root { --header-h: 54px; }

  .brand-sub { display: none; }
  .hero-logo { width: 42px; height: 42px; }

  .filters-bar .container { gap: .5rem; }
  .filter-field { flex: 1 1 100%; }

  .search-row { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: 100%; }

  thead th { font-size: .64rem; padding: .5rem .5rem; }
  tbody td  { padding: .48rem .5rem; font-size: .8rem; }

  /* Verberg minder-essentiële kolommen op mobiel */
  .col-score { display: none; }
}

/* ══════════════════════════════════════════
   FILTER TOGGLE  –  inklapbaar filterpaneel
   Zichtbaar op mobiel (≤ 768px).
   Op desktop altijd verborgen via display:none.
══════════════════════════════════════════ */

/* De toggle-knop zelf — verborgen op desktop */
.filters-toggle {
  display: none;  /* wordt zichtbaar via media query hieronder */
}

/* Inklapbare wrapper — op desktop altijd open */
.filters-collapsible {
  /* Geen speciale stijl nodig op desktop: normaal flow */
}

/* ── Mobiel: toggle zichtbaar, paneel standaard dicht ── */
@media (max-width: 768px) {

  /* Toggle-knop */
  .filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .6rem .9rem;
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    color: var(--navy-mid);
    cursor: pointer;
    letter-spacing: .02em;
    transition: background .15s, border-color .15s;
    /* Kleine goud-accentlijn links, passend bij de huidige stijl */
    border-left: 3px solid var(--gold);
  }
  .filters-toggle:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
  }

  /* Pijltje rechts in de knop */
  .filters-toggle-icon {
    font-size: .8rem;
    color: var(--gold);
    transition: transform .22s ease;
    /* Pijltje staat standaard omlaag (▾ wijst naar beneden = dicht) */
    display: inline-block;
    transform: rotate(0deg);
  }

  /* Als het paneel open is, draait het pijltje omhoog */
  .filters-toggle--open .filters-toggle-icon {
    transform: rotate(180deg);
  }

  /* Inklapbare inhoud: standaard verborgen */
  .filters-collapsible {
    display: none;
    padding-top: .65rem;
  }

  /* Zichtbaar als JS de klasse toevoegt */
  .filters-collapsible.filters-open {
    display: block;
  }

}

/* ══════════════════════════════════════════
   TABEL SCROLL – mobiel
   De .table-wrap had al overflow-x:auto;
   onderstaande regels verbeteren de ervaring.
══════════════════════════════════════════ */
.table-wrap {
  /* Scrollbar altijd zichtbaar op systemen die deze verbergen */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Subtiele schaduw-hint dat er rechts meer inhoud is */
  background:
    /* Fade-schaduw rechts */
    linear-gradient(to left,  rgba(0,0,0,.06) 0%, transparent 40px) right center / 40px 100% no-repeat,
    /* Fade-schaduw links */
    linear-gradient(to right, rgba(0,0,0,.06) 0%, transparent 40px) left  center / 40px 100% no-repeat,
    var(--white);
  background-attachment: local, local, scroll;
}

/* ══════════════════════════════════════════
   HAMBURGER MENU (mobiel nav)
══════════════════════════════════════════ */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
  margin-left: auto;
  color: rgba(255,255,255,.7);
  font-size: 1.3rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .nav-toggle { display: flex; align-items: center; }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--navy-mid);
    flex-direction: column;
    align-items: stretch;
    padding: .5rem 0;
    border-bottom: 2px solid var(--gold-pale);
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    z-index: 250;
  }
  .header-nav.open { display: flex; }

  .nav-link {
    padding: .65rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .9rem;
  }
}
