/* Основные стили карты */
#map {
  height: 100vh;
  width: 100%;
  font-family: "Roboto", sans-serif;
}

/* Стили для маркеров */
.leaflet-marker-icon {
  background-color: transparent;
  border: none;
  width: 26px !important;
  height: 26px !important;
}

/* Тени для разных типов маркеров */
.custom-icon-стоят {
  filter: drop-shadow(0 0 2px rgba(255, 0, 0, 0.7));
}

.custom-icon-чисто {
  filter: drop-shadow(0 0 2px rgba(0, 255, 0, 0.7));
}

.custom-icon-рейд {
  filter: drop-shadow(0 0 2px rgba(0, 0, 255, 0.7));
}

.custom-icon-приставы {
  filter: drop-shadow(0 0 2px rgba(255, 165, 0, 0.7));
}

/* Стили для панели информации (1/3 экрана) */
#marker-info-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45vh;
  background: white;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #ddd;
  font-size: 1.1em;
  border-radius: 10px 10px 0 0; /* Уменьшено с 25px до 12px */
  overflow: hidden;
}

#marker-info-panel.visible {
  transform: translateY(0);
}

/* Заголовок панели с центрированным текстом */
.panel-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: #4a6278;
  color: white;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  font-size: 1.21em !important;
  border-bottom: 1px solid #34495e;
  min-height: 32px; /* Уменьшено на 20% с 40px до 32px */
  position: relative;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0; /* Убираем отступ снизу */
}

/* Кнопка закрытия с абсолютным позиционированием */
.close-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.43em; /* Увеличен на 10% */
  cursor: pointer;
  padding: 0 10px;
  color: white;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 0.8;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0; /* Убираем padding сверху и снизу */
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.panel-content::-webkit-scrollbar {
  width: 6.6px; /* Увеличен на 10% */
}

.panel-content::-webkit-scrollbar-thumb {
  background-color: #ddd;
  border-radius: 3.3px; /* Увеличен на 10% */
}

/* Стили для блока статистики маркера */
#panel-event-info {
  margin-bottom: 0; /* Убираем отступ */
  font-size: 0.935em; /* Увеличен на 10% */
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  align-items: baseline; /* Выравниваем по базовой линии текста */
  flex-wrap: nowrap;
  gap: 12px;
}

.stats-item {
  display: flex;
  align-items: baseline; /* Выравниваем по базовой линии */
  gap: 4px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2; /* Фиксируем высоту строки */
}

.stats-confirm {
  color: #e74c3c;
  line-height: 1.2;
}

.stats-reject {
  color: #27ae60;
  line-height: 1.2;
}

.stats-time {
  color: #7f8c8d;
  font-size: 0.935em;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2; /* Такая же высота строки */
  vertical-align: baseline; /* Выравниваем по базовой линии */
}

/* Адаптивность для статистики - всегда в одну строку */
@media (max-width: 768px) {
  .stats-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline; /* Выравниваем по базовой линии */
    flex-wrap: nowrap;
    gap: 8px;
  }

  .stats-item {
    flex: 1;
    justify-content: center;
    min-width: 0;
    align-items: baseline; /* Выравниваем по базовой линии */
  }

  .stats-confirm,
  .stats-reject {
    font-size: 0.9em;
    line-height: 1.2;
  }

  .stats-time {
    font-size: 0.9em;
    line-height: 1.2;
  }
}

/* Для очень маленьких экранов можно немного уменьшить отступы */
@media (max-width: 480px) {
  .stats-container {
    gap: 6px;
  }

  #panel-event-info {
    padding: 6px 10px;
  }

  .stats-confirm,
  .stats-reject {
    font-size: 0.85em;
    line-height: 1.2;
  }

  .stats-time {
    font-size: 0.85em;
    line-height: 1.2;
  }
}

/* Для экстремально маленьких ширины - упрощаем отображение */
@media (max-width: 360px) {
  .stats-container {
    gap: 4px;
  }

  .stats-time {
    display: none;
  }
}

/* Убираем разделительные линии */
.history-title {
  display: none; /* Скрываем разделительные линии */
}

/* Стили для истории сообщений */
#panel-history {
  margin-top: 0;
  padding-top: 8px; /* Добавляем небольшой отступ сверху */
}

.history-item {
  margin-bottom: 8.8px;
  line-height: 1.65;
  font-size: 0.88em;
  font-family: "Roboto", sans-serif;
  padding: 8.8px 13.2px;
  border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.history-message {
  margin-bottom: 2px;
  line-height: 1.4;
}

.history-time {
  font-size: 0.88em;
  color: #777;
  font-family: "Roboto Condensed", sans-serif;
  margin-left: 0;
  margin-top: 2px;
  line-height: 1.2;
}

/* Стили для тусклых маркеров */
.leaflet-marker-icon.faded {
  opacity: 0.5;
  transition: opacity 0.3s;
}

.faded-marker {
  filter: opacity(0.5) drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
  transition: opacity 0.3s ease;
}

/* Стили для контрола обновления */
.refresh-control {
  background: white;
  padding: 5.5px; /* Увеличен на 10% */
  border-radius: 4.4px; /* Увеличен на 10% */
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.refresh-control button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 17.6px; /* Увеличен на 10% */
  color: #333;
  transition: transform 0.2s;
}

.refresh-control button:hover {
  transform: rotate(33deg); /* Увеличен на 10% */
}

/* Анимации */
@keyframes slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Стили для уведомлений */
.notification {
  position: fixed;
  bottom: 22px; /* Увеличен на 10% */
  right: 22px; /* Увеличен на 10% */
  padding: 13.2px 26.4px; /* Увеличен на 10% */
  border-radius: 4.4px; /* Увеличен на 10% */
  color: white;
  font-family: "Roboto", sans-serif;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: slide-in 0.5s ease-out;
}

.notification.success {
  background-color: #4caf50;
}

.notification.error {
  background-color: #f44336;
}

.notification.fade-out {
  animation: fade-out 0.5s ease-out;
}

/* Подключение шрифтов */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600&family=Roboto:wght@400;500&family=Roboto+Condensed:wght@400&display=swap");

/* Стили для кнопки сводки ДПС */
.summary-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(52, 152, 219, 0.8);
  border-radius: 25px;
  padding: 20px 0;
  text-align: center;
  font-weight: bold;
  font-size: 18px;
  color: #2c3e50;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  margin: 0;
  height: auto;
  min-height: 69px; /* Увеличено на 15% с 60px до 69px */
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.summary-button:hover {
  background: rgba(255, 255, 255, 0.5); /* Чуть более видимая при наведении */
  border: 2px solid rgba(52, 152, 219, 1); /* Полностью непрозрачная рамка при наведении */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Адаптивность для кнопки */
@media (max-width: 768px) {
  .summary-button {
    left: 15px;
    right: 15px;
    width: calc(100% - 30px);
    font-size: 16px;
    padding: 18px 0;
    min-height: 64.4px; /* Увеличено на 15% с 56px до 64.4px */
  }
}

@media (max-width: 480px) {
  .summary-button {
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    font-size: 15px;
    padding: 16px 0;
    min-height: 59.8px; /* Увеличено на 15% с 52px до 59.8px */
  }
}

/* Модальное окно сводки */
.summary-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75vh;
  background: white;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #ddd;
  border-radius: 10px 10px 0 0; /* Добавлено закругление 10px */
  overflow: hidden; /* Чтобы содержимое не выходило за закругленные границы */
}

.summary-modal.active {
  transform: translateY(0);
}

.summary-header {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-close-btn {
  position: absolute;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.summary-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.summary-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.summary-tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.summary-tab.active {
  background: white;
  border-bottom: 3px solid #3498db;
  color: #3498db;
}

.summary-tab:hover {
  background: #e9ecef;
}

.summary-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.summary-messages {
  padding: 15px;
}

.summary-message {
  padding: 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #3498db;
  animation: fadeIn 0.3s ease;
}

.summary-message.standing {
  border-left-color: #e74c3c;
}

.summary-message.clear {
  border-left-color: #27ae60;
}

.summary-message-text {
  font-size: 16px;
  margin-bottom: 5px;
  word-wrap: break-word;
}

.summary-message-time {
  font-size: 14px;
  color: #7f8c8d;
  font-weight: 500;
}

.summary-empty {
  text-align: center;
  padding: 40px 20px;
  color: #7f8c8d;
  font-size: 16px;
}

/* Оверлей */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.modal-overlay.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .summary-modal {
    height: 80vh; /* Чуть больше на мобильных */
  }

  .summary-tab {
    padding: 12px 8px;
    font-size: 14px;
  }

  .summary-header {
    padding: 11px;
    font-size: 1.1em !important;
  }
}

@media (max-width: 480px) {
  .summary-modal {
    height: 85vh; /* Еще больше на маленьких экранах */
    border-radius: 15px 15px 0 0;
  }

  .summary-header {
    font-size: 1.045em !important;
  }

  .summary-tab {
    padding: 10px 6px;
    font-size: 12px;
  }
}

/* ===== СТИЛИ ДЛЯ СКРЫТИЯ АТРИБУЦИИ КАРТЫ ===== */
.leaflet-control-attribution {
  display: none;
}

/* Альтернативный вариант - если нужно полностью скрыть */
/* .leaflet-control-attribution {
    display: none;
} */
