/* ✅ Resetowanie marginesów i paddingu */
body {
  margin: 0;
  padding: 0;
}

/* 🔵 Animacja pulsowania */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.pulsing-icon {
  animation: pulse 1.5s infinite;
  transition: transform 0.3s ease-in-out;
}

#add-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
}

#add-button {
  display: block;
  cursor: pointer;
}

#add-button img {
  --icon-size: 70px;
  width: var(--icon-size);
  height: var(--icon-size);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease-in-out;
  animation: pulse 1.5s infinite;
}

/* Kontener na opcje */
#add-options {
  position: absolute;
  bottom: 80px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease-in-out;
}

.add-option {
  display: block;
  background: rgba(34, 150, 34, 0.9);
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  white-space: nowrap;
  text-align: center;
}

.add-option:hover {
  background: rgba(34, 150, 34, 1);
}

/* Po otwarciu */
#add-container.open #add-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}




/* ✅ Mapa zajmuje całe okno */
#map {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* ✅ Kontener wyszukiwarki */
#search-container {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 600px;
  z-index: 1000;
}

/* ✅ Pasek wyszukiwania */
#search-bar {
  display: flex;
  flex-wrap: wrap;
  background-color: lightgray;
  border: 2px solid green;
  border-radius: 5px;
  padding: 5px;
  box-sizing: border-box;
  box-shadow: rgba(0, 0, 0, 0.3) 0 4px 10px;
}

#search-input {
  flex: 1;
  padding: 5px;
  border: none;
  outline: none;
  font-size: 14px;
  background-color: rgb(223, 216, 216);
  border-radius: 3px;
  min-width: 0;
}

#search-button {
  background-color: green;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 5px;
  flex-shrink: 0;
}

#search-button:hover {
  background-color: darkgreen;
}

/* ✅ Lista podpowiedzi */
#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid green;
  border-radius: 5px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1001;
  min-width: 200px;
}

.suggestion-item {
  display: block;
  width: calc(100% - 10px);
  padding: 10px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease-in-out;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #1f5e2f;
  color: white;
}



/* 📌 Popup formularza dodawania zdjęć */
#photo-form-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 214748361;
  display: none;
  opacity: 0;
  visibility: hidden;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* ✅ Aktywny popup */
#photo-form-popup.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* 📌 Zawartość popupu */
.popup-content {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  height: auto;
  max-height: 90vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* 📌 Styl iframe */
#zoho-iframe {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  min-height: 500px;
  max-height: 90vh;
  border: none;
}

/* 📌 Ukrywanie popupu Leaflet, gdy `photo-form-popup` jest otwarty */
.popup-hidden .leaflet-popup-pane {
  display: none !important;
}
#close-photo-popup {
  all: unset; /* Resetuje domyślne style */
  position: absolute;
  top: var(--close-btn-top, 10px); /* Możliwość dostosowania pozycji */
  right: var(--close-btn-right, 15px); /* Możliwość przesunięcia w lewo */
  font-size: var(--close-btn-size, 18px); /* Możliwość zmiany rozmiaru */
  background: rgba(255, 255, 255, 0.9); /* Jaśniejsze tło */
  color: black;
  border: 2px solid rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 214748361;
  width: var(--close-btn-width, 30px);
  height: var(--close-btn-height, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
}

#close-photo-popup:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}
#close-comment-popup {
  all: unset; /* Resetuje domyślne style */
  position: absolute;
  top: var(--close-btn-top, 10px); /* Możliwość dostosowania pozycji */
  right: var(--close-btn-right, 15px); /* Możliwość przesunięcia w lewo */
  font-size: var(--close-btn-size, 18px); /* Możliwość zmiany rozmiaru */
  background: rgba(255, 255, 255, 0.9); /* Jaśniejsze tło */
  color: black;
  border: 2px solid rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  width: var(--close-btn-width, 30px);
  height: var(--close-btn-height, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
}

#close-comment-popup:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}


/* 📌 Poprawiona wersja dla Leaflet.js */
.leaflet-popup-close-button {
  all: unset; /* Resetuje domyślne style Leaflet */
  position: absolute !important;
  top: var(--close-btn-top, 10px) !important;
  right: var(--close-btn-right, 15px) !important;
  font-size: var(--close-btn-size, 18px) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: black !important;
  border: 2px solid rgba(0, 0, 0, 0.2) !important;
  padding: 5px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  z-index: 10001 !important;
  width: var(--close-btn-width, 30px) !important;
  height: var(--close-btn-height, 30px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease-in-out !important;
}

.leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, 1) !important;
  transform: scale(1.1) !important;
}


/* 📌 Popup formularza komentarzy */
#comment-form-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2147483649;
  display: none;
  opacity: 0;
  visibility: hidden;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* ✅ Aktywny popup */
#comment-form-popup.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* 📌 Zawartość popupu */
.comment-popup-content {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  height: auto;
  max-height: 90vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* 📌 Styl iframe */
#comment-iframe {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  min-height: 500px;
  max-height: 90vh;
  border: none;
}

/* 📌 Ukrywanie popupu Leaflet, gdy `comment-form-popup` jest otwarty */
.popup-hidden .leaflet-popup-pane {
  display: none !important;
}



/* 📌 Lista komentarzy */
#comments-list {
  max-height: 300px;
  overflow-y: auto;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

/* 📌 Pojedynczy komentarz */
.comment {
  background: #f8f8f8;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
  font-size: 14px;
}

/* 📌 Data dodania */
.comment-date {
  display: block;
  font-size: 12px;
  color: gray;
  margin-top: 4px;
}

/* ✅ Naprawa problemu z powiększonymi zdjęciami */
#fullscreen-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2147483647 !important; /* 📌 Ustawiamy najwyższy możliwy z-index */
}

#fullscreen-view img {
  max-width: 95%;
  max-height: 95%;
  cursor: pointer;
}

/* 🔹 Panel popupu na dole ekranu */
/* 🔹 Panel popupu (na komputerze i telefonie taki sam) */
/* 🔹 Panel popupu */
#popup-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 0vh; /* Startowa wysokość */
  min-height: 60vh; /* 📌 Rezerwujemy przestrzeń, żeby zapobiec przesunięciom */
  max-height: 80vh;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  transition: height 0.4s ease-in-out, opacity 0.3s ease-in-out;
  z-index: 2147483;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden; /* 📌 Popup nie powoduje przesunięcia layoutu */
}


/* 🔹 Poprawka dla komputerów */
@media (min-width: 1024px) {
  #popup-panel {
    width: 50%;
    max-width: 600px;
    height: 70vh;
    left: 50%;
    transform: translateX(-50%);
    bottom: -100vh; /* 🚀 Zmienione - teraz domyślnie ukryty */
  }

}

/* 🔹 Nagłówek popupu */
#popup-header {
  position: relative;
  padding: 10px;
  text-align: center;
  background: #f1f1f1;
}

/* 🔹 Pasek do przesuwania popupu */
#drag-handle {
  width: 50px;
  height: 5px;
  background: #aaa;
  border-radius: 3px;
  margin: 10px auto;
  cursor: grab;
}

/* 🔹 Przycisk zamykania */
#close-popup {
  position: absolute;
  right: 15px;
  top: 5px;
  font-size: 24px;
  color: black;
  cursor: pointer;
}

/* 🔹 Treść popupu */
#popup-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* ✅ Treść zaczyna się niżej */
  align-items: center;
  width: 90%; /* ✅ Wycentrowana treść */
  margin: 0 auto;
}

/* 🔹 Ukrywanie domyślnych popupów Leaflet */
.leaflet-popup,
.leaflet-popup-pane {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
