/* ═══════════════════════════ yerleşim ═══════════════════════════ */
#map { position: fixed; inset: 0; background: var(--bg); }

/* ── yüzen panel ── */
.panel {
  position: fixed; z-index: 20;
  top: var(--gap); left: var(--gap); bottom: var(--gap);
  width: var(--panel-w);
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transition: transform .32s var(--ease), opacity .24s var(--ease);
}
.panel.is-collapsed { transform: translateX(calc(-100% - var(--gap) - 8px)); opacity: 0; pointer-events: none; }

.panel__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 18px 16px 14px 18px;
}
.brand { display: flex; align-items: center; flex: 1; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 36px; width: auto; max-width: 100%; }
.panel__tools { display: flex; gap: 4px; }

.panel__tabs { padding: 0 14px 12px; }
.panel__tabs .seg button { font-size: var(--fs-sm); }
.tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent);
  font-size: 10px; font-weight: 800; display: inline-grid; place-items: center;
}

.panel__body { flex: 1; min-height: 0; padding: 4px 14px 18px; }
.pane { display: none; flex-direction: column; gap: var(--space-3); animation: pane-in .22s var(--ease); }
.pane.is-on { display: flex; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } }

.panel__foot {
  padding: 10px 18px 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--fs-xs); color: var(--text-3);
}
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.foot__links a { color: var(--text-3); font-weight: 600; }
.foot__links a:hover { color: var(--text); text-decoration: none; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success);
              box-shadow: 0 0 0 3px var(--success-soft); }
.health-dot.is-warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.health-dot.is-err  { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-soft); }

/* ── panel aç düğmesi ── */
.panel-open {
  position: fixed; z-index: 21; top: var(--gap); left: var(--gap);
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 18px 0 8px; border-radius: var(--r-pill);
  background: var(--glass-strong); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  font-weight: 700; font-size: var(--fs-sm);
  animation: toast-in .25s var(--ease);
}
.panel-open__icon { width: 34px; height: 34px; border-radius: 12px; }

/* ── üst çubuk: arama · menü / altlık ── */
.topbar {
  position: fixed; z-index: 15;
  top: var(--gap); right: var(--gap);
  left: calc(var(--panel-w) + 2 * var(--gap));
  display: grid; grid-template-columns: minmax(200px, 440px) 1fr auto;
  grid-template-areas: "search . nav" ". . base";
  align-items: start; gap: 10px;
  pointer-events: none;
  transition: left .32s var(--ease);
}
body.panel-collapsed .topbar { left: calc(var(--gap) + 150px); }
.topbar > * { pointer-events: auto; }
.search { grid-area: search; position: relative; min-width: 0; }
.nav { grid-area: nav; }
.basemaps { grid-area: base; justify-self: end; }

.nav {
  display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--glass-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.nav__links { display: flex; gap: 2px; }
.nav__link, .nav__icon, .nav__drone, .nav__login, .nav__account {
  height: 36px; display: inline-flex; align-items: center; gap: 7px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: background var(--dur), color var(--dur);
}
.nav__link { padding: 0 12px; }
.nav__link:hover, .nav__icon:hover, .nav__account:hover { background: var(--surface-2); color: var(--text); }
.nav__icon { width: 36px; justify-content: center; }
.nav__menu { display: none; }
.nav__drone { padding: 0 13px; background: var(--hot-soft); color: var(--hot-text); }
.nav__drone:hover { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.nav__login { padding: 0 15px; background: var(--accent); color: var(--on-accent); }
.nav__login:hover { background: var(--accent-hover); }
.nav__account { padding: 0 12px 0 4px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font: 700 12px var(--display); letter-spacing: .02em;
}
.avatar--pro { background: var(--hot); color: var(--on-hot); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--hot-soft); }
.search__box {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 8px 0 18px; border-radius: var(--r-pill);
  background: var(--glass-strong); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur), border-color var(--dur);
}
.search__box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-md), var(--focus); }
.search__box .i { color: var(--text-3); }
.search__box input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: var(--fs-md); height: 100%; }
.search__box input::placeholder { color: var(--text-3); }
.search__results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  list-style: none; padding: 6px; border-radius: var(--r-lg);
  background: var(--glass-strong); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  max-height: 340px; overflow-y: auto;
}
.search__results li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-md); cursor: pointer;
}
.search__results li:hover, .search__results li[aria-selected="true"] { background: var(--accent-soft); }
.search__results .i { color: var(--accent); }
.search__results b { display: block; font-size: var(--fs-sm); font-weight: 600; }
.search__results small { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.search__empty { padding: 12px 14px; font-size: var(--fs-sm); color: var(--text-3); }

.basemaps { box-shadow: var(--shadow-md);
            background: var(--glass-strong); backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px); }
.basemaps button { height: 38px; padding: 0 14px; }

/* ── durum hapı ── */
.statusbar {
  position: fixed; z-index: 15; bottom: var(--gap);
  left: calc(var(--panel-w) + 2 * var(--gap));
  display: flex; align-items: center; gap: 14px;
  height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--glass-strong); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums;
  transition: left .32s var(--ease);
}
body.panel-collapsed .statusbar { left: var(--gap); }
.statusbar .sep { width: 1px; height: 14px; background: var(--line-2); }
.statusbar .cover { color: var(--accent-text); font-weight: 700; }

/* ── orta genişlik ── */
@media (max-width: 1400px) {
  .nav__links { display: none; }
  .nav__menu { display: inline-flex; }
}
@media (max-width: 1180px) {
  :root { --panel-w: 360px; }
  .basemaps button { padding: 0 11px; }
  .nav__drone span, .nav__name { display: none; }
  .nav__drone { width: 36px; padding: 0; justify-content: center; }
}

/* ── mobil: alt sayfa ── */
@media (max-width: 820px) {
  :root { --gap: 10px; }
  .panel {
    top: auto; left: var(--gap); right: var(--gap); bottom: var(--gap);
    width: auto; max-height: 62vh; border-radius: var(--r-xl);
  }
  .panel.is-collapsed { transform: translateY(calc(100% + var(--gap) + 8px)); }
  #collapseBtn svg { transform: rotate(-90deg); }          /* alt sayfada "aşağı katla" */
  .panel-open { top: auto; bottom: var(--gap); left: 50%; transform: translateX(-50%); }
  .topbar, body.panel-collapsed .topbar { left: var(--gap); grid-template-columns: 1fr auto; grid-template-areas: "search nav" "base base"; }
  .basemaps { justify-self: stretch; overflow-x: auto; max-width: 100%; }
  .nav { height: 48px; }
  .nav__login span { display: none; }
  .nav__login { width: 36px; padding: 0; justify-content: center; }
  .nav [data-nav="print"] { display: none; }
  .statusbar { display: none; }
  .toasts { bottom: calc(62vh + 2 * var(--gap)); }
}
