/* ============================================================
   gemeente-belastingen.be — Stijlblad
   ============================================================ */

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

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

:root {
  --blauw:      #003d8f;
  --blauw-dark: #002d6b;
  --blauw-light:#e8eef8;
  --geel:       #f1c400;
  --geel-light: #fffbea;
  --bg:         #f5f7fa;
  --text:       #1a1a2e;
  --muted:      #5a6072;
  --border:     #d0d9ea;
  --groen:      #1a7a3c;
  --groen-bg:   #e6f4ec;
  --oranje:     #c47200;
  --oranje-bg:  #fff3e0;
  --rood:       #c0392b;
  --rood-bg:    #fdecea;
  --white:      #ffffff;
  --shadow:     0 2px 16px rgba(0,61,143,0.10);
  --radius:     10px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── Belgische kleurenbalk ─────────────────────────────────── */
.belgische-balk {
  height: 5px;
  background: linear-gradient(to right, #1a1a1a 33.3%, var(--geel) 33.3%, var(--geel) 66.6%, #c0392b 66.6%);
}

/* ── Header ────────────────────────────────────────────────── */
header {
  background: var(--blauw);
  color: var(--white);
  padding: 0.9rem 1.5rem;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo-zone { display: flex; flex-direction: column; }
.site-naam {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em;
  color: var(--white);
}
.tagline { font-size: 0.8rem; opacity: 0.8; margin-top: 0.1rem; }
.header-badge {
  background: var(--geel); color: var(--text);
  font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.7rem;
  border-radius: 20px; white-space: nowrap; letter-spacing: 0.04em;
  text-transform: uppercase; flex-shrink: 0;
}

/* ── Nav ───────────────────────────────────────────────────── */
nav.main-nav {
  background: var(--blauw-dark);
  border-bottom: 2px solid var(--geel);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1rem;
  display: flex; gap: 0; flex-wrap: wrap;
}
.nav-inner a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  font-size: 0.88rem; font-weight: 600; padding: 0.65rem 1rem;
  display: block; white-space: nowrap; transition: background 0.2s, color 0.2s;
  border-bottom: 3px solid transparent;
}
.nav-inner a:hover { background: rgba(255,255,255,0.08); color: var(--white); border-bottom-color: var(--geel); }

/* ── Wrap ──────────────────────────────────────────────────── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Zoeksectie ────────────────────────────────────────────── */
.zoek-sectie {
  background: linear-gradient(135deg, var(--blauw) 0%, var(--blauw-dark) 100%);
  color: var(--white);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.zoek-sectie h1 {
  font-size: 2rem; font-weight: 700; margin-bottom: 0.6rem; line-height: 1.2;
}
.zoek-sectie p { font-size: 1.05rem; opacity: 0.9; margin-bottom: 1.75rem; }

.zoek-box {
  position: relative; max-width: 520px; margin: 0 auto; width: 100%;
}
#zoek-input {
  width: 100%; padding: 0.9rem 1.25rem 0.9rem 3rem;
  font-size: 1.05rem; font-family: inherit;
  border: 2px solid rgba(255,255,255,0.3); border-radius: var(--radius);
  background: rgba(255,255,255,0.95); color: var(--text);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
#zoek-input:focus { border-color: var(--geel); box-shadow: 0 0 0 3px rgba(241,196,0,0.3); }
.zoek-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.1rem; pointer-events: none; opacity: 0.5;
}

#suggesties {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 50; overflow: hidden; display: none;
  max-width: 100%; box-sizing: border-box;
}
#suggesties.open { display: block; }
.suggestie-item {
  padding: 0.65rem 1.25rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 0.95rem; border-bottom: 1px solid var(--border); color: var(--text);
  transition: background 0.15s;
}
.suggestie-item:last-child { border-bottom: none; }
.suggestie-item:hover, .suggestie-item.actief { background: var(--blauw-light); }
.suggestie-pct { font-weight: 700; font-size: 0.88rem; }

#resultaat {
  max-width: 520px; margin: 1.25rem auto 0;
  display: none; width: 100%;
}
.resultaat-kaart {
  background: var(--white); border-radius: var(--radius);
  padding: 1.5rem 2rem; text-align: left;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.res-naam { font-size: 1.3rem; font-weight: 700; color: var(--blauw); }
.res-gewest { font-size: 0.85rem; color: var(--muted); margin-top: 0.1rem; }
.res-pct-badge {
  font-size: 2.2rem; font-weight: 700; padding: 0.5rem 1.2rem;
  border-radius: var(--radius); flex-shrink: 0; min-width: 100px; text-align: center;
}
.res-pct-badge.groen  { background: var(--groen-bg);  color: var(--groen); }
.res-pct-badge.oranje { background: var(--oranje-bg); color: var(--oranje); }
.res-pct-badge.rood   { background: var(--rood-bg);   color: var(--rood); }
.res-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.65; margin-bottom: 0.15rem; }
.res-uitleg { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

/* ── Secties ───────────────────────────────────────────────── */
section { padding: 3rem 0; }
.section-title {
  font-size: 1.5rem; font-weight: 700; color: var(--blauw);
  margin-bottom: 1.5rem; padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--geel);
  display: inline-block;
}

/* ── Info cards ────────────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.info-card {
  background: var(--white); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
  border-top: 4px solid var(--blauw);
}
.info-card h3 { font-size: 1rem; font-weight: 700; color: var(--blauw); margin-bottom: 0.6rem; }
.info-card p  { font-size: 0.92rem; color: var(--muted); line-height: 1.65; }

/* ── Statistieken balk ─────────────────────────────────────── */
.stats-bar {
  background: var(--blauw); color: var(--white);
  padding: 1.25rem 1.5rem;
}
.stats-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  text-align: center;
}
.stat-item { text-align: center; }
.stat-val { font-size: 1.75rem; font-weight: 700; color: var(--geel); }
.stat-label { font-size: 0.8rem; opacity: 0.8; margin-top: 0.1rem; }

/* ── Tabel ─────────────────────────────────────────────────── */
.tabel-wrap {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: visible;
}
.tabel-toolbar {
  padding: 1rem 1.25rem; background: var(--blauw-light);
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--border);
}
.filter-input {
  flex: 1; min-width: 200px; padding: 0.55rem 0.9rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.filter-input:focus { border-color: var(--blauw); }
.filter-select {
  padding: 0.55rem 0.9rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; background: var(--white); outline: none;
  cursor: pointer;
}
.tabel-count { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.overzicht-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.overzicht-table thead { position: sticky; top: 0; z-index: 2; }
.overzicht-table th {
  background: var(--blauw); color: var(--white);
  padding: 0.75rem 1rem; text-align: left; font-weight: 600;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.overzicht-table th:hover { background: var(--blauw-dark); }
.overzicht-table th .sort-icon { opacity: 0.5; margin-left: 0.3rem; font-size: 0.8rem; }
.overzicht-table th.sort-asc .sort-icon::after  { content: ' ↑'; opacity: 1; }
.overzicht-table th.sort-desc .sort-icon::after { content: ' ↓'; opacity: 1; }
.overzicht-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.overzicht-table tr:last-child td { border-bottom: none; }
.overzicht-table tr:nth-child(even) td { background: #f8fafd; }
.overzicht-table tr:hover td { background: var(--blauw-light); }

.badge {
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700;
}
.badge.groen  { background: var(--groen-bg);  color: var(--groen); }
.badge.oranje { background: var(--oranje-bg); color: var(--oranje); }
.badge.rood   { background: var(--rood-bg);   color: var(--rood); }
.badge.nul    { background: #e8f4ff; color: var(--blauw); }

.gewest-tag {
  font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px;
  font-weight: 600;
}
.gewest-tag.vl { background: #fff3cc; color: #856404; }
.gewest-tag.wa { background: #ffe0e0; color: #8b1a1a; }
.gewest-tag.br { background: #e0ecff; color: #003d8f; }

.tabel-max-h { max-height: 520px; overflow-y: auto; scrollbar-width: thin; }

/* ── Legende ───────────────────────────────────────────────── */
.legende {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.88rem;
}
.legende-item { display: flex; align-items: center; gap: 0.4rem; }
.legende-dot { width: 12px; height: 12px; border-radius: 50%; }
.legende-dot.groen  { background: var(--groen); }
.legende-dot.oranje { background: var(--oranje); }
.legende-dot.rood   { background: var(--rood); }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: #1a1a2e; color: rgba(255,255,255,0.75);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem;
}
.footer-col strong { color: var(--white); font-size: 0.95rem; display: block; margin-bottom: 0.75rem; }
.footer-col p, .footer-col li { font-size: 0.85rem; line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col a { color: rgba(255,255,255,0.65); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--geel); }
.footer-bottom {
  max-width: 1100px; margin: 0 auto; padding: 1.25rem 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem; color: rgba(255,255,255,0.4); line-height: 1.6;
}

/* ── Cookie banner ─────────────────────────────────────────── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--blauw-dark); color: rgba(255,255,255,0.9);
  padding: 1rem 1.5rem; z-index: 999;
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}
#cookie-banner.hidden { display: none !important; }
.cookie-txt { flex: 1; min-width: 200px; font-size: 0.88rem; }
.cookie-txt a { color: var(--geel); }
.btn-cookie {
  background: var(--geel); color: var(--text);
  border: none; padding: 0.5rem 1.2rem; border-radius: 6px;
  font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* ── Anchor sections (privacy/disclaimer) ──────────────────── */
.juridisch-sectie {
  background: var(--white); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
  scroll-margin-top: 80px;
}
.juridisch-sectie h2 { font-size: 1.2rem; font-weight: 700; color: var(--blauw); margin-bottom: 1rem; }
.juridisch-sectie p, .juridisch-sectie li { font-size: 0.92rem; color: var(--muted); line-height: 1.75; margin-bottom: 0.6rem; }
.juridisch-sectie ul { padding-left: 1.3rem; }
.juridisch-sectie a { color: var(--blauw); }

/* ── Tabel horizontaal scroll op mobiel ──────────────────── */
.tabel-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.overzicht-table { min-width: 520px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .info-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .zoek-sectie { padding: 2rem 1rem 1.75rem; }
  .zoek-sectie h1 { font-size: 1.4rem; }
  .zoek-sectie p { font-size: 0.95rem; margin-bottom: 1.25rem; }
  #zoek-input { font-size: 1rem; padding: 0.8rem 1rem 0.8rem 2.75rem; }
  .stat-val { font-size: 1.2rem; }
  .stat-label { font-size: 0.72rem; }
  .stats-inner { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .section-title { font-size: 1.2rem; }
}
@media (max-width: 420px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-val { font-size: 1.1rem; }
}

/* ── Gemeentepagina mobile fixes ─────────────────────────── */
@media (max-width: 600px) {
  main section > .wrap > div[style*='display:flex'] {
    flex-direction: column !important;
  }
  main section > .wrap > div[style*='display:flex'] > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  /* Berekeningentabel op gemeentepagina */
  main table[style*='table-layout'] {
    font-size: 0.82rem;
  }
  main table[style*='table-layout'] th,
  main table[style*='table-layout'] td {
    padding: 0.4rem 0.5rem;
  }
  /* Grote percentage badge */
  div[style*='3.5rem'] {
    font-size: 2.5rem !important;
  }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .resultaat-kaart { flex-direction: column; gap: 0.75rem; }
  .tabel-toolbar { flex-direction: column; align-items: stretch; }
  .filter-input, .filter-select { width: 100%; }
  .header-badge { display: none; }
  .nav-inner a { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
  .juridisch-sectie { padding: 1.25rem; }
  .info-card { padding: 1.1rem; }
  .res-pct-badge { font-size: 1.75rem; min-width: 80px; }
  .overzicht-table thead { position: static; }
}
