/* ========== Basis-Layout ========== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  background: #1a1a1a;
  overflow: hidden;
}

#map-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#map {
  flex-grow: 1;
  background: #1a1a1a;
  height: 100vh;
}

.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-header {
  position: relative;
  display: flex;
  align-items: center;
}

.popup-title {
  display: inline;
  font-size: 1.1rem;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .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;
  }

  .share-button {
    flex-shrink: 0;
    font-size: 1.1rem;
    cursor: pointer;
    color: #999;
  }

  .share-button svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
    vertical-align: middle;
  }

  .share-button:hover svg {
    fill: #444;
  }
}

.share-button {
  display: inline;
  white-space: nowrap;
  vertical-align: baseline;
  font-size: 0.8em;
  margin-left: 0.3rem;
  cursor: pointer;
  color: #bbb;
}

.share-button svg {
  fill: #524f4f;
  width: 1.6em;
  height: 1.6em;
  vertical-align: middle;
  transition: fill 0.2s ease;
}

.share-button:hover svg {
  fill: #928c8c;
}



.popup-description p {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.popup-description {
  white-space: normal;
  font-size: 15px;
}



#popup h3 {
  font-size: 16px;  /* Titel kleiner machen */
  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;
}

/* Optional: etwas Feinjustierung */
#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;
}


/* ========== Sidebar Grundlayout ========== */
#map-menu {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 400px;
  background-color: #141414;
  color: white;
  overflow: hidden; /* verhindert doppelten Scrollbalken */
}

/* Kopfbereich bleibt fix */
.sidebar-top {
  padding: 20px;
  padding-bottom: 5px;
  flex-shrink: 0;
}

/* Scrollbereich */
.sidebar-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 0 20px 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: #555 #222; /* für Firefox */
}

#map-content-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 20px;
}

#map-content-links .map-btn {
  flex: 1 1 auto;
  text-align: center;
  min-width: 130px;
}


/* Optional für WebKit-Scrollbars */
.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 3px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Footer bleibt ganz unten */
.sidebar-footer {
  flex-shrink: 0;
  font-size: 11px;
  color: #888;
  background-color: #111;
  padding: 12px 20px;
  padding-bottom: 70px;
  line-height: 1.4;
  text-align: center;
  border-top: 1px solid #222;
}

.sidebar-logo {
  display: block;
  max-width: 150px;
  margin: 10px auto 20px;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.controls button {
  background-color: #b538b7;
  color: #f0e9e9;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.controls button:hover {
  background-color: #b538b7;
}

.controls button:hover,
.map-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}


.filter-search {
  position: relative;
  margin-top: 12px;
}

.filter-search::before {
  content: "🔍";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #aaa;
}

#category-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: #2c2c2c;
  color: white;
  border: none;
  border-radius: 8px;
}

.global-search {
  position: relative;
  margin-bottom: 5px;
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  z-index: 999;
  border: 1px solid #ccc;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
}

.search-result-item:hover {
  background-color: #f0f0f0;
}

.no-result {
  padding: 8px 12px;
  color: #888;
}


.category-wrapper {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 10px;
}

.category-wrapper {
  padding-top: 0;
  padding-right: 16px;
  padding-bottom: 10px;
  padding-left: 16px;
}

.category {
  margin-bottom: 20px;
}

.category h3 {
  font-size: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.category ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* fix 2 Spalten */
  gap: 8px 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.category li {
  font-size: 14px;
}

.sidebar-legal {
  font-size: 9px;
  color: #bbb;
  text-align: center;
  margin-top: 24px;
  padding: 12px 10px 30px;
  border-top: 1px solid #333;
  line-height: 1.4;
}

.sidebar-legal p {
  margin: 6px 0;
}

.sidebar-legal a {
  color: #ece4ec;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-legal a:hover {
  text-decoration: underline;
}


/* ========== Zoom-Buttons ========== */
.ol-zoom {
  z-index: 1100;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
}

.ol-zoom button {
  background-color: #b538b7;
  color: white;
  border-radius: 6px;
  font-size: 18px;
  width: 36px;
  height: 36px;
  margin: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: none;
}

.ol-zoom button:hover {
  background-color: #b538b7;
}


/* ========== Sidebar Toggle Desktop ========== */
.sidebar-toggle-btn {
  position: absolute;
  top: calc(50% - 18px);
  left: 500px;
  z-index: 9999;
  background: #1c1c1c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.3s ease;
}

#map-menu.collapsed {
  width: 60px;
}

#map-menu.collapsed .sidebar-logo,
#map-menu.collapsed .category,
#map-menu.collapsed .controls,
#map-menu.collapsed .filter-search,
#map-menu.collapsed .sidebar-legal,
#map-menu.collapsed #map-switcher,
#map-menu.collapsed .sidebar-scroll,
#map-menu.collapsed .sidebar-footer,
#map-menu.collapsed .global-search,
#map-menu.collapsed .menu-ad-slot {
  display: none !important;
}

#map-menu.collapsed + .sidebar-toggle-btn {
  left: 60px;
}

#map-menu.collapsed + .sidebar-toggle-btn i {
  transform: rotate(180deg);
}


/* ========== Mobile Styles ========== */
@media (max-width: 768px) {

  body {
    padding-top: 56px;
  }

  #map-wrapper {
    flex-direction: column;
  }

  #map {
    flex: 1 1 auto;
    height: calc(100vh - 56px);
    min-height: 200px;
  }

  #map-menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: rgba(20, 20, 20, 0.98);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 9999;
  }

  #map-menu.active {
    transform: translateX(0);
  }


  .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: 70px !important;
    left: 16px !important;
    right: unset !important;
    bottom: unset !important;
    font-size: 11px;
    padding: 4px 8px;
  }


  .icon-button {
    background: none;
    border: none;
    font-size: 22px;
    color: white;
    cursor: pointer;
  }

  .header-title {
    flex-grow: 1;
    text-align: center;
  }

    .sidebar-logo {
      display: none;
    }

    @media (max-width: 600px) {
      .category ul li {
        font-size: 13px;
      }
    
      .label-text {
        font-size: 13px;
      }
    
      .category h3 {
        font-size: 15px;
      }
    
      .controls button {
        min-width: auto;
        font-size: 13px;
        padding: 5px 10px;
      }
    }
    

  }

  .logo {
    height: 34px;
  }



/* ========== Desktop hides mobile header ========== */
@media (min-width: 769px) {
  .mobile-header {
    display: none !important;
  }
}

/* ========== Kategorien / Listen / Labels korrekt stylen ========== */

.category {
  margin-bottom: 24px;
}

.category h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
  font-weight: bold;
  color: #ffffff;
}

.category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category ul li {
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.category ul li label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.category ul li input[type="checkbox"] {
  accent-color: #b538b7;
  width: 16px;
  height: 16px;
}

.label-text {
  color: #ddd;
  white-space: normal !important;
  font-size: 14px;
}

.map-btn {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.map-btn:hover {
  background: #222;
  color: #fff;
  border-color: #888;
}


.map-btn.active {
  background-color: #b538b7;
  color: #1a1a1a;
}

/* Griff-Position offen (Standardzustand) */
#map-menu #sidebar-toggle-desktop {
  left: 400px;
}

/* Griff-Position eingeklappt */
#map-menu.collapsed #sidebar-toggle-desktop {
  left: 60px;
}
  
  #map-menu.collapsed + #sidebar-toggle-desktop i {
    transform: rotate(180deg);
  }

/* Sidebar-Toggle immer sichtbar und wie ein Griff */
#sidebar-toggle-desktop {
  position: absolute;
  top: calc(50% - 18px);
  left: 500px;
  z-index: 9999;
  background-color: #b538b7;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.3s ease;
}

/* Wenn Sidebar eingeklappt */
#map-menu.collapsed + #sidebar-toggle-desktop {
  left: 60px;
}

 #mouse-coords {
    position: absolute;
    bottom: 10px;
    right: 10px;
    left: unset;
    top: unset;
    font-size: 13px;
    padding: 6px 10px;
    background-color: rgba(0, 0, 0, 0.7);
    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%);
}

#map {
  cursor: url('https://www.gtaup.de/wp-content/themes/jannah-child/gta-6-map/icons/cursor.cur'), auto;
}


.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;
}



/* Nur mobile Navigation für kleine Bildschirme anzeigen */
@media screen and (min-width: 769px) {
  #mobile-nav,
  .mobile-header,
  .mobile-only {
    display: none !important;
  }
}

.lang-switch {
  display: flex;
  gap: 8px;
}

#map-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}


.lang-switch-desktop {
  display: none;
  gap: 8px;
}

@media (min-width: 769px) {
  .lang-switch-desktop {
    display: flex;
  }

.map-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
  }

}

.lang-btn {
  background: #2c2c2c;
  color: #fff;
  border: 1px solid #666;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-btn:hover {
  background: #444;
}

.lang-btn.active {
  background: #fbce43;
  color: #1a1a1a;
  font-weight: bold;
}

/* Wrapper zentriert den Suchbereich */
#search-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

/* Suchfeld mit Platz für das Icon */
#search-input {
  width: 100%;
  max-width: 450px;
  padding: 10px 14px 10px 40px; /* links Platz für 🔍 */
  font-size: 16px;
  border: 1px solid #888;
  border-radius: 6px;
  background-color: #111;
  color: #fff;
  outline: none;
  box-sizing: border-box;
}

/* Lupe innerhalb des Felds, korrekt relativ zur .global-search-Umgebung */
.global-search {
  position: relative;
}

.global-search::before {
  content: '🔍';
  position: absolute;
  left: 14px; /* fester Abstand vom linken Rand des Input-Felds */
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  pointer-events: none;
  font-size: 16px;
}

/* Ergebnisliste zentriert unterhalb */
#search-results {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  z-index: 9999;
  list-style: none;
  margin-top: 6px;
  padding: 0;
  width: 100%;
  max-width: 450px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  border-bottom: 1px solid #333;
}

.search-result-item:hover {
  background-color: #2a2a2a;
}

.no-result {
  padding: 10px 14px;
  color: #aaa;
}
