/* japan-map.css — Стили для Интерактивной GIS Карты Японии (#/map) */

.d-jmap-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 24px;
  isolation: isolate;
  position: relative;
  z-index: 10;
}

/* ─── Шапка ─── */
.jmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.jmap-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jmap-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 26px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.jmap-title .jp {
  font-size: 14px;
  background: rgba(163, 217, 145, 0.15);
  color: #A3D991;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: sans-serif;
}

.jmap-subtitle {
  font-size: 14px;
  color: #98A2B3;
  margin: 0;
}

.jmap-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: #FFFFFF;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.jmap-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #A3D991;
}

/* ─── Тело страницы: Карта + Боковая панель ─── */
.jmap-body {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: stretch;
}

/* ─── GIS Карта Японии ─── */
.jmap-canvas-card {
  background: #1A2128;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  position: relative;
}

.jmap-canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #A3D991;
}

.jmap-quick-cities {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jmap-city-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #D0D5DD;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jmap-city-chip:hover, .jmap-city-chip.is-active {
  background: rgba(163, 217, 145, 0.2);
  border-color: #A3D991;
  color: #FFFFFF;
}

.jmap-leaflet-wrapper {
  width: 100%;
  height: 640px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
  background: #12171C;
}

#japan-leaflet-map {
  width: 100%;
  height: 100%;
  background: #12171C;
}

/* ─── Кастомные Маркеры Leaflet ─── */
.jmap-leaflet-marker-wrap {
  background: none !important;
  border: none !important;
}

.jmap-leaflet-marker {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

@keyframes jmapMarkerPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0.2; }
  100% { transform: scale(1); opacity: 0.8; }
}

.jmap-marker-pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #A3D991;
  animation: jmapMarkerPulse 2.5s ease-in-out infinite;
}

.jmap-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #A3D991;
  border: 2px solid #12171C;
  box-shadow: 0 0 10px rgba(163, 217, 145, 0.6);
  transition: all 0.2s ease;
}

.jmap-marker-badge {
  position: absolute;
  top: -3px;
  left: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFA552;
  border: 1px solid #12171C;
}

.jmap-marker-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.jmap-leaflet-marker:hover .jmap-marker-dot {
  transform: scale(1.3);
  background: #FFFFFF;
  border-color: #A3D991;
}

.jmap-leaflet-marker:hover .jmap-marker-label {
  color: #A3D991;
  text-shadow: 0 0 10px rgba(163, 217, 145, 0.8);
}

.jmap-leaflet-marker.is-selected .jmap-marker-dot {
  background: #FFA552;
  border-color: #FFFFFF;
  transform: scale(1.4);
}

.jmap-leaflet-marker.is-selected .jmap-marker-label {
  color: #FFA552;
  font-weight: 800;
}

/* ─── Боковая Панель ─── */
.jmap-side-panel {
  background: #1A2128;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  max-height: 720px;
  overflow-y: auto;
}

.jmap-panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jmap-panel-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.jmap-panel-kanji {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 34px;
  font-weight: 800;
  color: #A3D991;
  line-height: 1;
}

.jmap-panel-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jmap-panel-name {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.jmap-panel-region {
  font-size: 12px;
  color: #98A2B3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.jmap-panel-desc {
  font-size: 13px;
  color: #D0D5DD;
  margin: 4px 0 0;
  line-height: 1.4;
}

/* Секции боковой панели */
.jmap-panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jmap-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.jmap-notes-input {
  width: 100%;
  height: 110px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #FFFFFF;
  padding: 12px;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.jmap-notes-input:focus {
  outline: none;
  border-color: #A3D991;
  background: rgba(0, 0, 0, 0.35);
}

/* ─── Кастомный Выпадающий Список С Поиском ─── */
.jmap-custom-select-wrapper {
  position: relative;
  width: 100%;
}

.jmap-custom-select-trigger {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #D0D5DD;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.jmap-custom-select-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #A3D991;
  color: #FFFFFF;
}

.jmap-select-arrow {
  font-size: 10px;
  color: #A3D991;
  transition: transform 0.2s ease;
}

.jmap-custom-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1A2128;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.jmap-custom-dropdown.is-open {
  display: flex;
}

.jmap-dropdown-search-box {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.jmap-dropdown-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #FFFFFF;
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
  box-sizing: border-box;
}

.jmap-dropdown-search-input:focus {
  border-color: #A3D991;
}

.jmap-dropdown-items-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.jmap-dropdown-item {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.jmap-dropdown-item:hover {
  background: rgba(163, 217, 145, 0.15);
}

.jmap-dropdown-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
}

.jmap-dropdown-item-sub {
  font-size: 11px;
  color: #98A2B3;
}

.jmap-dropdown-empty {
  padding: 14px;
  font-size: 12px;
  color: #98A2B3;
  text-align: center;
}

/* Список материалов */
.jmap-mats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jmap-empty-hint {
  font-size: 12px;
  color: #98A2B3;
  font-style: italic;
  line-height: 1.4;
}

.jmap-mat-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.jmap-mat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.jmap-mat-title {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jmap-mat-sub {
  font-size: 11px;
  color: #98A2B3;
}

.jmap-mat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jmap-mat-open, .jmap-mat-remove {
  background: transparent;
  border: 0;
  color: #98A2B3;
  font-size: 14px;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 6px;
}

.jmap-mat-open:hover { color: #A3D991; background: rgba(255,255,255,0.08); }
.jmap-mat-remove:hover { color: #FF66A1; background: rgba(255,255,255,0.08); }

/* Фотогалерея */
.jmap-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(163, 217, 145, 0.15);
  border: 1px dashed #A3D991;
  border-radius: 10px;
  color: #A3D991;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.jmap-upload-btn:hover {
  background: rgba(163, 217, 145, 0.25);
}

.jmap-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.jmap-photo-card {
  height: 75px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.jmap-photo-card:hover {
  transform: scale(1.05);
  border-color: #A3D991;
}

.jmap-photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  border: 0;
  color: #FFFFFF;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.jmap-photo-card:hover .jmap-photo-del {
  opacity: 1;
}

/* ─── Lightbox Modal (Полноэкранное фото) ─── */
.jmap-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 18, 0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: jmapFadeIn 0.2s ease;
}

@keyframes jmapFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.jmap-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jmap-lightbox-content img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  object-fit: contain;
}

.jmap-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.jmap-lightbox-close:hover {
  background: #FF66A1;
  border-color: #FF66A1;
  transform: scale(1.1);
}

@media (max-width: 900px) {
  .jmap-body {
    grid-template-columns: 1fr;
  }
}
