/* ========================================================
   Kharkiv Map — Clean tactical UI
   ======================================================== */

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: #1a1a1e;
  color: #e0e0e0;
  overflow: hidden;
}

/* ── MAP ─────────────────────────────────────────────── */
#map {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
#sidebar {
  position: absolute;
  top: 0; right: 0;
  width: 280px;
  height: 100%;
  background: #1e1e24;
  border-left: 1px solid #333;
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #1e1e24; }
#sidebar::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* ── PANEL ───────────────────────────────────────────── */
.panel {
  border-bottom: 1px solid #2e2e38;
  padding: 12px 14px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ccc;
  margin-bottom: 10px;
}

.divider {
  height: 1px;
  background: #2e2e38;
  margin: 10px 0;
}

.section-sub {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* ── ALARM ROWS ──────────────────────────────────────── */
.alarm-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}

.alarm-label {
  font-size: 12px;
  color: #ddd;
  flex: 1;
}

.alarm-label.city-label {
  font-weight: 500;
  color: #fff;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #3a3a44;
  border-radius: 20px;
  border: 1px solid #555;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 2px;
  width: 14px; height: 14px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: #6b1111;
  border-color: #a02020;
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #ef5555;
}

/* ── FORMS ───────────────────────────────────────────── */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.form-row label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row input,
.form-row select {
  background: #2a2a32;
  border: 1px solid #3a3a48;
  border-radius: 4px;
  color: #e0e0e0;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #5577cc;
}

.form-row select option {
  background: #2a2a32;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

button, .btn-secondary {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #3a3a48;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  color: #ddd;
  background: #2a2a32;
  white-space: nowrap;
}

button:hover {
  border-color: #5577cc;
  background: #2f2f3e;
}

.btn-primary {
  background: #233060;
  border-color: #3a55aa;
  color: #cce;
}
.btn-primary:hover {
  background: #2d3f80;
  border-color: #5577cc;
  color: #fff;
}

.btn-success {
  background: #1a3a22;
  border-color: #2e7a3f;
  color: #9de8a8;
}
.btn-success:hover {
  background: #234d2e;
  border-color: #44aa5f;
}

.btn-danger {
  background: #3a1818;
  border-color: #7a2222;
  color: #e88;
}
.btn-danger:hover {
  background: #4f2020;
  border-color: #aa3333;
}

.btn-warning {
  background: #3e2d10;
  border-color: #7c5a2e;
  color: #ffd899;
}
.btn-warning:hover {
  background: #543d15;
  border-color: #aa7a3f;
}

.full-width { width: 100%; text-align: center; }

/* ── DRAW HINT ───────────────────────────────────────── */
.draw-hint {
  font-size: 11px;
  color: #f0b040;
  background: #2a2410;
  border: 1px solid #4a3a10;
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 6px;
  line-height: 1.5;
}

/* ── PLAYBACK CONTROLS ───────────────────────────────── */
.playback-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.playback-controls button {
  flex: 1;
  text-align: center;
}

.sim-status {
  font-size: 11px;
  color: #888;
  border: 1px solid #2e2e38;
  border-radius: 4px;
  padding: 5px 8px;
  margin-top: 6px;
  text-align: center;
}
.sim-status.playing { color: #7ecf7e; border-color: #2a5a2a; background: #121e12; }
.sim-status.paused  { color: #e0c060; border-color: #4a3e10; background: #1e1a0a; }

/* ── TARGET & CONFIG LISTS ───────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid #2e2e38;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #24242c;
  cursor: default;
}

.list-item:hover {
  border-color: #444;
}

.list-item-name {
  flex: 1;
  font-size: 12px;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-type {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-item-btn {
  padding: 2px 6px;
  font-size: 10px;
  background: #1e1e26;
  border: 1px solid #3a3a48;
  border-radius: 3px;
  cursor: pointer;
  color: #aaa;
}
.list-item-btn:hover { background: #2a2a38; color: #fff; }

.list-item-btn.remove {
  color: #c06060;
  border-color: #5a2a2a;
}
.list-item-btn.remove:hover {
  background: #3a1818;
  color: #ef5555;
}

/* ── CONFIG LIST ─────────────────────────────────────── */
.config-item {
  padding: 6px 8px;
  border: 1px solid #2e2e38;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #24242c;
  cursor: pointer;
}
.config-item:hover { border-color: #4455aa; }
.config-item-title {
  font-size: 12px;
  font-weight: 500;
  color: #ddd;
}
.config-item-date {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}
.config-item-actions {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

/* ── SIDEBAR TOGGLE BUTTON ───────────────────────────── */
#sidebar-toggle {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: #1e1e24;
  border: 1px solid #444;
  color: #ccc;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}

/* ── ALARM OVERLAYS ──────────────────────────────────── */
.alarm-overlay-oblast {
  fill: rgba(200, 30, 30, 0.18);
  stroke: #cc2222;
  stroke-width: 1;
}

.alarm-overlay-city {
  fill: rgba(220, 60, 30, 0.2);
  stroke: #dd4422;
  stroke-width: 1.5;
}

.alarm-overlay-rayon {
  fill: rgba(200, 30, 30, 0.15);
  stroke: #aa2020;
  stroke-width: 0.8;
}

/* ── LEAFLET OVERRIDES ───────────────────────────────── */
.custom-target-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.leaflet-control-zoom a {
  background: #1e1e24 !important;
  color: #ccc !important;
  border-color: #333 !important;
}
.leaflet-control-zoom a:hover {
  background: #2a2a32 !important;
  color: #fff !important;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 640px) {
  #sidebar {
    width: 100%;
    height: auto;
    bottom: 0;
    top: auto;
    max-height: 55%;
    border-left: none;
    border-top: 1px solid #333;
    display: none;
  }
  #sidebar.open { display: flex; }
  #sidebar-toggle { display: block; }
}
