/* ===== ПОДКЛЮЧЕНИЕ ШРИФТОВ ===== */
@import url('https://fonts.googleapis.com/css2?family=Philosopher:wght@400;700&display=swap');

/* ===== Calypso — локальный шрифт ===== */
@font-face {
  font-family: 'Calypso';
  src: url('/CHERTOGI_MAP/fonts/Calypso.ttf?v=1') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  background: #0d0d1a;
}

html {
  overflow-y: scroll;
}

body {
  overflow-y: scroll;
}

::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
}

* {
  scrollbar-width: none;
}

/* ================================================================
   БАННЕР (ЕДИНЫЙ ДЛЯ ВСЕХ СТРАНИЦ)
   ================================================================ */
.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: #4a0e0e;
  backdrop-filter: blur(8px);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  padding: 0 80px;
  box-sizing: border-box;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.top-banner .banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.top-banner .banner-left img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
  flex-shrink: 0;
}

.top-banner .title {
  font-family: 'Calypso', serif;
  font-size: 28px;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  letter-spacing: 4px;
  font-weight: normal;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 25px;
  align-items: center;
  flex-shrink: 0;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-family: 'Philosopher', sans-serif;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #ffd700;
}

.nav-links a.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
}

@media (max-width: 768px) {
  .top-banner {
    padding: 0 16px;
  }
  .top-banner .banner-left {
    gap: 8px;
  }
  .top-banner .banner-left img {
    width: 32px;
    height: 32px;
  }
  .top-banner .title {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .nav-links {
    gap: 12px;
  }
  .nav-links a {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .top-banner {
    padding: 0 10px;
  }
  .top-banner .banner-left {
    gap: 6px;
  }
  .top-banner .banner-left img {
    width: 26px;
    height: 26px;
  }
  .top-banner .title {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .nav-links {
    gap: 8px;
  }
  .nav-links a {
    font-size: 10px;
  }
}

/* ================================================================
   КАРТА
   ================================================================ */
#map {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background: #0d0d1a;
}

/* ================================================================
   БОКОВАЯ ПАНЕЛЬ
   ================================================================ */
#region-sidebar {
  display: none;
  position: fixed;
  right: 0;
  top: 70px;
  width: 420px;
  height: calc(100vh - 70px);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  border-left: 2px solid #4a0e0e;
  z-index: 1000;
  padding: 0;
  overflow-y: auto;
  color: #ffffff;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  font-family: 'Philosopher', sans-serif;
}

#region-sidebar.open {
  transform: translateX(0);
}

#region-image-placeholder {
  width: 100%;
  min-height: 150px;
  max-height: 350px;
  height: auto;
  flex-shrink: 0;
  background: #4a0e0e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  font-family: 'Philosopher', sans-serif;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
}

#region-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 350px;
  min-height: 150px;
  background: #4a0e0e;
  display: block;
}

#close-icon-container {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  padding: 0;
  pointer-events: none;
  background: transparent;
  margin: 0;
  height: 0;
  overflow: visible;
}

#close-icon {
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.3s ease;
  opacity: 0.7;
  width: 28px;
  height: 28px;
  margin-top: 12px;
  margin-right: 16px;
}

#close-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.panel-content {
  padding: 20px 40px 40px 40px;
  text-align: left;
}

#sidebar-title {
  color: #ffffff;
  font-size: 21px;
  margin-bottom: 6px;
  font-family: 'Calypso', serif !important;
  font-weight: normal;
  letter-spacing: 4px;
  text-align: center;
}

#sidebar-description {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #cccccc;
  font-family: 'Philosopher', sans-serif;
  text-align: left;
}

#region-difficulty {
  margin: 12px 0 16px 0;
}

#report-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px solid #4a0e0e;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 24px;
  font-family: 'Philosopher', sans-serif;
  text-align: center;
}

#report-btn:hover {
  background: #4a0e0e;
  color: #ffffff;
}

#reports-title {
  color: #ffffff;
  font-size: 20px;
  font-family: 'Philosopher', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 12px;
  text-align: left;
}

#reports-list {
  font-family: 'Philosopher', sans-serif;
  color: #cccccc;
  text-align: left;
}

#reports-list p {
  color: #777;
  font-size: 14px;
}

/* ================================================================
   КНОПКИ-МАРКЕРЫ
   ================================================================ */
.marker-button {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  pointer-events: auto;
  z-index: 10;
}

.marker-button img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.marker-button:hover img {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.marker-button .marker-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Philosopher', 'Arial', sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.15);
  letter-spacing: 0.5px;
}

.marker-button .marker-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

.marker-button:hover .marker-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-12px);
}

.marker-button:active img {
  transform: scale(0.9);
}

/* ================================================================
   МОДАЛЬНОЕ ОКНО
   ================================================================ */
#report-modal {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

#report-modal > div {
  background: #1a0a1a;
  border: 1px solid #4a0e0e;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  color: #ffffff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8);
}

#report-modal h3 {
  font-family: 'Philosopher', sans-serif;
  color: #ffd700;
  margin-top: 0;
  text-align: center;
}

#report-modal #modal-region-name {
  color: #aaa;
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

#report-modal input,
#report-modal textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #4a0e0e;
  border-radius: 6px;
  color: #ffffff;
  font-family: 'Philosopher', sans-serif;
  box-sizing: border-box;
}

#report-modal textarea {
  min-height: 120px;
  resize: vertical;
}

#report-modal input:focus,
#report-modal textarea:focus {
  outline: none;
  border-color: #ffd700;
}

#report-modal button {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-family: 'Philosopher', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

#submit-report-btn {
  background: #4a0e0e;
  color: #ffd700;
}

#submit-report-btn:hover {
  background: #6a1a1a;
}

#cancel-report-btn {
  background: transparent;
  color: #888;
  border: 1px solid #555;
  margin-left: 8px;
}

#cancel-report-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ================================================================
   ОТКЛЮЧАЕМ АНИМАЦИЮ ДЛЯ ОБЛАКОВ
   ================================================================ */
.cloud-marker img {
  transition: none !important;
  transform: none !important;
}

.cloud-marker:hover img {
  transform: none !important;
}

/* ================================================================
   ВРЕМЕННАЯ МЕТКА ПРИ РАЗМЕЩЕНИИ
   ================================================================ */
.temp-marker {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.temp-marker img {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.temp-marker .marker-tooltip {
  background: rgba(0, 0, 0, 0.8);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.3);
}

/* ================================================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ
   ================================================================ */
@media (max-width: 768px) {
  #region-sidebar {
    width: 320px;
  }
  
  #region-image-placeholder {
    min-height: 120px;
    max-height: 250px;
  }
  
  #region-image-placeholder img {
    min-height: 120px;
    max-height: 250px;
  }
  
  .panel-content {
    padding: 16px 20px 30px 20px;
  }
}

@media (max-width: 480px) {
  #region-sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  #region-image-placeholder {
    min-height: 100px;
    max-height: 200px;
  }
  
  #region-image-placeholder img {
    min-height: 100px;
    max-height: 200px;
  }
  
  .panel-content {
    padding: 12px 16px 20px 16px;
  }
  
  #sidebar-title {
    font-size: 18px;
  }
}
