/* ========== BENDRAS ========== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
}
#map {
  height: 100%;
  width: 100%;
  font-family: inherit; /* or just delete this line */
  transition: background 0.3s, color 0.3s;
}

/* ========== MODE TOGGLE ========== */
#modeToggle {
  position: absolute;
  top: 15px;
  right: 15px;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  z-index: 9999;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.light-mode #modeToggle {
  background: #000;
  color: #fff;
}
.dark-mode #modeToggle {
  background: #fff;
  color: #000;
}
#modeToggle:hover { transform: scale(1.1); }

/* ========== LEAFLET CLEANUP ========== */
.leaflet-container a {
  color: inherit !important;
  text-decoration: none !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  background: var(--card-bg);
  padding: 0 !important;
  transition: background 0.3s, color 0.3s;
  box-shadow: none !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 320px !important;
  max-width: 90vw;
  color: var(--text-color);
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
  border: none !important;
}
.dark-mode .leaflet-bar a:hover,
.dark-mode .leaflet-bar a:focus {
  background: #e05915 !important;
}
.light-mode .leaflet-bar a:hover,
.light-mode .leaflet-bar a:focus {
  background: #e05915 !important;
}

.light-mode .leaflet-bar a.leaflet-disabled {
  background: #000;
  color: #fff !important;
  opacity: 0.4 !important;
}
.dark-mode .leaflet-bar a.leaflet-disabled {
  background: #fff;
  color: #000 !important;
  opacity: 0.4 !important;
}

/* Custom close button */
.leaflet-popup-close-button {
  font-size: 22px;
  opacity: 0.8;
  margin: 8px;
  transition: 0.25s;
}
.leaflet-popup-close-button span { display: none; }
.leaflet-popup-close-button:after {
  content: "\f00d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #fff;
}
.leaflet-popup-close-button:hover:after {
  color: #e05915 !important;
  transform: scale(1.25) rotate(90deg);
  opacity: 1;
}

/* Popup rodyklė */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--card-bg) !important;
  color: var(--text-color) !important;
  border: none !important;
  box-shadow: none !important;
  transition: background 0.3s, color 0.3s;
}

/* ========== HEADER ========== */
.popup-header {
  background: var(--header-bg);
  padding: 12px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  border-radius: 12px 12px 0 0;
}

/* ========== GALERIJA ========== */
.popup-carousel {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: #000;
}
.popup-carousel img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.popup-carousel img.active {
  opacity: 1;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  font-size: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  z-index: 5;
}
.carousel-btn.left { left: 10px; }
.carousel-btn.right { right: 10px; }

/* ========== TEKSTAS ========== */
.popup-body {
  padding: 12px 15px 0px 15px;
  font-size: 14px;
  line-height: 1.4em;
  background: var(--card-bg);
  /* max-height: 200px;  ❌ nuimti */
  /* overflow-y: auto;   ❌ nuimti */
}
.popup-body b { display: block; margin-top: 6px; }

/* ========== SKAITYTI DAUGIAU ========== */
.read-more {
  display: block;
  margin: 12px auto;
  background: #e05915;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.25s;
  text-align: center;
}
.read-more:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.dark-mode .read-more {
  background: #fff;
  color: #000;
}

/* ========== MYGTUKAI ========== */
.popup-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 0 0 12px 12px;
}
.popup-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #e05915;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: 0.25s;
}
.popup-actions a:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.light-mode .popup-actions a {
  color: white !important;
}
.dark-mode .popup-actions a {
  background: #fff;
  color: #000 !important;
}

/* ========== ZOOM ========== */
.leaflet-control-zoom a {
  border: none !important;
  width: 38px;
  height: 38px;
  font-size: 20px;
  line-height: 36px;
  border-radius: 50%;
  margin: 3px;
  transition: 0.2s;
}
.light-mode .leaflet-control-zoom a {
  background: #000;
  color: #fff !important;
}
.dark-mode .leaflet-control-zoom a {
  background: #fff;
  color: #000 !important;
}

/* ========== FA MARKERIS ========== */
.fa-marker {
  font-size: 32px;
  text-align: center;
  line-height: 1;
  color: #e05915; /* oranžinė VISADA */
}

/* ========== TEMOS ========== */
.light-mode {
  --card-bg: #fff;
  --header-bg: #431c5d;
  --text-color: #222;
}
.dark-mode {
  --card-bg: #1e1e1e;
  --header-bg: #2c2c54;
  --text-color: #ddd;
}

/* ========== MODAL ========== */
#infoModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  position: relative;
  animation: modalFade 0.3s ease;
}

@keyframes modalFade {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--text-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-color);
  border: none;
  background: none;
  transition: 0.25s;
}

.modal-close:hover {
  color: #e05915;
  transform: rotate(90deg) scale(1.2);
}


/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  #modeToggle {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }
  .leaflet-control-zoom a {
    width: 48px;
    height: 48px;
    font-size: 22px;
    line-height: 46px;
  }
  .leaflet-popup-content {
    width: 95vw !important;
    font-size: 15px;
  }
  .popup-carousel {
    height: 220px;
  }
  .popup-carousel img {
    height: 220px;
  }
  .fa-marker { font-size: 48px; }
}
@media (max-width: 350px) {
  .leaflet-popup-content {
    width: 92vw !important;
    font-size: 13px;
  }
  .popup-carousel {
    height: 180px;
  }
  .popup-carousel img {
    height: 180px;
  }
}
/* Lightbox styles */
#lbOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  touch-action: none;
}
#lbOverlay.visible { display: flex; }
#lbStage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
#lbImg {
  will-change: transform;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
#lbClose {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 100000;
}
#lbPrev, #lbNext {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  background: rgba(0,0,0,.35);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 100000;
  border-radius: 10px;
}
#lbPrev { left: 10px; }
#lbNext { right: 10px; }
@media (hover:hover) {
  #lbPrev:hover, #lbNext:hover, #lbClose:hover {
    background: rgba(255,255,255,.15);
  }
}