body, html {
  margin: 0;
  padding: 0;
  height: calc(100dvh - 20px);
  padding-top: 20px;
  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;
}

#list h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 24px;
  text-align: center;
}

#markerList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#markerList li {
  border-bottom: 1px solid #333;
  transition: background 0.2s;
}

#markerList li:hover {
  background: #444;
}

.leaflet-container {
  background-color: black;
}

.marker-link {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 10px 5px;
  cursor: pointer;
}

.leaflet-popup-content-wrapper {
  background-color: black;
  padding: 0;
  border-radius: 0;
}

.leaflet-popup-content {
  margin: 0;
  padding: 0;
}

.leaflet-popup-tip {
  background-color: black;
}

.marker-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.custom-marker-container {
  background: none !important;
  border: none !important;
}

/* Właściwa ikonka */
.marker-thumb {
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.marker-thumb, 
.marker-cluster div {
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.marker-thumb:hover{
  transform: scale(1.2) !important;
  border-color: #f00 !important;
  transition: transform 0.2s ease !important;
}

.marker-cluster:hover div {
  transform: scale(1.6) !important;
  transition: transform 0.2s ease !important;
  /* background-color: rgba(255, 255, 255, 0.2); */
}

.leaflet-marker-icon:hover {
  z-index: 1000 !important;
}

.popup-content {
  display: flex;
  width: 500px;
  height: 500px;
  overflow: hidden;
  cursor: pointer;
}

.popup-img {
  width: 100%;
  height: auto;
  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: 5px;
  font-size: 24px;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 0;
  padding: 2px 6px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  z-index: 20;
}

.close-btn:hover {
  color: #f33;
}

.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;
}

@media (max-width: 768px) {
  body, html {
    padding: 0;
  }
  #map {
    height: 100dvh;
  }
  .leaflet-popup-content-wrapper {
    max-width: 0.9vs !important;
    max-height: 0.9vs !important;
  }
  
  #map {
    width: 100%;
  }	

  #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%;
    overflow-y: auto;
    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;
  }
}
