/* =======================================================
   Datei: gmamap.css
   Version: 1.0 RC1
   Timestamp: 29.10.2025 03:45 CET
   Author: Mario H. Fietz, DL4MFM
   Beschreibung: GMA Map Layout – bereinigte Release Candidate
   ======================================================= */

:root {
  --gma-blue: #00ADEF;
  --btn-bg: var(--gma-blue);
  --btn-hover: #0098d6;
  --btn-text: #ffffff;
}

/* =======================================================
   GRUNDLAYOUT
   ======================================================= */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #f6f8fa;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* =======================================================
   GMA-LOGO POSITION
   ======================================================= */

/* 💻 Desktop – unten links */
#gma-logo-export {
  position: fixed;
  bottom: 18px;
  left: 15px;
  height: 40px;
  z-index: 1600;
  opacity: 0.95;
}

/* 📱 Mobil – mittig oben */
@media (max-width: 768px) {
  #gma-logo-export {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    height: 32px;
    z-index: 1600;
  }
}

/* =======================================================
   STYLE SWITCHER PANEL (OBEN DESKTOP / UNTEN MOBIL)
   ======================================================= */

#style-switcher {
  position: fixed;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  padding: 10px 16px;
  z-index: 1500;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 40px);
}

/* Buttons / Dropdowns */
#style-switcher button,
#style-switcher select {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

#style-switcher button:hover,
#style-switcher select:hover {
  background-color: var(--btn-hover);
  transform: scale(1.05);
}

/* 📱 Mobile Position unten mittig */
@media (max-width: 768px) {
  #style-switcher {
    top: auto !important;
    bottom: 70px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    width: calc(100% - 20px);
    max-width: 480px;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  }

  #style-switcher button,
  #style-switcher select {
    font-size: 12px;
    padding: 4px 7px;
    height: 32px;
  }
}

/* =======================================================
   SIDEBAR + HAMBURGER-MENÜ
   ======================================================= */

/* --- Basis Sidebar --- */
#sidebar {
  position: fixed;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 15px;
  overflow-y: auto;
  z-index: 1601;
  transition: transform 0.3s ease;
}

/* --- Desktop: rechts fix sichtbar --- */
@media (min-width: 769px) {
  #sidebar {
    top: 80px;
    right: 20px;
    width: 140px;
    max-height: 80vh;
    transform: none;
  }

  #sidebar-toggle {
    display: none;
  }

  #gma-logo-export {
    position: absolute;
    bottom: 20px;
    left: 20px;
    transform: none;
    height: 40px;
    z-index: 1000;
  }
}

/* --- Mobil: einklappbare Sidebar unter Menü --- */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 60px;
    right: 8px;
    left: auto !important;          /* <<< HIER liegt der Fix */
    width: 120px;
    max-height: 75vh;
    transform: translateX(120%);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 12px;
    overflow-y: auto;
    z-index: 1601;
    transition: transform 0.3s ease;
  }

  #sidebar.active {
    transform: translateX(0);
    right: 10px;
    left: auto !important;          /* <<< Fix für sichtbar-Zustand */
    top: 40px;
  }

  #sidebar-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: #003366;
    color: white;
    padding: 6px 10px;
    font-size: 1.2em;
    border: none;
    border-radius: 4px;
    z-index: 1602;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  }

  #sidebar-toggle:hover {
    background-color: #0098d6;
  }
}

/* --- Fix: Hamburger bleibt dunkelblau auch aktiv --- */
#sidebar-toggle,
#sidebar-toggle.active {
  background-color: #003366 !important;
  color: #ffffff !important;
}

/* =======================================================
   MOBILE OPTIMIERUNG – POTA POPUP
   ======================================================= */

@media (max-width: 768px) {
  #customPopup {
    position: fixed !important;
    top: 60px !important;
    left: 5vw !important;
    width: 90vw !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    background: #fff !important;
    border: 1px solid #888 !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 15px rgba(0,0,0,0.4) !important;
    padding: 10px !important;
    font-size: 0.9em !important;
    line-height: 1.4 !important;
    z-index: 9999 !important;
    transform: none !important; /* Wichtig! verhindert Verschiebung */
  }

  #customPopup table {
    width: 100% !important;
    font-size: 0.9em !important;
  }

  #customPopup div[style*="position:relative"] {
    text-align: center !important;
    margin-top: 8px !important;
  }

  #customPopup div[style*="position:relative"] img {
    max-width: 60vw !important;
    height: auto !important;
    border-radius: 6px !important;
  }

  #customPopup div[style*="position:relative"] a img {
    max-width: 20px !important;
    height: 20px !important;
    top: 6px !important;
    right: 6px !important;
  }

  #customPopup div:last-child {
    font-size: 0.85em !important;
    text-align: center !important;
  }
}

/* =======================================================
   DESKTOP POTA POPUP
   ======================================================= */

#customPopup {
  max-width: 600px;
  width: 80vw;
  left: 50% !important;
  transform: translateX(-50%) !important;
  top: 80px !important;
}
