/* ============================================================
   GetDressed — Editoryel Minimal tasarım sistemi
   Krem zemin, antrasit tipografi, tek vurgu rengi (kiremit).
   Mobil-öncelikli; masaüstünde 430px telefon çerçevesi.
   ============================================================ */

:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #efe9dd;
  --ink: #1f1d1a;
  --ink-2: #57534b;
  --muted: #8e887c;
  --line: #e7e0d2;
  --accent: #9a4b2f;        /* kiremit — tek vurgu */
  --accent-soft: #f3e2da;
  --keep: #5a6e4e;          /* zeytin — TUT */
  --keep-soft: #e6ebe0;
  --toss: #a43e2c;          /* kiremit koyusu — AT */
  --toss-soft: #f4dfd8;
  --wait: #b98a2f;          /* hardal — BEKLET */
  --wait-soft: #f2e8d2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 29, 26, .05), 0 8px 24px rgba(31, 29, 26, .06);
  --font-display: ui-serif, Georgia, 'Times New Roman', serif;
  --font-body: ui-sans-serif, -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: #eae4d8;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Telefon çerçevesi: mobilde tam ekran, masaüstünde ortalanmış 430px */
.app {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 500px) {
  body { padding: 24px 0; }
  .app {
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(31, 29, 26, .18);
    overflow: hidden;
    border: 1px solid var(--line);
  }
}

/* ---------- Tipografi ---------- */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h1.display { font-size: 1.75rem; line-height: 1.2; }
h2.display { font-size: 1.25rem; line-height: 1.25; }
.eyebrow {
  font-size: .6875rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.sub { color: var(--ink-2); font-size: .9375rem; }
.small { font-size: .8125rem; color: var(--muted); }
.serif-i { font-family: var(--font-display); font-style: italic; }

/* ---------- Üst başlık ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid transparent;
}
.topbar.lined { border-bottom-color: var(--line); }
.topbar .title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; flex: 1; }
.topbar .back {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 1.1rem;
}

/* ---------- İçerik ---------- */
.content {
  flex: 1;
  padding: 16px 20px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}
.content.no-nav { padding-bottom: 32px; }
.section-gap { margin-top: 28px; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card.flat { box-shadow: none; }
.card.accent { background: var(--accent-soft); border-color: transparent; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .9375rem var(--font-body);
  padding: 14px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: transform .06s ease, opacity .15s ease;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 9px 14px; font-size: .8125rem; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Rozet & çipler ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: .8125rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: all .12s ease;
}
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 12px; margin: 0 -20px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .6875rem; font-weight: 600; letter-spacing: .02em;
}
.badge-keep { background: var(--keep-soft); color: var(--keep); }
.badge-toss { background: var(--toss-soft); color: var(--toss); }
.badge-wait { background: var(--wait-soft); color: #8a6620; }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Kıyafet görseli ---------- */
.garment {
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  overflow: hidden; position: relative;
}
.garment svg { width: 78%; height: 78%; display: block; }
.garment img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Gardırop grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.item-card { text-decoration: none; color: inherit; display: block; }
.item-card .garment { aspect-ratio: 1; border: 1px solid var(--line); }
.item-card .name {
  font-size: .875rem; font-weight: 600; margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-card .meta { font-size: .75rem; color: var(--muted); }

/* ---------- Liste satırı ---------- */
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.row:last-child { border-bottom: none; }
.row .garment { width: 56px; height: 56px; flex: none; border: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }

/* ---------- İstatistik kutuları ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.stat .lbl { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* Yatay bar (analiz) */
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Renk noktası */
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.12); vertical-align: -2px; }

/* ---------- Alt gezinme ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 430px; margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 500px) {
  .nav { bottom: 24px; border-radius: 0 0 27px 27px; border: 1px solid var(--line); border-top-width: 1px; }
}
.nav a {
  flex: 1; height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted);
  font-size: .625rem; font-weight: 600; letter-spacing: .02em;
}
.nav a svg { width: 23px; height: 23px; }
.nav a.active { color: var(--ink); }
.nav a.active svg { color: var(--accent); }

/* ---------- Swipe kartları (sadeleş) ---------- */
.deck { position: relative; height: min(58vh, 470px); }
.swipe-card {
  position: absolute; inset: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  touch-action: none; will-change: transform;
}
.swipe-card .garment { flex: 1; border-radius: 0; background: var(--surface); }
.swipe-card .info { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.swipe-card .stamp {
  position: absolute; top: 22px; padding: 6px 14px; border-radius: 8px;
  font: 800 1.05rem var(--font-body); letter-spacing: .08em;
  border: 3px solid; transform: rotate(-12deg); opacity: 0; pointer-events: none;
}
.swipe-card .stamp.keep { left: 18px; color: var(--keep); border-color: var(--keep); background: var(--keep-soft); }
.swipe-card .stamp.toss { right: 18px; color: var(--toss); border-color: var(--toss); background: var(--toss-soft); transform: rotate(12deg); }

.deck-actions { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.deck-actions .act {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 1.5rem;
  transition: transform .08s ease;
}
.deck-actions .act:active { transform: scale(.92); }
.deck-actions .act.toss { color: var(--toss); }
.deck-actions .act.keep { color: var(--keep); }
.deck-actions .act.wait { width: 50px; height: 50px; align-self: center; color: #8a6620; font-size: 1.15rem; }

/* ---------- Kombin ---------- */
.outfit-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.outfit-items { display: flex; gap: 10px; }
.outfit-items .garment { flex: 1; aspect-ratio: 1; border: 1px solid var(--line); }

/* ---------- Formlar ---------- */
input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 13px 14px;
  font: 400 .9375rem var(--font-body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); }
label.f { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg);
  padding: 11px 20px; border-radius: 999px;
  font-size: .875rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60;
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Sayfa geçiş animasyonu ---------- */
.content > * { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .big { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Yardımcılar ---------- */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }
.hidden { display: none !important; }
