body, html {
  margin: 0;
  padding: 0;
  height: calc(100dvh - 20px); /* zamiast 100%, lepiej dla mobilnych */
  padding-top: 20px; /* dostosuj do wysokości menu */
  background: #000;
  color: white;
  font-family: Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

#map {
  width: 80%;
  height: calc(100dvh - 40px);
  float: left;
}

#list {
  width: 20%;
  height: 100%;
  float: right;
  background: #111;
  overflow-y: auto;
  padding: 15px;
  box-sizing: border-box;
}

/* Nagłówek listy */
#toggleList {
  display: none; /* domyślnie ukryty na desktop */
}

#list h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 24px;
  text-align: center;
}

#markerList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#markerList li {
  cursor: pointer;
  padding: 10px 5px;
  border-bottom: 1px solid #333;
  transition: background 0.2s;
}

#markerList li:hover {
  background: #444;
}

.leaflet-container {
  background-color: black !important;
}

.leaflet-popup-content-wrapper {
  background-color: black !important;
  width: 500px !important;
  height: 500px !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  width: 500px !important;
  height: 500px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.leaflet-popup-tip {
  background-color: black !important;
}

.marker-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.popup-content {
  position: relative;
  width: 500px;
  height: 500px;
  padding-bottom: 40px; /* miejsce na podpis */
  overflow: hidden;
  cursor: pointer;
}

.popup-img {
  width: 100%;
  height: auto; /* nie rozciągać na 100% */
  object-fit: contain;
  display: block;
}

.popup-title-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  color: white;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 0;
  box-sizing: border-box;
  background: rgba(0,0,0,0.6);
  pointer-events: none;
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 24px;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 0;
  padding: 0 6px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  z-index: 20;
}

.close-btn:hover {
  background: rgba(255, 0, 0, 0.8);
}

#detailModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  color: white;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#detailModal.show {
  opacity: 1;
  visibility: visible;
}

.detailLabel {
  color: #777;
}

#detailContent {
  display: flex;
  max-width: 90%;
  max-height: 90%;
  margin: 5% auto;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

#zoomContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid white;
  position: relative;
  max-width: 60vw;
  max-height: 80vh;
  flex-shrink: 0;
  margin: 0 auto;
}

#zoomContainer img {
  display: block;
  max-width: none;
  max-height: 80vh;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

#zoomControls {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#zoomControls button {
  padding: 6px 12px;
  background: #222;
  border: 1px solid #555;
  color: white;
  cursor: pointer;
  user-select: none;
}

#detailText {
  max-width: 35%;
  font-size: 16px;
  line-height: 1.6;
  flex-grow: 1;
  min-width: 250px;
}

#detailText h2 {
  margin-top: 0;
}

#closeDetail {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 28px;
  cursor: pointer;
  color: white;
  z-index: 10000;
  user-select: none;
}

.custom-tooltip {
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 10px !important;
  font-weight: normal !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.arrow {
  font-weight: bold;
  margin-right: 3px;
  user-select: none;
}
.arrow.above {
  color: limegreen;
}
.arrow.below {
  color: red;
}

#zoomContainer img {
  transition: transform 0.2s ease;
}

@media (max-width: 600px) {
  body, html {
    padding: 0;
  }
  #map {
    height: 100dvh;
  }
  .leaflet-popup-content-wrapper {
    max-width: 0.9vs !important;
    max-height: 0.9vs !important;
  }
  
  #map {
    width: 100%;
  }	
	
  #detailContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap !important;
  }

  #zoomContainer {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  #zoomContainer img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  #detailText {
    width: 100%;
    max-width: 90%;
    padding: 0 10px;
    font-size: 15px;
  }

  #list {
    width: calc(100% - 60px);
    position: fixed;
    top: 40px;
    left: 60px;
    height: 0;
    overflow: hidden;
    background: #111;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
    transition: height 0.3s ease;
    z-index: 1500;
  }

  #list.expanded {
    height: 50vh;
    overflow-y: auto;
  }

  .list-content {
    padding: 15px;
    box-sizing: border-box;
    height: 100%; /* wypełnia rodzica */
    overflow-y: auto; /* scrollowanie zawartości */
    display: flex;
    flex-direction: column;
  }

  #toggleList {
    display: block;
    width: calc(100% - 60px);
    height: 50px;
    line-height: 50px;
    background: #222;
    color: white;
    font-weight: bold;
    padding-left: 10px;
    cursor: pointer;
    user-select: none;
    position: fixed;
    top: 0;
    left: 60px;
    z-index: 1501;
    border-radius: 0;
  }
}


