/* ── SECTION ── */
.si-section {
  padding: 1.5rem 0 3rem;
}

/* ── LAYOUT ── */
.si-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eee;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  height: 640px;
}

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
.si-sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #eee;
  overflow: hidden;
  min-height: 0;
}

/* HEADER */
.si-sidebar-header {
  padding: 16px 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

.si-eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.si-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

/* SEARCH */
.si-search-wrap {
  position: relative;
  padding: 10px 12px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

.si-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.si-search-icon svg {
  width: 14px;
  height: 14px;
  fill: #aaa;
}

.si-search-input {
  width: 100%;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 6px 12px 6px 32px;
  font-size: 12px;
  background: #f8f9fb;
  color: #333;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.si-search-input:focus {
  border-color: var(--primary-color);
  background: #fff;
}

/* LAYER LIST */
.si-layer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.si-layer-list::-webkit-scrollbar       { width: 4px; }
.si-layer-list::-webkit-scrollbar-track { background: transparent; }
.si-layer-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* LAYER ITEM */
.si-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.si-layer-item:hover {
  background: #f4f6f9;
}

.si-layer-item.active {
  background: var(--background-color);
}

.si-layer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ccc;
  border: 1.5px solid #bbb;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.si-layer-item.active .si-layer-dot {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.si-layer-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.si-layer-name {
  font-size: 12px;
  color: #444;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  transition: color 0.1s;
}

.si-layer-item.active .si-layer-name {
  color: var(--primary-color);
  font-weight: 600;
}

/* INFO BUTTON */
.si-layer-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
  padding: 0;
}

.si-layer-item:hover .si-layer-info-btn {
  opacity: 1;
}

.si-layer-info-btn svg {
  width: 14px;
  height: 14px;
  fill: var(--primary-color);
}

.si-layer-info-btn:hover {
  background: rgba(24, 95, 165, 0.1);
}

/* NO RESULTS */
.si-no-results {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  padding: 1.5rem 1rem;
}

/* PLAYBACK FOOTER */
.si-playback {
  padding: 12px 14px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.si-playback-time {
  font-size: 11px;
  font-family: monospace;
  color: #666;
  letter-spacing: 0.04em;
}

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

/* custom toggle checkbox */
.si-auto-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.si-auto-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.si-auto-toggle-track {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: #ddd;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.2s;
}

.si-auto-toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.si-auto-label input:checked ~ .si-auto-toggle-track {
  background: var(--primary-color);
}

.si-auto-label input:checked ~ .si-auto-toggle-track .si-auto-toggle-thumb {
  transform: translateX(14px);
}

.si-auto-text {
  font-size: 12px;
  color: #555;
  font-weight: 500;
}

/* ANIMATION BUTTON */
.si-anim-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.si-anim-btn:hover { opacity: 0.85; }

.si-anim-btn svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

/* ══════════════════════════════
   MAP
══════════════════════════════ */
.si-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.si-map {
  height: 100%;
  width: 100%;
}

/* LEGEND */
.si-legend {
  position: absolute;
  bottom: 28px;
  right: 10px;
  z-index: 500;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 180px;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.si-legend-title {
  font-size: 10px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.si-legend-layer-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.si-legend-img img {
  width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

/* Leaflet timedimension bar overrides */
.leaflet-bar-timecontrol {
  padding: 0 10px 0 6px;
  border-radius: 20px;
  display: flex;
}

.leaflet-bar-timecontrol .leaflet-control-timecontrol { border: none; }

.leaflet-bar-timecontrol .leaflet-control-timecontrol:last-child,
.leaflet-bar-timecontrol .leaflet-control-timecontrol:first-child {
  border-radius: 16px;
}

a.leaflet-control-timecontrol { border-radius: 10px !important; }

.timecontrol-slider .slider {
  border-radius: 10px;
  height: 10px;
}

.timecontrol-slider .knob {
  border-radius: 10px;
  height: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .si-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 768px) {
  .si-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 320px 1fr;
    height: auto;
  }

  .si-sidebar {
    border-right: none;
    border-bottom: 1px solid #eee;
    max-height: 320px;
  }

  .si-map-wrap { min-height: 400px; }

  .si-legend {
    bottom: 70px;
    right: 8px;
    padding: 8px 10px;
    min-width: 140px;
  }

  .timecontrol-dateslider { display: none; }
}

@media (max-width: 480px) {
  .si-section { padding: 1rem 0 2rem; }
  .si-layout  { grid-template-rows: 260px 1fr; }
  .si-sidebar { max-height: 260px; }
  .si-map-wrap { min-height: 320px; }
}

/* Animation modal */
.modal-animation { box-shadow: rgba(67,71,85,0.27) 0 0 0.25em, rgba(90,125,188,0.05) 0 0.25em 1em; }
.animate-image-wrapper { display: flex; flex-direction: column; }
.animate-image-container { position: relative; height: 400px; background-color: rgba(78,142,203,0.1); }
.anim-canvas { width: 100%; height: 100%; cursor: grab; }
.anim-controls { width: 100%; margin: 40px 20px 20px; display: flex; align-items: center; justify-content: center; }
.anim-play-pause { height: 30px; width: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 2px 0 black; border-radius: 40px; }
.anim-icon { height: 18px; width: 18px; display: flex; align-items: center; justify-content: center; }
.icon-play, .icon-pause { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }
.anim-icon svg { height: 100%; width: 100%; fill: #d49500; }
.anim-icon .icon-pause { display: none; }
.anim-progress-line { width: 500px; margin-left: 20px; position: relative; }
.anim-slider { border-radius: 8px; height: 8px; }
.ui-slider { cursor: pointer; }
.ui-slider .ui-slider-handle { border-radius: 50%; height: 20px; width: 20px; top: -8px; cursor: pointer; }
.ui-slider-tooltip { position: absolute; background-color: #d49500; height: 24px; max-width: 150px; min-width: 40px; top: -32px; left: -12px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 13px; color: #fff; }
.ui-slider-tooltip-val { width: max-content; }
.ui-slider-tooltip::before { top: 100%; left: 20px; content: ''; height: 0; width: 0; position: absolute; border: 6px solid transparent; border-top-color: #d49500; margin-left: -0.5em; }

.leaflet-top{
  z-index:1
}