:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #192234;
  --glass: rgba(15, 22, 36, 0.88);
  --border: #26324a;
  --text: #eef2ff;
  --muted: #94a3b8;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --green: #22c55e;
  --amber: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-xs { font-size: 12px; }
.full-width { width: 100%; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* --- APP SHELL --- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* --- MASAÜSTÜ ÜST BAR --- */
.desktop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav-tabs { display: flex; gap: 6px; }
.nav-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 7px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.nav-btn.active, .nav-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.auth-bar { display: flex; align-items: center; gap: 10px; }
.user-badge {
  font-size: 12px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 999px; color: #cbd5e1;
}

/* --- BUTONLAR --- */
.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 10px 14px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-weight: 600; cursor: pointer; font-size: 13px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-ghost:hover { border-color: #475569; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.link-btn {
  background: none; border: none; color: #fb923c; text-decoration: underline;
  cursor: pointer; padding: 0; font: inherit; font-size: 12px;
}

.setup-banner {
  background: #451a03; border-bottom: 1px solid #9a3412; color: #fed7aa;
  padding: 8px 16px; font-size: 12px; z-index: 25;
}

/* --- MASAÜSTÜ EXPLORE LAYOUT (>= 901px) --- */
.explore-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 0;
  position: relative;
}

.sidebar-sheet {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.desktop-sidebar-controls {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.venue-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.venue-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.venue-card:hover { border-color: var(--accent); }
.vc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vc-title { font-weight: 700; font-size: 14px; }
.vc-price { font-weight: 800; color: #fb923c; font-size: 14px; white-space: nowrap; }
.vc-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.status-hot { color: #fb923c; font-weight: 700; }
.status-fresh { color: var(--green); font-weight: 700; }
.status-stale { color: var(--amber); font-weight: 700; }
.status-old { color: var(--muted); }

/* --- HARİTA PANE --- */
.map-pane { position: relative; min-height: 0; width: 100%; height: 100%; }
.map-canvas { width: 100%; height: 100%; }

/* --- MOBİL YÜZEN ÜST BAR (Masaüstünde gizli) --- */
.mobile-floating-top { display: none; }
.sheet-handle { display: none; }
.mobile-empty-pill { display: none; }

/* --- SAĞ ALT THUMB ZONE (🎯 + FAB) --- */
.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 28;
}

.fab-cluster {
  position: absolute;
  right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.gps-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text); font-size: 18px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.gps-fab:active { transform: scale(0.94); }

.main-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none; color: #fff; font-size: 28px; font-weight: 700;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(249, 115, 22, 0.45);
  transition: transform 0.2s ease;
}
.main-fab-plus { display: inline-block; line-height: 1; transition: transform 0.2s ease; }
.main-fab.open .main-fab-plus { transform: rotate(45deg); }

.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 4px;
}
.fab-item {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: none; padding: 0; cursor: pointer;
}
.fab-label {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.fab-mini {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* --- MEKÂN DETAY KARTI --- */
.detail-drawer {
  position: absolute; right: 16px; top: 16px; width: 340px; max-height: calc(100% - 32px);
  overflow-y: auto; background: rgba(18, 24, 38, 0.96); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); z-index: 32;
}
.dir-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.menu-item-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.legal-note {
  margin-top: 12px; padding: 8px 10px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.7); font-size: 11px; color: var(--muted); line-height: 1.45;
}

/* --- SOL YAN ÇEKMECE (SLIDE-OVER DRAWER) --- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.65); z-index: 44;
}
.side-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(295px, 84vw);
  background: var(--surface); border-right: 1px solid var(--border);
  z-index: 45; display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  transform: translateX(-105%);
  transition: transform 0.24s ease;
}
.side-drawer.open { transform: translateX(0); }
.sd-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sd-user-box { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sd-user-name { font-weight: 700; font-size: 14px; color: #e2e8f0; }
.sd-nav { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; flex: 1; }
.sd-nav-item {
  text-align: left; background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 11px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.sd-nav-item.active, .sd-nav-item:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.sd-footer {
  border-top: 1px solid var(--border); padding-top: 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.sd-credit { font-size: 11px; color: var(--muted); }

/* --- TAM EKRAN OVERLAY EKRANLARI (GÖNDER & ADMİN) --- */
.overlay-screen {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.overlay-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.overlay-title { font-weight: 800; font-size: 15px; }
.overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px max(28px, env(safe-area-inset-bottom));
}

.form-card {
  max-width: 660px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.kvkk-micro-alert {
  background: #172554; border: 1px solid #1d4ed8; color: #dbeafe;
  padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.5; margin-bottom: 14px;
}

.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form.compact { gap: 8px; margin-top: 8px; }
.stack-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.stack-form input, .stack-form select, .stack-form textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px;
}
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus {
  outline: none; border-color: var(--accent);
}

.preview-box { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.preview-box img { max-height: 220px; border-radius: 10px; border: 1px solid var(--border); }

.admin-grid {
  max-width: 1120px; margin: 0 auto; display: grid;
  grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
}
.admin-grid .form-card { max-width: none; width: 100%; margin: 0; }
details { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.stack-list { display: flex; flex-direction: column; gap: 10px; }
.sub-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 13px; }

/* --- MODALLAR & TOAST --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.78);
  display: grid; place-items: center; z-index: 60; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 12px; max-height: 88dvh; overflow-y: auto;
}
.modal-wide { max-width: 600px; }
.auth-mode-switch { display: flex; gap: 8px; }
.checkbox-row { flex-direction: row !important; align-items: flex-start; gap: 8px !important; font-weight: 400 !important; font-size: 12px !important; line-height: 1.45; }
.checkbox-row input { width: auto; margin-top: 2px; }
.divider { text-align: center; font-size: 12px; color: var(--muted); }
.kvkk-body { font-size: 13px; line-height: 1.6; color: #cbd5e1; }
.kvkk-body p { margin: 0 0 10px; }

.toast {
  position: fixed; top: max(68px, calc(env(safe-area-inset-top) + 56px)); left: 50%;
  transform: translateX(-50%); background: #1e293b; border: 1px solid var(--accent);
  color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); max-width: 92vw; text-align: center;
}

/* ============================================================================
   MOBİL TAM EKRAN HARİTA KABUĞU (<= 900px) — Google Maps / Native Hissi
   ============================================================================ */
@media (max-width: 900px) {
  .desktop-topbar { display: none; }
  .desktop-sidebar-controls { display: none; }
  .maplibregl-ctrl-top-left { display: none; }

  .explore-workspace {
    display: block;
    position: relative;
    height: 100dvh;
    width: 100%;
  }

  .map-pane {
    position: fixed;
    inset: 0;
    z-index: 1;
  }

  /* Yüzen Üst Bar (Boşluklar haritaya geçirgen!) */
  .mobile-floating-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 20;
    pointer-events: none;
  }

  .mobile-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .icon-fab, .brand-pill, .auth-pill {
    pointer-events: auto;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--text);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  .icon-fab {
    width: 44px; height: 44px; border-radius: 50%;
    font-size: 18px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  }

  .brand-pill {
    height: 44px; padding: 0 14px 0 8px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .brand-dot-sm {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff; font-weight: 800; font-size: 14px;
    display: grid; place-items: center;
  }
  .brand-pill-text { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
  .brand-pill-text strong { color: var(--accent); }

  .auth-pill {
    height: 44px; padding: 0 14px; border-radius: 999px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .floating-pill-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    pointer-events: auto;
    padding-bottom: 2px;
  }
  .floating-pill-strip::-webkit-scrollbar { display: none; }
  .floating-pill-strip:empty { display: none; }
  .floating-pill-strip .pill {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  }
  .floating-pill-strip .pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  /* Mobilde Boş Durum: İnce, ferah yüzen bilgi hapı */
  .mobile-empty-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: 14px;
    right: 84px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 18;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 11px 14px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  }
  .mep-icon { font-size: 20px; flex-shrink: 0; }
  .mep-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.3; }
  .mep-text strong { font-size: 13px; }
  .mep-text span { color: var(--muted); }
  .mep-text span strong { color: var(--accent); font-size: 12px; }

  /* Mobil Alt Çekmece (Veri varken açılır, veri yokken tamamen gizli!) */
  .sidebar-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 25;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    background: rgba(15, 22, 36, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-height: 62dvh;
    transform: translateY(calc(100% - 58px - env(safe-area-inset-bottom)));
    transition: transform 0.26s ease;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  }
  .sidebar-sheet.empty-hidden {
    display: none;
  }
  .sidebar-sheet.expanded {
    transform: translateY(0);
  }

  .sheet-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    background: transparent;
    border: none;
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .sheet-grabber {
    width: 40px; height: 4px; border-radius: 999px; background: #475569;
  }

  /* Veri varken FAB alt çekmecenin üstünde dursun */
  .has-venues .fab-cluster {
    bottom: calc(68px + max(10px, env(safe-area-inset-bottom)));
  }

  /* Mobil Mekân Detayı: Alt çekmece şeklinde */
  .detail-drawer {
    position: fixed;
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%;
    max-height: 70dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 36;
  }

  .admin-grid { grid-template-columns: 1fr; }
}
