/* =============================================
   ANKIE OP KAMP — Regie CSS
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  font-family: 'Nunito', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
}

/* ── PIN scherm ─────────────────────────────── */
#pin-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  z-index: 9999;
}
.pin-inner { text-align: center; padding: 2rem; max-width: 360px; width: 100%; }
.pin-logo { font-size: 4rem; margin-bottom: 0.8rem; }
.pin-inner h1 { font-size: 2rem; font-weight: 900; color: #fbbf24; margin-bottom: 0.3rem; }
.pin-inner > p { color: #94a3b8; margin-bottom: 1.5rem; }

.pin-display {
  display: flex; justify-content: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.pin-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid #475569;
  background: transparent;
  transition: background 0.2s;
}
.pin-dot.filled { background: #fbbf24; border-color: #fbbf24; }

.pin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem; margin-bottom: 1rem;
}
.pin-btn {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 12px;
  color: #e2e8f0;
  font-family: 'Nunito', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.pin-btn:active { background: #334155; transform: scale(0.95); }
.pin-clear { color: #ef4444; }
.pin-ok { background: #166534; border-color: #16a34a; color: #86efac; }
.pin-ok:active { background: #14532d; }
.pin-error { color: #ef4444; font-weight: 700; margin-top: 0.5rem; }
.pin-hint { color: #475569; font-size: 0.8rem; margin-top: 0.5rem; }

/* ── Regie layout ───────────────────────────── */
#regie-app {
  position: fixed; inset: 0;
  display: flex;
}

/* Sidebar */
#sidebar {
  width: 200px;
  min-width: 200px;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  border-right: 1px solid #334155;
  z-index: 10;
}

.sidebar-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-bottom: 1px solid #334155;
  margin-bottom: 0.5rem;
}
.sidebar-logo { font-size: 1.4rem; }
.sidebar-title { font-weight: 900; font-size: 1rem; color: #fbbf24; }

.nav-tab {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: none; border: none;
  color: #94a3b8;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-tab:hover { color: #e2e8f0; background: #334155; }
.nav-tab.active { color: #fbbf24; background: #334155; border-left-color: #fbbf24; }
.nav-tab span { font-size: 1.1rem; }

.sidebar-status {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid #334155;
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: #94a3b8;
}

/* Content area */
#content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Tab panels */
.tab-panel {
  position: absolute; inset: 0;
  overflow-y: auto;
}
.tab-panel.hidden { display: none; }

/* ── Kaart tab ───────────────────────────────── */
#tab-kaart { overflow: hidden; }
#regie-map { position: absolute; inset: 0; }

.map-controls-overlay {
  position: absolute;
  top: 1rem; left: 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  z-index: 10;
}
.map-ctrl-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.map-ctrl-btn {
  padding: 0.6rem 1rem;
  border: none; border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.15s, opacity 0.15s;
}
.map-ctrl-btn:active { transform: scale(0.96); }
.btn-blauw { background: #3b82f6; color: #fff; }
.btn-grijs { background: #475569; color: #e2e8f0; }
.btn-groen { background: #16a34a; color: #fff; }
.btn-oranje { background: #f97316; color: #fff; }
.btn-rood { background: #ef4444; color: #fff; }

.status-badge {
  background: rgba(15,23,42,0.85);
  color: #e2e8f0;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.speler-info-card {
  position: absolute;
  bottom: 3rem; left: 1rem;
  background: rgba(15,23,42,0.9);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  font-size: 0.85rem;
  z-index: 10;
  min-width: 200px;
  backdrop-filter: blur(6px);
}
.speler-info-card strong { color: #fbbf24; display: block; margin-bottom: 0.3rem; }
.speler-info-card div { color: #94a3b8; margin-bottom: 0.1rem; }

.quick-opdracht {
  position: absolute;
  bottom: 1rem; left: 1rem; right: 4rem;
  display: flex; gap: 0.5rem;
  z-index: 10;
}
.quick-opdracht select {
  flex: 1;
  background: rgba(15,23,42,0.9);
  border: 1px solid #334155;
  border-radius: 10px;
  color: #e2e8f0;
  padding: 0.5rem 0.75rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  backdrop-filter: blur(6px);
}

/* ── Panel content ───────────────────────────── */
.tab-panel:not(#tab-kaart) {
  padding: 1.5rem;
  background: #0f172a;
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.panel-header h2 {
  font-size: 1.4rem; font-weight: 900; color: #f1f5f9;
}

/* Cards */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card h3 { font-size: 1.05rem; color: #fbbf24; margin-bottom: 1.1rem; }

/* Forms */
.form-row {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-bottom: 1rem;
}
.form-row label { font-size: 0.85rem; font-weight: 700; color: #94a3b8; }
.form-row input, .form-row textarea, .form-row select {
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: #3b82f6;
}
.form-row textarea { resize: vertical; min-height: 90px; }

.coords-row { display: flex; gap: 0.5rem; }
.coords-row input { flex: 1; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* Buttons */
.btn-primary {
  background: #3b82f6; color: #fff;
  border: none; border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800; font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-groot { font-size: 1.05rem; padding: 0.8rem 2rem; }
.btn-secondary {
  background: #334155; color: #e2e8f0;
  border: none; border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.9rem;
  padding: 0.6rem 1.1rem; cursor: pointer;
}
.btn-ghost {
  background: transparent; color: #64748b;
  border: 1.5px solid #334155; border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.9rem;
  padding: 0.6rem 1.1rem; cursor: pointer;
}
.btn-sm {
  border: none; border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.8rem;
  padding: 0.4rem 0.8rem; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-sm.btn-groen { background: #166534; color: #86efac; }
.btn-sm.btn-blauw { background: #1e3a5f; color: #93c5fd; }
.btn-sm.btn-oranje { background: #7c2d12; color: #fdba74; }
.btn-sm.btn-rood { background: #7f1d1d; color: #fca5a5; }
.btn-icon {
  background: none; border: none;
  color: #ef4444; cursor: pointer;
  font-size: 0.9rem; padding: 0 0.3rem;
}

/* Item cards */
.items-list { display: flex; flex-direction: column; gap: 0.75rem; }
.item-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.item-card.item-actief { border-color: #16a34a; }
.item-info { flex: 1; min-width: 0; }
.item-info strong { display: block; color: #f1f5f9; margin-bottom: 0.2rem; }
.item-info small { color: #64748b; font-size: 0.82rem; }
.item-actions { display: flex; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; }

/* Badges */
.badge-green { background: #166534; color: #86efac; padding: 0.15rem 0.55rem; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }
.badge-blue  { background: #1e3a5f; color: #93c5fd; padding: 0.15rem 0.55rem; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }
.badge-grey  { background: #334155; color: #94a3b8;  padding: 0.15rem 0.55rem; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }

/* Waypoints */
.waypoints-section { margin-bottom: 1rem; }
.waypoints-section > label { font-size: 0.85rem; font-weight: 700; color: #94a3b8; display: block; margin-bottom: 0.5rem; }
.search-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.search-row input { flex: 1; }
.zoek-results {
  background: #0f172a; border: 1px solid #334155; border-radius: 8px;
  max-height: 200px; overflow-y: auto; margin-bottom: 0.5rem;
}
.zoek-item {
  padding: 0.6rem 0.9rem; cursor: pointer;
  border-bottom: 1px solid #334155;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.zoek-item:hover { background: #1e293b; }
.zoek-item strong { color: #e2e8f0; }

.waypoints-list { margin-bottom: 0.5rem; }
.wp-item {
  display: flex; align-items: center; gap: 0.6rem;
  background: #0f172a; border: 1px solid #334155;
  border-radius: 8px; padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem; cursor: grab;
}
.wp-drag { color: #475569; font-size: 1.1rem; cursor: grab; }
.wp-label { flex: 1; font-size: 0.85rem; color: #e2e8f0; }

/* Toggle button group */
.btn-group-toggle { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toggle-btn {
  background: #334155; border: 2px solid #475569;
  border-radius: 8px; color: #94a3b8;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  padding: 0.5rem 0.9rem; cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn.active { border-color: #3b82f6; color: #93c5fd; background: #1e3a5f; }

/* Trigger sections */
.trigger-section { margin-top: 0.5rem; }

/* Toggle checkbox */
.toggle-check {
  width: 22px; height: 22px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Settings grid */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.setting-group h3 { font-size: 1rem; color: #fbbf24; margin-bottom: 0.75rem; }
@media (max-width: 700px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* Feedback */
.feedback-msg { color: #86efac; font-weight: 700; font-size: 0.9rem; margin-top: 0.5rem; }
.hint { color: #64748b; font-size: 0.82rem; margin-top: 0.3rem; }
.empty-msg { color: #475569; font-style: italic; padding: 1rem 0; }

/* GPS dots */
.gps-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.gps-searching { background: #f59e0b; animation: blink 1s ease-in-out infinite; }
.gps-good  { background: #22c55e; }
.gps-ok    { background: #86efac; }
.gps-weak  { background: #f97316; }
.gps-error { background: #ef4444; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* Toast */
.r-toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b; color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 50px; padding: 0.65rem 1.5rem;
  font-weight: 700; font-size: 0.9rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}
.r-toast-show { transform: translateX(-50%) translateY(0); }
.r-toast-warn { border-color: #f59e0b; color: #fbbf24; }
.r-toast-success { border-color: #16a34a; color: #86efac; }

/* ── Berichten tab ───────────────────────────── */
.snelberichten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.snelbericht-btn {
  background: #1e3a5f;
  border: 1.5px solid #334155;
  border-radius: 10px;
  color: #93c5fd;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.snelbericht-btn:hover { background: #1e4a7f; border-color: #3b82f6; }
.snelbericht-btn.snelbericht-actief {
  background: #1e4a7f;
  border-color: #60a5fa;
  color: #dbeafe;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.4);
}
.bericht-log-item .item-info strong {
  font-size: 0.95rem;
  color: #e2e8f0;
  white-space: normal;
  word-break: break-word;
}

/* ── Opdracht extra velden ───────────────────── */
.opdracht-extra-velden {
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 12px;
  padding: 1.25rem 1.25rem 0.5rem;
  margin-bottom: 1rem;
}
.extra-velden-titel {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.75rem;
  margin-top: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #334155;
}
.extra-velden-titel:first-child { margin-top: 0; }
.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.9rem;
}
.checkbox-label input { width: auto !important; flex-shrink: 0; }

/* Utility */
.hidden { display: none !important; }

/* Responsive sidebar */
@media (max-width: 600px) {
  #sidebar { width: 56px; min-width: 56px; }
  .sidebar-title, .nav-tab span + *, .sidebar-status span + * { display: none; }
  .nav-tab { justify-content: center; padding: 0.9rem 0; }
  .sidebar-header { justify-content: center; padding: 0.75rem; }
}
