/* Aerial Time Machine — orbital dark theme */
.atm-container {
  --atm-bg: #0a0f1a;
  --atm-panel: #121a2b;
  --atm-panel-2: #0f1626;
  --atm-line: #24304a;
  --atm-text: #e8eef7;
  --atm-muted: #93a3bd;
  --atm-accent: #4ea3ff;
  --atm-truecolor: #4ea3ff;
  --atm-ndvi: #5ad17a;
  --atm-ndwi: #37c8d6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--atm-text);
}

.atm-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 .4rem;
  letter-spacing: -0.02em;
}
.atm-header p { color: var(--atm-muted); max-width: 68ch; margin: 0 0 1.2rem; }

/* ---- map ---- */
.atm-map-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--atm-line);
  background: #05080f;
}
#atm-map {
  height: min(72vh, 720px);
  min-height: 420px;
  background: #05080f;
}
.leaflet-container { background: #05080f; font-family: inherit; }

.atm-overlay {
  position: absolute;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.atm-overlay > * { pointer-events: auto; }
.atm-overlay-topleft { top: .8rem; left: .8rem; max-width: min(320px, 60vw); }
.atm-overlay-topright { top: .8rem; right: .8rem; align-items: flex-end; }
.atm-overlay-bottomleft { bottom: .8rem; left: .8rem; max-width: min(420px, 70vw); }

.atm-search-form { display: flex; gap: .4rem; }
.atm-search-form input {
  flex: 1;
  background: rgba(18,26,43,.92);
  border: 1px solid var(--atm-line);
  border-radius: 8px;
  padding: .55rem .8rem;
  color: var(--atm-text);
  font-size: .92rem;
  backdrop-filter: blur(4px);
}
.atm-search-form input:focus { outline: none; border-color: var(--atm-accent); }
.atm-search-form button {
  background: var(--atm-accent);
  color: #061223;
  border: none;
  border-radius: 8px;
  padding: .55rem .9rem;
  font-weight: 700;
  cursor: pointer;
}
.atm-search-status {
  margin: 0;
  font-size: .8rem;
  color: var(--atm-muted);
  background: rgba(18,26,43,.92);
  border-radius: 8px;
  padding: .4rem .6rem;
  backdrop-filter: blur(4px);
}

.atm-mode-switch {
  display: flex;
  background: rgba(18,26,43,.92);
  border: 1px solid var(--atm-line);
  border-radius: 999px;
  padding: .2rem;
  backdrop-filter: blur(4px);
}
.atm-mode-btn {
  background: none;
  border: none;
  color: var(--atm-muted);
  font-size: .82rem;
  font-weight: 600;
  padding: .4rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.atm-mode-btn.is-active { background: rgba(78,163,255,.18); color: var(--atm-truecolor); }
.atm-mode-btn[data-mode="ndvi"].is-active { background: rgba(90,209,122,.18); color: var(--atm-ndvi); }
.atm-mode-btn[data-mode="ndwi"].is-active { background: rgba(55,200,214,.18); color: var(--atm-ndwi); }

.atm-sat-select {
  font-size: .78rem;
  color: var(--atm-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(18,26,43,.92);
  border: 1px solid var(--atm-line);
  border-radius: 8px;
  padding: .3rem .6rem;
  backdrop-filter: blur(4px);
}
.atm-sat-select select {
  background: var(--atm-panel-2);
  color: var(--atm-text);
  border: 1px solid var(--atm-line);
  border-radius: 6px;
  padding: .2rem .4rem;
}

.atm-compare-toggle {
  background: rgba(18,26,43,.92);
  border: 1px solid var(--atm-line);
  color: var(--atm-text);
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .45rem .8rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.atm-compare-toggle[aria-pressed="true"] { border-color: var(--atm-accent); color: var(--atm-accent); }

.atm-status {
  margin: 0;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: var(--atm-text);
  background: rgba(18,26,43,.92);
  border-radius: 8px;
  padding: .5rem .7rem;
  backdrop-filter: blur(4px);
}

/* leaflet-side-by-side (vendored -- see vendor/leaflet-side-by-side.js) */
.leaflet-sbs-range {
  position: absolute;
  top: 50%;
  width: 100%;
  z-index: 999;
  -webkit-appearance: none;
  display: inline-block !important;
  vertical-align: middle;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: rgba(0, 0, 0, .25);
  min-width: 100px;
  cursor: pointer;
  pointer-events: none;
}
.leaflet-sbs-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  width: 4px;
  background-color: var(--atm-accent);
  pointer-events: none;
  z-index: 999;
}
.leaflet-sbs-range::-webkit-slider-thumb,
.leaflet-sbs-range::-ms-thumb,
.leaflet-sbs-range::-moz-range-thumb {
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  background: var(--atm-accent);
  height: 40px;
  width: 40px;
  border-radius: 20px;
  cursor: ew-resize;
  pointer-events: auto;
  border: 2px solid #061223;
}
.leaflet-sbs-range::-moz-range-track,
.leaflet-sbs-range::-ms-track,
.leaflet-sbs-range::-ms-fill-upper { opacity: 0; background: transparent; }
.leaflet-sbs-range::-ms-tooltip { display: none; }
.leaflet-sbs-range:focus { outline: none !important; }
.leaflet-sbs-range::-moz-focus-outer { border: 0; }

/* ---- timeline ---- */
.atm-timeline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  background: var(--atm-panel);
  border: 1px solid var(--atm-line);
  border-radius: 12px;
  padding: .8rem 1rem;
}
.atm-timeline-compare { margin-top: .6rem; }
.atm-timeline-b-label { font-size: .8rem; color: var(--atm-muted); white-space: nowrap; }
.atm-play {
  background: var(--atm-accent);
  color: #061223;
  border: none;
  border-radius: 8px;
  padding: .55rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 82px;
}
.atm-play:disabled { opacity: .5; cursor: default; }
.atm-timeline-range { flex: 1; accent-color: var(--atm-accent); }
.atm-timeline-range:disabled { opacity: .4; }
#atm-date-label, #atm-date-label-b {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 6.5em;
  text-align: right;
}

/* ---- bookmarks ---- */
.atm-section-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--atm-muted);
  margin: 1.6rem 0 .7rem;
}
.atm-bookmark-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .7rem;
}
.atm-chip {
  text-align: left;
  background: var(--atm-panel);
  border: 1px solid var(--atm-line);
  border-radius: 12px;
  padding: .9rem 1rem;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.atm-chip:hover { transform: translateY(-2px); border-color: var(--atm-accent); }
.atm-chip.is-active { border-color: var(--atm-accent); box-shadow: 0 0 0 2px rgba(78,163,255,.25); }
.atm-chip-title { font-weight: 700; }
.atm-chip-region { font-size: .82rem; color: var(--atm-muted); }

/* ---- chat ---- */
.atm-chat { margin: 1.6rem 0; }
.atm-chat-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.atm-chat-form input {
  flex: 1 1 260px;
  background: var(--atm-panel);
  border: 1px solid var(--atm-line);
  border-radius: 10px;
  padding: .8rem 1rem;
  color: var(--atm-text);
  font-size: 1rem;
}
.atm-chat-form input:focus {
  outline: none;
  border-color: var(--atm-accent);
  box-shadow: 0 0 0 3px rgba(78, 163, 255, .2);
}
.atm-chat-form button {
  background: var(--atm-accent);
  color: #061223;
  border: none;
  border-radius: 10px;
  padding: .8rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
}
.atm-chat-form button:disabled { opacity: .55; cursor: default; }
.atm-guide-reply {
  margin: .9rem 0 0;
  padding: .9rem 1.1rem;
  background: var(--atm-panel-2);
  border-left: 3px solid var(--atm-accent);
  border-radius: 6px;
  line-height: 1.55;
}

.atm-attribution {
  margin-top: 2rem;
  font-size: .78rem;
  color: var(--atm-muted);
  border-top: 1px solid var(--atm-line);
  padding-top: 1rem;
}

@media (max-width: 700px) {
  .atm-overlay-topleft, .atm-overlay-topright, .atm-overlay-bottomleft { max-width: calc(100vw - 3rem); }
  .atm-timeline { flex-wrap: wrap; }
}
