/* ============================================================
   Rota — Aleyna'ya özel • "Zarif Gül" teması • Mobil öncelikli
   Sofistike, feminen, sade. Dusty rose + krem + şampanya altını.
   ============================================================ */

:root {
  /* Zemin & yüzey */
  --bg:      #faf6f3;   /* sıcak fildişi */
  --bg-2:    #f4ebe7;
  --card:    #fffdfc;
  --line:    #ece0dc;   /* taupe-gül çizgi */

  /* Gül paleti (olgun, dusty) */
  --rose:    #b8607d;   /* dusty rose (ana) */
  --rose-dp: #9c4d68;   /* koyu gül */
  --rose-sf: #f6e7ea;   /* çok yumuşak gül zemin */
  --rose-100:#f6e7ea;

  /* Aksanlar */
  --gold:    #b8924f;   /* şampanya altını */
  --gold-dp: #8a6a30;
  --sage:    #5b9e7d;   /* sakin adaçayı (başarı) */
  --sage-sf: #e7efe9;

  /* Metin */
  --ink:     #3b2a30;   /* derin erik-kahve */
  --soft:    #8a7076;   /* soluk mor-gri */

  --shadow:   0 14px 40px -20px rgba(59,42,48,.30);
  --shadow-sm:0 8px 22px -16px rgba(59,42,48,.28);

  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 11px;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:#1e1519; --bg-2:#271a1f; --card:#2b1e23; --line:#42323a;
    --rose:#d98da6; --rose-dp:#e6a3b8; --rose-sf:#3a2730; --rose-100:#3a2730;
    --gold:#d4ab63; --gold-dp:#e6c58a; --sage:#7cc0a0; --sage-sf:#1c3329;
    --ink:#f4e7ea; --soft:#c2a2ac;
    --shadow:0 16px 44px -20px rgba(0,0,0,.6);
    --shadow-sm:0 8px 22px -16px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg:#1e1519; --bg-2:#271a1f; --card:#2b1e23; --line:#42323a;
  --rose:#d98da6; --rose-dp:#e6a3b8; --rose-sf:#3a2730; --rose-100:#3a2730;
  --gold:#d4ab63; --gold-dp:#e6c58a; --sage:#7cc0a0; --sage-sf:#1c3329;
  --ink:#f4e7ea; --soft:#c2a2ac;
}
:root[data-theme="light"] {
  --bg:#faf6f3; --bg-2:#f4ebe7; --card:#fffdfc; --line:#ece0dc;
  --rose:#b8607d; --rose-dp:#9c4d68; --rose-sf:#f6e7ea; --rose-100:#f6e7ea;
  --gold:#b8924f; --sage:#5b9e7d; --sage-sf:#e7efe9;
  --ink:#3b2a30; --soft:#8a7076;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

body {
  background:
    radial-gradient(1100px 460px at 82% -12%, var(--rose-sf), transparent 60%),
    radial-gradient(760px 380px at -12% 6%, var(--bg-2), transparent 60%),
    var(--bg);
  min-height: 100vh; min-height: 100dvh;
}

.app {
  max-width: 520px; margin: 0 auto;
  padding: 0 18px calc(96px + env(safe-area-inset-bottom));
  position: relative;
}

/* ---------- Başlık / karşılama ---------- */
.hero { padding: 30px 2px 8px; }
.hero .greet {
  font-size: 11.5px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--soft);
}
.hero h1 {
  font-family: var(--serif);
  margin: 8px 0 4px; font-size: 30px; font-weight: 600;
  line-height: 1.12; letter-spacing: .2px; text-wrap: balance;
}
.hero .sub { color: var(--soft); font-size: 14px; font-weight: 500; margin-top: 3px; }
.hero .wave { display: inline-block; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 18px; margin: 14px 0;
  border: 1px solid var(--line);
}
.card.tight { padding: 15px; }

.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--rose-dp); font-weight: 600; margin: 26px 2px 10px;
}

/* ---------- İlerleme özeti ---------- */
.summary {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--rose), var(--rose-dp));
  color: #fff; border: none;
  box-shadow: var(--shadow);
}
.summary .ring {
  --p: 0; width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(rgba(255,255,255,.95) calc(var(--p) * 1%), rgba(255,255,255,.24) 0);
}
.summary .ring::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  background: var(--rose-dp);
}
.summary .ring b { position: relative; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary .meta { line-height: 1.4; }
.summary .meta .big { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.summary .meta .small { font-size: 13px; opacity: .9; font-weight: 500; margin-top: 2px; }

/* ---------- Öğle arası çizgisi ---------- */
.lunch {
  display: flex; align-items: center; gap: 10px; margin: 16px 6px;
  color: var(--gold-dp); font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
}
.lunch::before, .lunch::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Durak kartı ---------- */
.stop {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px; margin: 11px 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: opacity .2s ease;
}
.stop.done { opacity: .55; }
.stop.done .stop-name { text-decoration: line-through; text-decoration-color: var(--rose); }
.stop .order {
  flex: 0 0 30px; height: 30px; width: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
  font-family: var(--serif); background: var(--rose-sf); color: var(--rose-dp);
}
.stop.done .order { background: var(--sage-sf); color: var(--sage); }
.stop .body { flex: 1; min-width: 0; }
.stop-name { font-weight: 600; font-size: 16px; letter-spacing: .2px; }
.stop-meta { font-size: 12px; color: var(--soft); font-weight: 500; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: #f1e8ea; color: var(--soft);
}
.badge.time { background: #f3ead9; color: var(--gold-dp); text-transform: none; letter-spacing: 0; }
.badge.hosp { background: var(--rose-sf); color: var(--rose-dp); }
.badge.asm  { background: var(--sage-sf); color: #3f7a60; }
.badge.warn { background: #f6e2df; color: #a85a52; }

.stop .actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }

/* ---------- Butonlar ---------- */
.btn {
  border: none; cursor: pointer; font-family: var(--sans);
  font-weight: 600; font-size: 14px; letter-spacing: .2px;
  padding: 11px 16px; border-radius: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--rose), var(--rose-dp)); color: #fff; box-shadow: var(--shadow-sm); }
.btn.soft { background: var(--rose-sf); color: var(--rose-dp); }
.btn.ghost { background: transparent; color: var(--soft); padding: 10px 12px; }
.btn.tiny { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn.ok { background: var(--sage); color: #fff; }
.btn.full { width: 100%; justify-content: center; }
.btn.map { background: var(--bg-2); color: var(--rose-dp); }
.btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.check {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--rose); background: transparent;
  display: grid; place-items: center; cursor: pointer;
  font-size: 14px; color: transparent; transition: all .15s;
}
.stop.done .check { background: var(--sage); border-color: var(--sage); color: #fff; }

/* ---------- Hafta görünümü ---------- */
.day-block { margin: 14px 0; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 4px 8px; }
.day-head .name { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.day-head .name .today-pill { font-family: var(--sans); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; background: var(--rose); color: #fff; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.day-head .info { font-size: 12px; color: var(--soft); font-weight: 500; font-variant-numeric: tabular-nums; }

.mini {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin: 7px 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); font-weight: 500;
}
.mini .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); flex: 0 0 8px; }
.mini .nm { flex: 1; font-size: 14px; }
.mini .tm { font-size: 10.5px; color: var(--gold-dp); background: #f3ead9; padding: 2px 8px; border-radius: 999px; font-weight: 600; }

/* ---------- Yerler listesi ---------- */
.search {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-md); padding: 13px 15px; font-size: 15px;
  font-family: var(--sans); font-weight: 500; color: var(--ink);
  box-shadow: var(--shadow-sm); margin: 4px 0 8px;
}
.search::placeholder { color: var(--soft); opacity: .8; }

.place-row {
  display: flex; align-items: center; gap: 13px; padding: 14px 15px; margin: 8px 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.place-row .ic { font-size: 19px; opacity: .85; }
.place-row .info { flex: 1; min-width: 0; }
.place-row .nm { font-weight: 600; font-size: 15px; }
.place-row .dt { font-size: 12px; color: var(--soft); font-weight: 500; margin-top: 1px; }
.place-row .last { font-size: 11.5px; color: var(--rose-dp); font-weight: 600; margin-top: 3px; }

.conf-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.conf-yuksek { background: var(--sage); }
.conf-orta   { background: var(--gold); }
.conf-dusuk  { background: #cf8a86; }

/* ---------- Harita ---------- */
#map { height: 62vh; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.leaflet-container { font-family: var(--sans); border-radius: var(--r-lg); }
.map-hint { font-size: 12.5px; color: var(--soft); font-weight: 500; text-align: center; margin: 12px 4px; }

/* ---------- Ayarlar ---------- */
.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--soft); margin-bottom: 7px; }
.field input {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-sm); padding: 12px 13px; font-size: 15px;
  font-family: var(--sans); font-weight: 500; color: var(--ink);
}
.field input:focus-visible { outline: 2px solid var(--rose); outline-offset: 1px; }

/* ---------- Alt sekme çubuğu ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  max-width: 520px; margin: 0 auto;
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--soft); font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: .3px;
  padding: 4px 0; border-radius: 12px; transition: color .15s;
}
.tab .ic { font-size: 19px; line-height: 1; opacity: .55; transition: transform .15s, opacity .15s; }
.tab.active { color: var(--rose-dp); }
.tab.active .ic { opacity: 1; transform: translateY(-1px) scale(1.08); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(40,26,31,.42); backdrop-filter: blur(3px);
  display: grid; place-items: end center;
}
.modal {
  width: 100%; max-width: 520px; background: var(--card);
  border-radius: 24px 24px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 44px -12px rgba(40,26,31,.4);
  animation: slideUp .3s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal .grab { width: 42px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 16px; }
.modal h3 { font-family: var(--serif); margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.modal textarea {
  width: 100%; min-height: 120px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink);
}
#miniMap { height: 240px; border-radius: var(--r-md); margin: 8px 0; border: 1px solid var(--line); }

/* ---------- Yardımcılar ---------- */
.empty { text-align: center; color: var(--soft); font-weight: 500; padding: 40px 20px; }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .7; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.spacer { height: 8px; }
.center { text-align: center; }
.muted { color: var(--soft); font-size: 12.5px; font-weight: 500; }
.hidden { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  z-index: 80; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.view { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
