/* ═══════════════════════════════════════════════════════
   components.css – Wiederverwendbare UI-Komponenten
   Buttons · Inputs · Modals · Badges · Stand-Items
   ═══════════════════════════════════════════════════════ */

/* ── Buttons ────────────────────────────────────────── */
.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  padding: 6px 11px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'Fira Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tool-btn:hover  { background: var(--surface2); color: var(--text); border-color: var(--border); }
.tool-btn.active { background: var(--accent); color: #1a1200; border-color: var(--accent2); font-weight: 600; }
.tool-btn svg    { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-family: 'Fira Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover    { background: var(--accent2); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 14px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.zoom-btn {
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Formulare ──────────────────────────────────────── */
label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}

input[type=text],
input[type=number],
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.8rem;
  padding: 6px 10px;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; }

input[type=color] {
  width: 36px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface2);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.range-input { width: 100%; accent-color: var(--accent); }

.input-row        { display: flex; gap: 8px; margin-bottom: 8px; }
.input-row > div  { flex: 1; }

.input-suffix         { position: relative; }
.input-suffix input   { padding-right: 28px; }
.input-suffix span    {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Farbfelder ─────────────────────────────────────── */
.color-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.1s;
  flex-shrink: 0;
}
.color-swatch.active { border-color: var(--accent2); }

/* ── Emoji-Auswahl ──────────────────────────────────── */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.emoji-opt {
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
}
.emoji-opt:hover,
.emoji-opt.active { border-color: var(--accent); background: rgba(200,151,58,0.1); }

/* ── Bild-Upload ────────────────────────────────────── */
.img-upload-area {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.img-upload-area:hover { border-color: var(--accent); }
.img-preview {
  width: 100%; max-height: 100px;
  object-fit: contain;
  border-radius: 6px;
  margin-top: 6px;
  display: none;
}

/* ── Stand-Liste ────────────────────────────────────── */
.stand-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stand-item:hover    { border-color: var(--accent); }
.stand-item.selected { border-color: var(--accent); background: rgba(200,151,58,0.1); }

.stand-item .stand-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.stand-item .stand-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }

.stand-item .stand-info         { flex: 1; min-width: 0; }
.stand-item .stand-info strong  { font-size: 0.8rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand-item .stand-info span    { font-size: 0.7rem; color: var(--text-muted); }

.stand-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 0.9rem; }
.stand-del:hover { color: var(--red); background: rgba(224,92,92,0.1); }

.add-stand-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'Fira Sans', sans-serif;
  width: 100%;
  transition: all 0.15s;
  margin-top: 4px;
}
.add-stand-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Modals ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 400px;
  max-width: 95vw;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2  { font-family: 'Cinzel', serif; font-size: 0.95rem; color: var(--accent); }
.modal-close      { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.modal-body       { padding: 20px; }
.modal-footer     { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Speichern-Modal spezifisch */
.save-preview-box   { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 4px; }
.save-preview-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; letter-spacing: 0.06em; }
.save-info-box      { margin-top: 12px; padding: 10px 12px; background: rgba(200,151,58,0.07); border: 1px solid rgba(200,151,58,0.2); border-radius: 8px; font-size: 0.72rem; color: var(--text-muted); line-height: 1.6; }

/* ── Kategorie-Badges ───────────────────────────────── */
.cat-badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.04em; }
.cat-stand { background: rgba(200,151,58,0.2); color: var(--accent2); }
.cat-weg   { background: rgba(74,143,232,0.2);  color: var(--blue); }
.cat-zone  { background: rgba(62,201,123,0.2);  color: var(--green); }
