/*
Theme Name: Jannah Child
Theme URI: https://dein-link-zu-jannah.de/
Description: Child-Theme für das Jannah-Theme
Author: Dein Name
Author URI: https://dein-link.de/
Template: jannah
Version: 1.0.0
*/

/* ========== Basis-Layout ========== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #08A9D3;
  font-family: sans-serif;
  overflow: hidden;
}

#map-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100vh;
  flex-grow: 1;
  background-color: #08A9D3;
  overflow: hidden;
}

.mv-content-wrapper {
  display: none;
}



/* ========== Popup ========== */
#popup, .ol-popup {
  position: absolute;
  background-color: white;
  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: 250px;
  z-index: 100;
}

/* ========== Zoom-Buttons ========== */
.ol-zoom {
  z-index: 1100;
  top: auto;
  bottom: 100px;
  right: 20px;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.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: #067ba8;
}

/* ========== Sidebar Desktop ========== */
.sidebar {
  width: 500px;
  background-color: #1c1c1c;
  padding: 20px;
  transition: all 0.3s ease;
  overflow-y: auto;
  flex-shrink: 0;
  height: 100vh;
  position: relative;
  color: white;
  z-index: 10;
}

.sidebar-logo {
  display: block;
  max-width: 120px;
  margin: 0 auto 20px;
  padding-top: 10px;
}

/* Kategorien */
.category {
  margin-bottom: 20px;
}

.category h3 {
  margin-bottom: 8px;
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.category ul {
  list-style: none;
  padding-left: 10px;
}

.category ul li {
  margin-bottom: 6px;
  font-size: 14px;
}

.category .controls {
  margin-top: 8px;
}

.category-wrapper {
  display: block;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .category-wrapper {
    display: block;
    grid-template-columns: 1fr 1fr;
  }
}


.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.controls button {
  background-color: #b538b7;
  color: #e6dddd;
  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: #383836;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Sidebar-Toggle Desktop */
.sidebar-toggle-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: #b538b7;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1001;
  font-size: 16px;
}

@media (min-width: 769px) {
  .sidebar-toggle-btn {
    display: block;
  }

  #map-menu .sidebar-logo,
  #map-menu .category,
  #map-menu .controls,
  #map-menu .menu-ad-slot {
    display: block;
  }

  #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 .menu-ad-slot {
    display: none !important;
  }


 /* Griff-Position offen (Standardzustand) */
#map-menu #sidebar-toggle-desktop {
  left: 500px;
}

/* Griff-Position eingeklappt */
#map-menu.collapsed #sidebar-toggle-desktop {
  left: 60px;
}
  
  #map-menu.collapsed + #sidebar-toggle-desktop i {
    transform: rotate(180deg);
  }

  .ol-zoom {
    position: absolute;
    top: 16px;
    right: 16px;
    left: auto;
    bottom: auto;
  }
}
  

/* Sidebar-Toggle immer sichtbar und wie ein Griff */
#sidebar-toggle-desktop {
  position: absolute;
  top: calc(50% - 18px);
  left: 500px;
  z-index: 9999;
  background-color: #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;
}

/* Wenn Sidebar eingeklappt */
#map-menu.collapsed + #sidebar-toggle-desktop {
  left: 60px;
}



/* ========== 📱 Mobile Styles ========== */
@media (max-width: 768px) {
  body {
    padding-top: 56px;
  }

  .mobile-header {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: #1c1c1c;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }

  .icon-left,
  .icon-right {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .icon-button {
    background: none;
    border: none;
    font-size: 22px;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-title {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
  }

  .logo {
    height: 34px;
    max-width: 100%;
    margin: 0 auto;
  }

  .sidebar-logo {
    display: none;
  }

  @media (max-width: 768px) {
    .ol-zoom {
      position: absolute;
      top: 70px;      /* 56px Header + 14px Abstand */
      right: 16px;
      bottom: auto;
      left: auto;
    }
  }
  

  #map-menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 56px);
    background: rgba(20, 20, 20, 0.98);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: 200px;
  }

  #map-menu.active {
    transform: translateX(0);
  }

  #map-menu:not(.active) {
    transform: translateX(-100%);
  }

  .category h3 {
    font-size: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid #333;
  }

  .category ul {
    padding-left: 0;
  }

  .category li {
    font-size: 13px;
    margin-bottom: 4px;
  }

  #map {
    overflow: hidden;
  }
 
  }

/* ========== 💻 Desktop: mobile-only Elemente ausblenden ========== */
@media (min-width: 769px) {
  .mobile-header,
  .icon-left,
  .icon-right {
    display: none !important;
  }
}

/* --- Zentrierung der Buttons Desktop & Mobile --- */
.sidebar .controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px auto;
  max-width: 100%;
}

.sidebar .controls button {
  min-width: 140px;
  text-align: center;
}

/* Mobile Optimierung: Buttons nebeneinander */
@media (max-width: 768px) {
  .sidebar .controls {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 10px;
    margin-bottom: 20px;
  }

  .sidebar .controls button {
    width: auto;
    max-width: none;
    margin: 6px 0;
  }
}

/* Kategorie-Listen zweispaltig */
.category ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  padding-left: 0;
  list-style: none;
}

/* Desktop-spezifische Wiederherstellung der Button-Zentrierung */
@media (min-width: 769px) {
  #map-menu .controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }

  #map-menu .sidebar-logo,
  #map-menu .category,
  #map-menu .menu-ad-slot {
    display: block;
  }
}

.filter-search {
  position: relative;
  margin: 24px auto 20px auto; /* oben & unten mehr Abstand, horizontal zentriert */
  max-width: 360px;
}

.filter-search::before {
  content: "🔍";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #aaa;
  pointer-events: none;
}

#category-search {
  width: 100%;
  padding: 10px 12px 10px 36px; /* links Platz für Icon */
  background: #2c2c2c;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  box-sizing: border-box;
}


.sidebar-legal {
  font-size: 12px;
  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: #b538b7;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-legal a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .sidebar-legal {
    font-size: 11px;
    padding-bottom: 80px; /* extra Platz für Werbeeinblendungen z.B. */
  }
}

/* 🎨 Custom Scrollbar für Sidebar (Desktop) */
@media (min-width: 769px) {
  .sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: #1c1c1c; /* passend zum Sidebar-Hintergrund */
  }

  .sidebar::-webkit-scrollbar-thumb {
    background-color: #b538b7;
    border-radius: 4px;
  }

  .sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #902e95;
  }
}

.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: #fbce43;
  color: #1a1a1a;
}

/* 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, aber ohne Text zu verdecken */
#search-container::before {
  content: '🔍';
  position: absolute;
  left: calc(50% - 225px + 14px); /* Icon passend zur Input-Position */
  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;
}
