* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #090d16;
  color: #f8fafc;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#map {
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #0b0f19;
}

/* Плавная кнопка открытия меню */
.panel-toggle {
  position: fixed;
  top: 16px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, border-color 0.25s ease;
}

.panel-toggle:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-2px);
}

.panel-toggle:active {
  transform: translateY(0) scale(0.97);
}

.left-toggle {
  left: 56px;
}

/* Боковые панели с эффектом матового стекла */
.side-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1001;
  background: rgba(13, 19, 33, 0.88);
  border-color: rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.left-panel {
  left: 0;
  width: 350px;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  transform: translateX(-104%);
  opacity: 0.6;
}

.left-panel.open {
  transform: translateX(0);
  opacity: 1;
}

.right-panel {
  right: 0;
  width: 375px;
  border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.panel-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  transform: rotate(90deg);
}

.panel-content {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

/* Кастомный тонкий скроллбар */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

.legend-section {
  margin-bottom: 24px;
}

.legend-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.legend-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.4);
  transition: background 0.2s ease, transform 0.2s ease;
}

.legend-item:hover {
  background: rgba(30, 41, 59, 0.75);
  transform: translateX(3px);
}

.legend-item p {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 3px;
}

.color-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 3px;
}

.color-box.blue {
  background: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
}

.color-box.red {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.color-box.amber {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.icon-badge {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.checkbox-row:hover {
  background: rgba(148, 163, 184, 0.08);
}

.checkbox-row input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.update-badge {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
}

.filters-bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.filter-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(30, 41, 59, 0.55);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: #334155;
  color: #fff;
  border-color: #64748b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.blue-text { color: #60a5fa; }
.red-text { color: #f87171; }

.news-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Анимация плавного появления карточек */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.news-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  animation: cardSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.news-card:hover {
  background: rgba(38, 51, 73, 0.92);
  border-color: rgba(148, 163, 184, 0.28);
  transform: translateX(-4px) translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.news-card.active-card {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(148, 163, 184, 0.45);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #f8fafc;
}

.card-summary {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
}

.loading-msg {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 28px 16px;
}

/* Анимация маркеров на карте */
.event-marker-body {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  font-size: 14px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-marker-body:hover {
  transform: scale(1.25);
}

/* Тёмный стиль для всплывающих окон Leaflet */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
  border-radius: 12px !important;
}

.custom-popup strong {
  color: #fff;
  font-size: 14px;
}

.custom-popup p {
  color: #cbd5e1;
}

.custom-popup small {
  color: #94a3b8;
}

@media (max-width: 768px) {
  .right-panel {
    width: 100%;
    height: 44vh;
    top: auto;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px 18px 0 0;
  }
  .left-panel {
    width: 85vw;
  }
}
