/* ===== Loomi – Fashion-Tech Design ===== */

:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --ink: #1d1a16;
  --ink-soft: #5c574e;
  --ink-faint: #8b857a;
  --line: #e7e2da;
  --accent: #5b4de0;
  --accent-soft: #efecfc;
  --accent-ink: #4539b8;
  --ok: #2f8f5b;
  --warn: #b7791f;
  --bad: #c23b3b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 26, 22, 0.05), 0 8px 24px rgba(29, 26, 22, 0.06);
  --shadow-lift: 0 2px 4px rgba(29, 26, 22, 0.06), 0 16px 40px rgba(29, 26, 22, 0.12);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ===== Topbar ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: rgba(246, 244, 240, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 2px;
}

.nav { display: flex; gap: 6px; }

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn:hover { background: rgba(91, 77, 224, 0.08); color: var(--ink); }

.nav-btn.active { background: var(--accent); color: #fff; }

/* ===== Layout ===== */

main { max-width: 1100px; margin: 0 auto; padding: 32px 28px 80px; }

.view { display: none; }
.view.active { display: block; animation: fade-in 0.25s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro { margin-bottom: 24px; }

.intro h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.intro .sub { margin: 0; color: var(--ink-soft); max-width: 62ch; }

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}

/* ===== Karten ===== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 16px;
}

.card.placeholder {
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
  padding: 32px;
}

/* ===== Formulare ===== */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.muted { color: var(--ink-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="number"], select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.form-grid .field { margin-bottom: 0; }

/* Chips (Wetterlage) */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--accent-ink); }

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== Buttons ===== */

.btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn.primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  margin-top: 6px;
}

.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(91, 77, 224, 0.35); }

.btn.secondary {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.btn.secondary:hover:not(:disabled) { background: #e5e0fb; }

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn.ghost:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }

.actions { display: flex; gap: 10px; margin: 22px 0; flex-wrap: wrap; }

/* ===== Ergebnisse ===== */

.results { display: grid; gap: 18px; }

.outfit-card { animation: rise 0.35s ease backwards; }

.outfit-card:nth-child(1) { animation-delay: 0.05s; }
.outfit-card:nth-child(2) { animation-delay: 0.15s; }
.outfit-card:nth-child(3) { animation-delay: 0.25s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.outfit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rank {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-ink);
}

.total {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
}

.total small { font-size: 13px; color: var(--ink-faint); font-family: var(--font-sans); }

.item-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.color-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.item-name { font-weight: 600; }

.chip-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.item-meta { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.dots { display: inline-flex; gap: 3px; }

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.on { background: var(--accent); }

/* Komponenten */

.components { display: grid; gap: 8px; margin-bottom: 14px; }

.comp-row { display: grid; grid-template-columns: 110px 1fr 90px; gap: 10px; align-items: center; }

.comp-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.comp-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.comp-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.comp-bar > span.good { background: var(--ok); }
.comp-bar > span.mid { background: var(--warn); }
.comp-bar > span.low { background: var(--bad); }

.comp-value {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
}

.comp-details {
  grid-column: 2 / 4;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: -4px;
}

/* Feedback */

.rating {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.rating .hint { font-size: 12px; color: var(--ink-faint); margin-right: 4px; }

.star {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #d8d2c8;
  cursor: pointer;
  padding: 2px 3px;
  transition: transform 0.12s ease, color 0.12s ease;
}

.star:hover { transform: scale(1.25); color: var(--warn); }

.star.active { color: var(--warn); }

.rating.rated .star { pointer-events: none; opacity: 0.45; }

.rating .thanks { font-size: 12px; color: var(--ok); font-weight: 600; }

/* ===== Kleiderschrank ===== */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.item-card .item-name { font-family: var(--font-serif); font-size: 17px; }

.item-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.item-card .meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
}

.delete-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.delete-btn:hover { border-color: var(--bad); color: var(--bad); }

.empty-note {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-faint);
  padding: 40px 0;
}

/* ===== Profil ===== */

#profile-card .empty-state { color: var(--ink-soft); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.stat {
  flex: 1;
  min-width: 140px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.stat .num { font-family: var(--font-serif); font-size: 26px; font-weight: 600; }
.stat .lbl { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

.pref-list { display: grid; gap: 10px; margin-bottom: 20px; }

.pref-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; }

.pref-value { font-weight: 600; font-size: 13px; }

.pref-count { font-size: 12px; color: var(--ink-faint); text-align: right; }

.numeric-prefs { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; color: var(--ink-soft); }

.numeric-prefs strong { color: var(--ink); }

/* ===== Toasts ===== */

#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  font-size: 14px;
  animation: rise 0.25s ease;
  max-width: 340px;
}

.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .brand-tagline { display: none; }
  main { padding: 24px 16px 60px; }
  .intro h1 { font-size: 28px; }
  .comp-row { grid-template-columns: 90px 1fr 70px; }
}
