/* ========== Basis-Layout ========== */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  overflow: hidden;
  background: #2c67a4 !important;
}

#map-wrapper {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ========== Map Container ========== */
#map {
  flex-grow: 1;
  height: 100%;
  background: transparent;
  transition: opacity 0.22s ease;
  cursor: url('https://www.gtaup.de/wp-content/themes/jannah-child/gta-6-map/icons/cursor.cur'), auto;
}

#map.is-fading {
  opacity: 0.55;
}

.mv-content-wrapper {
  display: none;
}

/* ========== Popup ========== */
#popup,
.ol-popup {
  position: absolute;
  background: white;
  color: black;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  bottom: 12px;
  left: -50px;
  min-width: 280px;
  z-index: 100;
}

.popup-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-header {
  position: relative;
  display: flex;
  align-items: center;
}

.popup-title {
  display: inline;
  font-size: 1.1rem;
  line-height: 1.3;
}

.popup-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-region {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7b7b7b;
  font-weight: 700;
}

.popup-coords {
  font-size: 12px;
  color: #666;
  font-family: monospace;
  line-height: 1.3;
}

.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.popup-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #efefef;
  color: #444;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.popup-tag-type-landscape {
  background: rgba(106, 210, 255, 0.18);
  color: #1d7ea5;
}

.popup-tag-type-trailer {
  background: rgba(181, 56, 183, 0.16);
  color: #9d2aa0;
}

.popup-tag-type-leak {
  background: rgba(247, 201, 72, 0.22);
  color: #9a7400;
}

.popup-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 10px;
  max-height: 220px;
  object-fit: cover;
}

.popup-notes {
  font-size: 12px;
  color: #777;
  line-height: 1.4;
  padding-top: 2px;
}

.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.popup-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #b538b7;
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.popup-action-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.popup-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #7a7a7a;
  line-height: 1.3;
}

.popup-source::before {
  font-size: 14px;
  line-height: 1;
}

.popup-source-gtadb::before {
  content: "🌍";
}

.popup-source-trailer::before {
  content: "🎬";
}

.popup-source-leak::before {
  content: "🔍";
}

.popup-source-own::before {
  content: "⭐";
}

.share-button {
  cursor: pointer;
  font-size: 15px;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.share-button:hover {
  opacity: 1;
  transform: scale(1.1);
}

.share-button::before {
  content: "📍";
  font-size: 16px;
}

.share-button:hover::before {
  content: "🧭";
}

.popup-description {
  white-space: normal;
  font-size: 15px;
}

.popup-description p {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

#popup h3 {
  font-size: 16px;
  margin: 0 0 10px 0;
}

#popup a,
.ol-popup a {
  color: #2b2929;
}

#popup a:hover,
.ol-popup a:hover {
  color: #b538b7;
}

#popup-content img {
  cursor: zoom-in;
  touch-action: manipulation;
}

#popup-content ul,
#popup-content ol,
#popup-content li {
  all: revert;
}

#popup-content ul,
#popup-content ol {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

#popup-content li {
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

/* ========== Map UI / Overlays ========== */
#mouse-coords {
  position: absolute;
  bottom: 10px;
  right: 10px;
  left: unset;
  top: unset;
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(20, 20, 20, 0.75);
  color: #00ffcc;
  font-family: monospace;
  border-radius: 5px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.marker-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  font-size: 16px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2000;
  display: none;
  transform: translate(-50%, -100%);
}

/* ========== Mobile Header ========== */
.mobile-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 12px;
  background: #1c1c1c;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mobile-header-left {
  flex: 0 0 auto;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header-left .logo {
  height: 40px;
}

.logo {
  height: 34px;
}

.icon-button {
  background: none;
  border: none;
  font-size: 22px;
  color: white;
  cursor: pointer;
}

.header-title {
  flex-grow: 1;
  text-align: center;
}

/* ========== Responsive ========== */
@media (min-width: 769px) {
  .mobile-header,
  #mobile-nav,
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 56px;
  }

  #map-wrapper {
    flex-direction: column;
  }

  #map {
    flex: 1 1 auto;
    height: calc(100dvh - 56px);
    min-height: 200px;
  }

  .mobile-header .icon-left,
  .mobile-header .icon-right {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ol-zoom {
    position: absolute;
    z-index: 1100;
    top: 43%;
    right: 16px;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
  }

  #mouse-coords {
    position: absolute !important;
    top: 76px !important;
    left: 16px !important;
    right: unset !important;
    bottom: unset !important;
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(20, 20, 20, 0.75);
  }

  .popup-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }

  .popup-title-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
}
