/* ══════════════════════════════════════════════
   GeoSlice — tünd cihaz paneli
   Açıq xəritə · tünd idarə səthi · kəhrəba aksent
══════════════════════════════════════════════ */
:root {
  /* Səthlər */
  --map-bg:   #F3F1ED;
  --chrome:   #17191D;
  --chrome-2: #1F2228;
  --chrome-3: #282C34;

  /* Mətn */
  --w-1: #F4F5F7;
  --w-2: #A8AEB9;
  --w-3: #6E757F;

  /* Aksent */
  --acc:      #F0B429;
  --acc-soft: rgba(240,180,41,0.14);
  --acc-line: rgba(240,180,41,0.30);

  --hair: rgba(255,255,255,0.075);

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --hdr: 56px;
  --r:   11px;
  --r-lg:18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--map-bg);
  color: var(--w-1);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════
   BAŞLIQ
══════════════════════════════════════════════ */
.hdr {
  position: fixed; inset: 0 0 auto 0;
  height: var(--hdr);
  display: flex; align-items: center; gap: 24px;
  padding: 0 18px;
  background: rgba(23,25,29,0.94);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(0,0,0,.3);
  z-index: 700;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-logo {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #FFFFFF;
  padding: 3px;
  flex-shrink: 0;
  transition: transform .16s ease;
}
.brand-logo:hover { transform: scale(1.05); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.14);
  flex-shrink: 0;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--w-1);
  white-space: nowrap;
}

/* Məlumat düyməsi */
.info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--acc-line);
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .16s, border-color .16s, transform .16s;
}
.info-btn:hover {
  background: rgba(240,180,41,.22);
  border-color: rgba(240,180,41,.5);
  transform: translateY(-1px);
}

.readout {
  display: flex; align-items: center; gap: 20px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
}
.rd { display: inline-flex; align-items: baseline; gap: 6px; }
.rd em { font-style: normal; color: var(--w-3); font-size: 12px; }
.rd b  { font-weight: 500; color: var(--w-2); min-width: 68px; letter-spacing: -0.03em; }

.tools { display: flex; gap: 3px; flex-shrink: 0; }
.tool {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--w-2);
  cursor: pointer;
  transition: all .16s ease;
}
.tool:hover { background: var(--chrome-2); color: var(--w-1); }
.tool.on {
  background: var(--acc-soft);
  border-color: var(--acc-line);
  color: var(--acc);
}


/* ══════════════════════════════════════════════
   DİL SEÇİMİ
══════════════════════════════════════════════ */
.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--chrome-2);
  border-radius: 9px;
  flex-shrink: 0;
}
.lang-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--w-3);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .15s ease;
}
.lang-btn:hover:not(.on) { color: var(--w-2); }
.lang-btn.on {
  background: var(--acc-soft);
  color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--acc-line);
}

/* ══════════════════════════════════════════════
   XƏRİTƏ
══════════════════════════════════════════════ */
#viewDiv {
  position: fixed;
  inset: var(--hdr) 0 0 0;
  background: var(--map-bg);
}

.esri-view .esri-ui-corner .esri-component {
  box-shadow: 0 2px 10px rgba(0,0,0,.18) !important;
}
.esri-widget--button {
  background: rgba(23,25,29,.92) !important;
  color: var(--w-2) !important;
  border: none !important;
  width: 34px !important; height: 34px !important;
  backdrop-filter: blur(12px);
}
.esri-widget--button:hover { color: var(--acc) !important; background: rgba(31,34,40,.96) !important; }
.esri-zoom { border-radius: var(--r) !important; overflow: hidden; }
.esri-attribution {
  background: rgba(23,25,29,.82) !important;
  color: var(--w-3) !important;
  font-family: var(--sans) !important;
  font-size: 10px !important;
  backdrop-filter: blur(10px);
}
.esri-attribution a { color: var(--w-2) !important; }

/* Swipe */
.esri-swipe__container { border: none !important; }
.esri-swipe__divider {
  width: 2px !important;
  background: var(--acc) !important;
  opacity: .9;
  box-shadow: 0 0 12px rgba(240,180,41,.5);
}
.esri-swipe__handle {
  width: 40px !important; height: 40px !important;
  border-radius: 999px !important;
  background: var(--chrome) !important;
  border: none !important;
  color: var(--acc) !important;
  box-shadow:
    0 0 0 1.5px var(--acc-line),
    0 4px 18px rgba(0,0,0,.3) !important;
  transition: transform .2s cubic-bezier(.34,1.4,.64,1);
}
.esri-swipe__handle:hover { transform: scale(1.1); }

/* ══════════════════════════════════════════════
   PANEL
══════════════════════════════════════════════ */
.panel {
  position: fixed;
  top: calc(var(--hdr) + 16px);
  right: 16px;
  width: 340px;
  max-height: calc(100vh - var(--hdr) - 32px);
  display: flex; flex-direction: column;
  background: rgba(23,25,29,0.93);
  backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-lg);
  box-shadow:
    0 1px 2px rgba(0,0,0,.2),
    0 18px 50px -10px rgba(0,0,0,.4);
  z-index: 600;
  overflow: hidden;
  transition: transform .26s cubic-bezier(.4,0,.2,1), opacity .26s;
}
.panel.hide {
  transform: translateX(12px) scale(.98);
  opacity: 0;
  pointer-events: none;
}

.p-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
}
.p-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--w-2);
}
.p-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px rgba(240,180,41,.6);
}
.p-x {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 7px;
  background: transparent;
  color: var(--w-3);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.p-x:hover { background: var(--chrome-2); color: var(--w-1); }

.p-body { overflow-y: auto; padding: 4px 0; }

/* ── Qrup ── */
.grp { padding: 16px 18px 15px; }
.grp + .grp { border-top: 1px solid var(--hair); }

.grp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.grp-id { min-width: 0; }
.grp-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--w-1);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grp-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-3);
  margin-top: 3px;
  letter-spacing: .01em;
}
.grp.off .grp-name, .grp.off .grp-meta { opacity: .4; }

.grp-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--w-3);
  margin-bottom: 11px;
}

/* ── Keçid açarı ── */
.sw {
  width: 42px; height: 24px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--chrome-3);
  position: relative;
  cursor: pointer;
  transition: background .2s ease;
}
.sw::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--w-3);
  transition: transform .2s cubic-bezier(.4,0,.2,1), background .2s;
}
.sw.on { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc-line); }
.sw.on::after { transform: translateX(18px); background: var(--acc); }

/* ── Seçimlər ── */
.opts { display: flex; flex-direction: column; gap: 3px; }

.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: background .16s, border-color .16s;
}
.opt:hover { background: rgba(255,255,255,.045); }
.opt.on {
  background: var(--acc-soft);
  border-color: var(--acc-line);
}

.opt-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--chrome-3);
  transition: background .18s, box-shadow .18s;
}
.opt.on .opt-dot {
  background: var(--acc);
  box-shadow: 0 0 0 4px var(--acc-soft), 0 0 10px rgba(240,180,41,.4);
}

.opt-name {
  flex: 1;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--w-2);
  letter-spacing: -0.01em;
  transition: color .16s;
}
.opt.on .opt-name { color: var(--w-1); font-weight: 500; }

.opt-abbr {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--w-3);
  padding: 3.5px 8px;
  border-radius: 6px;
  background: var(--chrome-2);
  flex-shrink: 0;
  transition: all .16s;
}
.opt.on .opt-abbr { color: var(--acc); background: var(--acc-soft); }

.grp.off .opts { opacity: .35; pointer-events: none; }

/* ── Altlıq çipləri ── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 8px 14px;
  border: 1px solid var(--chrome-3);
  border-radius: 999px;
  background: transparent;
  color: var(--w-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s;
}
.chip:hover { border-color: var(--w-3); color: var(--w-1); }
.chip.on {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--chrome);
  font-weight: 600;
}

/* ── Skrollbar ── */
.p-body::-webkit-scrollbar { width: 5px; }
.p-body::-webkit-scrollbar-track { background: transparent; }
.p-body::-webkit-scrollbar-thumb {
  background: var(--chrome-3);
  border-radius: 3px;
}

/* ══════════════════════════════════════════════
   YÜKLƏNMƏ
══════════════════════════════════════════════ */
.load {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(23,25,29,.96);
  backdrop-filter: blur(14px);
  z-index: 900;
  transition: opacity .35s ease;
}
.load.hide { opacity: 0; pointer-events: none; }

.load-in { text-align: center; }
.load-spin {
  color: var(--acc);
  display: inline-block;
  margin-bottom: 15px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.load-t {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--w-1);
  margin-bottom: 4px;
}
.load-s {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--w-3);
}

.load.err .load-spin { animation: none; color: #E5674B; }
.err-box {
  max-width: 540px;
  margin-top: 16px;
  padding: 15px 17px;
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--w-2);
  background: var(--chrome-2);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

/* ══════════════════════════════════════════════
   KİÇİK EKRAN
══════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .brand-text { display: none; }
  .brand-sep  { display: none; }
}

@media (max-width: 820px) {
  .readout { display: none; }
  .lang-btn { padding: 5px 8px; font-size: 10px; }
  .panel {
    right: 12px; left: 12px;
    width: auto;
    top: calc(var(--hdr) + 12px);
  }
}
