/* styl.css — Strooier-Redigeerder (donkergroen Aardvark-styl, mobiel-eerste) */

:root {
  --groen-donker: #1b5e20;
  --groen: #2e7d32;
  --groen-lig: #e8f5e9;
  --agtergrond: #f5f5f2;
  --teks: #212121;
  --stil: #616161;
  --rand: #d7d7d2;
  --fout: #b71c1c;
  --wit: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--agtergrond);
  color: var(--teks);
}

.versteek { display: none !important; }
.stil { color: var(--stil); font-size: 0.9rem; }
.fout { color: var(--fout); font-weight: 600; }

button {
  font: inherit;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--wit);
  color: var(--teks);
  cursor: pointer;
  min-height: 44px; /* raakteiken */
}
button:disabled { opacity: 0.45; cursor: default; }
button.primer {
  background: var(--groen-donker);
  border-color: var(--groen-donker);
  color: var(--wit);
  font-weight: 600;
}
button.primer:not(:disabled):hover { background: var(--groen); }

input[type="number"], input[type="text"], select {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rand);
  border-radius: 8px;
  min-height: 44px;
  background: var(--wit);
  max-width: 100%;
}

/* ── Kopbalk ─────────────────────────────────────────── */
#kopbalk {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: var(--groen-donker);
  color: var(--wit);
  position: sticky;
  top: 0;
  z-index: 1200;
}
#kop-titel { display: flex; align-items: center; gap: 0.5rem; }
#kop-titel h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }
#kop-totale { flex: 1 1 auto; text-align: center; font-size: 0.95rem; }
#totaal-band strong { font-size: 1.05rem; }
#kop-knoppies, #kop-regs { display: flex; gap: 0.4rem; }
#kop-knoppies button, #kop-regs button {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  color: var(--wit);
}
#kop-knoppies button.primer {
  background: var(--wit);
  color: var(--groen-donker);
  border-color: var(--wit);
}
#kn-taal { font-weight: 700; min-width: 52px; }
#kn-installeer { font-weight: 600; }

#ios-wenk {
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: #fff8e1;
  border-bottom: 1px solid var(--rand);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#ios-wenk .kn-klein { margin-left: auto; min-height: 34px; padding: 0.2rem 0.5rem; }

/* ── Tuisskerm ───────────────────────────────────────── */
#tuisskerm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 1.5rem;
}
#lossone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 3px dashed var(--groen);
  border-radius: 20px;
  background: var(--groen-lig);
  color: var(--groen-donker);
  padding: 3rem 2.5rem;
  text-align: center;
  cursor: pointer;
  max-width: 480px;
  width: 100%;
}
#lossone.oor { background: #c8e6c9; border-style: solid; }
#lossone p { margin: 0.2rem 0; }

/* ── Werkskerm-uitleg ────────────────────────────────── */
#werkskerm {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  grid-template-rows: 1fr;
  grid-template-areas: "sybalk kaart paneel";
  height: calc(100vh - 56px);
}
#sybalk { grid-area: sybalk; overflow-y: auto; border-right: 1px solid var(--rand); background: var(--wit); }
#kaart-omvou { grid-area: kaart; position: relative; }
#kaart { position: absolute; inset: 0; }
#paneel { grid-area: paneel; overflow-y: auto; border-left: 1px solid var(--rand); background: var(--wit); padding: 0.75rem; }

@media (max-width: 900px) {
  #werkskerm {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 45vh) auto;
    grid-template-areas: "sybalk" "kaart" "paneel";
    height: auto;
  }
  #sybalk { max-height: 30vh; border-right: none; border-bottom: 1px solid var(--rand); }
  #kaart-omvou { min-height: 300px; }
}

/* ── Stel-lys ────────────────────────────────────────── */
.produk-groep { border-bottom: 1px solid var(--rand); }
.produk-kop {
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  background: var(--groen-lig);
  color: var(--groen-donker);
}
.stel-item {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--rand);
  padding: 0.55rem 0.75rem;
  background: var(--wit);
}
.stel-item.aktief { background: #dcedc8; }
.stel-item .stel-naam { font-weight: 600; display: block; }
.stel-item .stel-opsom { font-size: 0.8rem; color: var(--stil); display: block; }

/* ── Kaart-oorleg ────────────────────────────────────── */
#legende {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  max-height: 40%;
  overflow-y: auto;
}
#legende .legende-ry { display: flex; align-items: center; gap: 0.4rem; }
#legende .legende-blok { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.25); }
#hand-lesing {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(27,94,32,0.92);
  color: var(--wit);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Handvatsels (soos Veldkaart): blou ✥ = skuif, rooi ⟳ = draai-arm */
.handvatsel {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  touch-action: none;
  cursor: grab;
}
.hv-skuif { background: #1565c0; }
.hv-draai { background: #e53935; }

/* Merkpunt-spelde */
.merkpunt-ikoon {
  background: #1565c0;
  color: var(--wit);
  border: 2px solid var(--wit);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.kaartpunt-ikoon {
  background: #e65100;
  color: var(--wit);
  border: 2px solid var(--wit);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Paneel ──────────────────────────────────────────── */
#oortjies { display: flex; gap: 0.3rem; margin-bottom: 0.6rem; }
#oortjies button { flex: 1; border-radius: 8px 8px 0 0; border-bottom: 3px solid transparent; }
#oortjies button.aktief {
  border-bottom-color: var(--groen-donker);
  color: var(--groen-donker);
  font-weight: 700;
  background: var(--groen-lig);
}

#omvang-keuse {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  align-items: center;
  background: var(--agtergrond);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}
#omvang-keuse .etiket { font-weight: 600; }
#omvang-keuse label { display: inline-flex; align-items: center; gap: 0.25rem; }

.oortjie-inhoud .ry { margin: 0.6rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.inset-groep { display: flex; gap: 0.4rem; align-items: center; }
.inset-groep input { flex: 1; min-width: 0; }
.eenheid { font-weight: 600; }

.vinnige-knoppies { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.vinnige-knoppies button { flex: 1 1 28%; }

.voorskou {
  background: var(--groen-lig);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
  min-height: 2.4rem;
}

#skuif-metodes { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.55rem; }
#skuif-metodes button { flex: 1 1 45%; font-size: 0.85rem; padding: 0.4rem 0.3rem; }
#skuif-metodes button.aktief {
  background: var(--groen-lig);
  border-color: var(--groen-donker);
  color: var(--groen-donker);
  font-weight: 700;
}

.skuifbalk-ry { display: block; margin: 0.5rem 0; font-size: 0.9rem; }
.skuifbalk-ry input[type="range"] { width: 100%; }

#paar-lys .paar-ry, #koord-lys .koord-ry {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--rand);
  font-size: 0.88rem;
}
.paar-status { margin-left: auto; }
.paar-ry.aktief-paar { background: #fff8e1; }
.koord-ry input[type="text"] { flex: 1; min-width: 0; min-height: 38px; }
.koord-ry .kn-klein { min-height: 38px; padding: 0.3rem 0.55rem; }

#skuif-uitslag {
  background: var(--agtergrond);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin: 0.6rem 0;
  font-size: 0.9rem;
}
#skuif-waarskuwings { margin: 0.3rem 0 0; padding-left: 1.1rem; color: #b26a00; }

#oortjie-skuif .ry { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
#oortjie-skuif .ry button { flex: 1 1 45%; }

/* ── Boodskappe ──────────────────────────────────────── */
#boodskap {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: var(--wit);
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  z-index: 3000;
  max-width: min(92vw, 560px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
#boodskap.fout-boodskap { background: var(--fout); }
