/* Hallenradar — Neely-Komponentenschicht (siehe Epic #13, Issue #2).
   Die wenigen Neely-DS-Komponenten, die das Dashboard-Design nutzt
   (Button, Input, Textarea, Select, Checkbox, Tabs, Badge) als schlichte
   CSS-Klassen, ohne React und ohne Build-Schritt. Werte 1:1 aus dem
   DS-Bundle (_ds_bundle.js); Chip, Mikro-Label und Trenner aus
   docs/design/hallen-dashboard/Hallen Dashboard.dc.html.
   Nutzt nur Token-Variablen aus neely/styles.css — vorher einbinden.
   Klassen sind flach; Zustände als is-* (von JS umschaltbar). */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 2.25rem;
  margin: 0;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  outline: none;
  transition: var(--transition-colors);
}
.btn:hover { background: color-mix(in srgb, var(--primary) 90%, transparent); }
.btn:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-focus); }
.btn:disabled, .btn.is-disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }

/* Größen (Standard: 36px) */
.btn-sm { height: 2rem; padding: 0 0.75rem; gap: 0.375rem; }
.btn-xs { height: 1.5rem; padding: 0 0.5rem; gap: 0.25rem; font-size: var(--text-xs); }
.btn-xs svg { width: 12px; height: 12px; }
.btn-icon-sm { width: 2rem; height: 2rem; padding: 0; }

/* Varianten (nach den Größen, damit .btn-link Höhe/Padding gewinnt) */
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-outline {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-link { height: auto; padding: 0; background: transparent; color: var(--primary); }
.btn-link:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }

/* ---- Eingabefelder ---- */
.input, .textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-xs);
  outline: none;
  transition: var(--transition-colors);
}
.input { height: 2.25rem; padding: 0.25rem 0.75rem; }
.textarea {
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  line-height: var(--leading-normal);
  resize: vertical;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.input:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-focus); }
.input:disabled, .input.is-disabled,
.textarea:disabled, .textarea.is-disabled { opacity: 0.5; pointer-events: none; }

/* ---- Select (natives <select>) ---- */
/* Wie Neely Select (components/forms/Select.jsx): eigener Pfeil statt des nativen, Größe sm = 32px.
   Den Pfeil zeichnet die umgebende .select-huelle als ::after (Lucide "chevron-down" als Maske
   in muted-foreground), ohne Klicks abzufangen. */
.select-huelle { position: relative; display: inline-flex; width: 100%; }
.select-huelle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.625rem;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--muted-foreground);
  opacity: 0.6;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 2.25rem;
  margin: 0;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-xs);
  outline: none;
  cursor: pointer;
  transition: var(--transition-colors);
}
.select-sm { height: 2rem; }
.select:focus-visible { border-color: var(--ring); box-shadow: var(--ring-focus); }
.select:disabled { opacity: 0.5; cursor: not-allowed; }
/* Hoher Kontrast (forced colors) ersetzt den Hintergrund des Pfeils: in Textfarbe erzwingen,
   sonst verschwindet er */
@media (forced-colors: active) {
  .select-huelle::after { background: CanvasText; forced-color-adjust: none; }
}

/* ---- Checkbox ---- */
/* Rein optisch (span im umgebenden Button); geht auch als input[type=checkbox]. */
.checkbox {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 1rem;
  height: 1rem;
  margin: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: var(--transition-colors);
}
.checkbox::after {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  background: var(--primary-foreground);
  /* Lucide "check" als Maske, damit der Haken primary-foreground annimmt */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.checkbox.is-checked, .checkbox:checked { background: var(--primary); border-color: var(--primary); }
.checkbox.is-checked::after, .checkbox:checked::after { transform: scale(1); }
.checkbox:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-focus); }
.checkbox.is-disabled, .checkbox:disabled { opacity: 0.5; }

/* ---- Tabs (Segment-Umschalter) ---- */
.tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  width: fit-content;
  height: 2.25rem;
  padding: 3px;
  border-radius: var(--radius-lg);
  background: var(--muted);
}
.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-sizing: border-box;
  height: calc(100% - 1px);
  margin: 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: color-mix(in srgb, var(--foreground) 60%, transparent);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-colors);
}
.tabs-trigger:hover { color: var(--foreground); }
.tabs-trigger.is-active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
.tabs-trigger:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.tabs-trigger:disabled, .tabs-trigger.is-disabled { opacity: 0.5; pointer-events: none; }

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: fit-content;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
}
.badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }

/* ---- Vereins-Chip ---- */
/* Aktiv-Farben (Rand, Hintergrund, Punkt) setzt JS inline. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: 30px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-colors);
}
.chip:hover { border-color: var(--muted-foreground); }
.chip:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.chip:disabled, .chip.is-disabled { opacity: 0.5; pointer-events: none; }
.chip-punkt {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
}
.chip-anzahl { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* ---- Mikro-Label ---- */
.mikro-label {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Trenner ---- */
.trenner {
  flex-shrink: 0;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--border);
}

/* ---- Wortmarke (Kopf der App und Anmeldeseite) ---- */
.wortmarke {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wortmarke-quadrat {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--warning);
}
