/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--c-amber);
  color: #000;
  font-weight: 700;
  font-size: var(--text-base);
  border-radius: var(--r-full);
  padding: 12px var(--sp-5);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--c-amber-light); box-shadow: var(--shadow-amber); }
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary.btn-full { width: 100%; }
.btn-primary.btn-sm { padding: 8px var(--sp-4); font-size: var(--text-sm); }
.btn-primary.btn-lg { padding: 14px var(--sp-6); font-size: var(--text-md); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--c-text-muted);
  font-weight: 500;
  font-size: var(--text-base);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 12px var(--sp-5);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover  { background: var(--c-surface-2); color: var(--c-text); border-color: var(--c-border-strong); }
.btn-ghost:active { transform: scale(0.96); }
.btn-ghost:disabled { opacity: 0.4; pointer-events: none; }
.btn-ghost.btn-full { width: 100%; }
.btn-ghost.btn-sm { padding: 8px var(--sp-4); font-size: var(--text-sm); }

.btn-danger {
  background: var(--c-danger-pale);
  color: var(--c-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--r-full);
  padding: 8px var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--t-fast);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

/* Loading spinner in button */
.btn-primary.loading,
.btn-ghost.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn-primary.loading::after,
.btn-ghost.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: #000;
}
.btn-ghost.loading::after { color: var(--c-text-muted); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--c-border-strong); }

.card-amber {
  background: linear-gradient(135deg, var(--c-surface) 0%, rgba(146, 64, 14, 0.12) 100%);
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-amber);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.card-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}

.card-title-lg {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--c-text);
  line-height: 1.2;
}

.card-meta {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

/* ── Inputs ──────────────────────────────────────────────────────── */
.input {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  padding: 12px var(--sp-4);
  font-size: 16px; /* prevents iOS zoom */
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--c-text-faint); }
.input:focus {
  outline: none;
  border-color: var(--c-amber);
  box-shadow: 0 0 0 3px var(--c-amber-pale);
}
.input:disabled { opacity: 0.5; cursor: not-allowed; }

textarea.input {
  resize: none;
  min-height: 80px;
  line-height: 1.5;
}

/* Range / Slider */
.input-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--c-surface-3);
  outline: none;
  padding: 0;
  border: none;
}
.input-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-amber);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--c-amber-pale);
  transition: transform var(--t-fast);
}
.input-range::-webkit-slider-thumb:active { transform: scale(1.2); }

/* Form group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-text-muted);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--c-danger);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-danger-pale);
  border-radius: var(--r-sm);
  display: none;
}
.form-error.visible { display: block; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.badge-geplant {
  background: var(--c-blue-pale);
  color: var(--c-blue);
  border: 1px solid rgba(96, 165, 250, 0.25);
}
.badge-aktiv {
  background: var(--c-amber-pale);
  color: var(--c-amber-light);
  border: 1px solid var(--c-border-strong);
}
.badge-beendet {
  background: var(--c-success-pale);
  color: var(--c-success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.badge-role {
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

/* ── Toast ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--c-surface-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-full);
  padding: 10px var(--sp-5);
  color: var(--c-text);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  max-width: calc(480px - 48px);
  text-align: center;
  box-shadow: var(--shadow-float);
  transform: translateY(12px) scale(0.95);
  opacity: 0;
  transition: transform var(--t-mid) var(--ease-spring), opacity var(--t-mid);
}
.toast.visible  { transform: none; opacity: 1; }
.toast.success  { border-color: rgba(34, 197, 94, 0.4); }
.toast.error    { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }

/* ── Progress bars ───────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-amber-dim), var(--c-amber-light));
  border-radius: var(--r-full);
  transition: width 0.8s var(--ease-out);
}
.progress-fill.success { background: linear-gradient(90deg, #15803d, var(--c-success)); }

/* ── Stars / Rating ──────────────────────────────────────────────── */
.star-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  user-select: none;
}

.stars-row {
  display: flex;
  gap: var(--sp-2);
}

.star-item {
  width: 40px;
  height: 40px;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.star-item svg {
  width: 100%;
  height: 100%;
  transition: transform var(--t-fast) var(--ease-spring);
}

.star-item:active svg { transform: scale(0.85); }

.star-half {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
}
.star-half.left  { left: 0; }
.star-half.right { right: 0; }

.star-label {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  min-height: 20px;
}

.star-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-amber-light);
  font-variant-numeric: tabular-nums;
}

/* Rating display (read-only inline) */
.rating-display {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.rating-stars { color: var(--c-amber); font-size: var(--text-sm); }
.rating-value { font-size: var(--text-sm); font-weight: 600; color: var(--c-amber-light); }

/* ── Separators & Layout ─────────────────────────────────────────── */
.view-pad { padding: var(--sp-4); }
.view-pad-lg { padding: var(--sp-5) var(--sp-4); }

.section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-text-faint);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}

.divider {
  height: 1px;
  background: var(--c-border);
  margin: var(--sp-4) 0;
}

/* ── Skeleton ────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-surface-3) 50%, var(--c-surface-2) 75%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  gap: var(--sp-3);
}
.empty-state svg { color: var(--c-text-faint); opacity: 0.5; }
.empty-state h3  { font-size: var(--text-md); color: var(--c-text-muted); }
.empty-state p   { font-size: var(--text-sm); color: var(--c-text-faint); }

/* ── Chips (user selection) ──────────────────────────────────────── */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-amber-pale);
  color: var(--c-amber-light);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-full);
  padding: 5px 10px;
  font-size: var(--text-sm);
  font-weight: 500;
}

.chip-remove {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: var(--c-amber-light);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Search results dropdown ─────────────────────────────────────── */
.search-results {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: var(--sp-1);
}
.search-result-item {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: var(--text-sm);
  color: var(--c-text);
}
.search-result-item:hover { background: var(--c-surface-3); }

/* ── Tasting list item ───────────────────────────────────────────── */
.tasting-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
  transition: border-color var(--t-fast);
  display: block;
}
.tasting-card:active { transform: scale(0.99); }

.tasting-card.active-glow {
  border-color: var(--c-border-strong);
  background: linear-gradient(135deg, var(--c-surface), rgba(146, 64, 14, 0.08));
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15);
}

/* ── Pulse dot ───────────────────────────────────────────────────── */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  animation: pulseRing 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── Avatar ──────────────────────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-surface-3);
  border: 2px solid var(--c-border);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; }

.avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-surface-3);
  border: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
}

/* ── XP / Level bar ──────────────────────────────────────────────── */
.xp-bar {
  height: 8px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-amber-dim), var(--c-amber-light));
  border-radius: var(--r-full);
  transition: width 1s var(--ease-out);
}

/* ── Slider with labels ──────────────────────────────────────────── */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--c-text-faint);
}
.slider-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-amber-light);
  text-align: center;
}
