/* =============================================================================
   PROTOMAP STYLES - UI-Komponenten und Marker-Styling
   =============================================================================

   ZWECK:
     Definiert Styling f\u00fcr alle UI-Elemente der ProtoMap-Anwendung.
     Enth\u00e4lt Layer Control Panel, Marker-Effekte und Popup-Styling.

   HAUPT-KOMPONENTEN:
     1. Layer Control Panel - Steuerungs-Panel (aktuell nicht verwendet)
     2. Team Marker Styles  - Hover-Effekte f\u00fcr Team-Pins
     3. Waypoint Styles     - Styling f\u00fcr Wegpunkt-Marker
     4. MapLibre Popups     - Anpassung der Standard-Popups
     5. Responsive Design   - Mobile Anpassungen

   WICHTIGE KLASSEN:
     .team-marker     - Team-Pin Container
     .waypoint-marker - Wegpunkt Container
     .layer-control   - Steuerungs-Panel (optional)

   VERWENDUNG:
     - Von index.html eingebunden
     - Styles werden auf dynamisch erstellte Marker angewendet

   ANPASSUNG:
     - Farben und Gr\u00f6\u00dfen k\u00f6nnen hier ge\u00e4ndert werden
     - Hover-Effekte in .team-marker:hover
     - Responsive Breakpoint bei 768px
   =============================================================================
*/

/* =========================================================================
   LAYER CONTROL PANEL (Optional - aktuell nicht aktiv verwendet)
   =========================================================================
   Styling f\u00fcr ein optionales Steuerungs-Panel zum Ein-/Ausblenden von Layern
   ========================================================================= */
.layer-control {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  min-width: 200px;
  z-index: 1000;
}

.layer-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.layer-control-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.toggle-panel-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s;
}

.toggle-panel-btn:hover {
  color: #333;
}

.layer-control-content {
  display: block;
}

.layer-control.collapsed .layer-control-content {
  display: none;
}

.layer-group {
  margin-bottom: 15px;
}

.layer-group:last-child {
  margin-bottom: 0;
}

.layer-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.layer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.layer-item label {
  cursor: pointer;
  user-select: none;
  color: #333;
  display: flex;
  align-items: center;
  flex: 1;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-left: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #4CAF50;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Hover effects */
.layer-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

/* =========================================================================
   TEAM MARKER STYLES
   =========================================================================
   Styling für Team-Pins (dynamisch erstellt von team-animation.js)
   ========================================================================= */
.team-marker {
  transition: transform 0.2s;
  /* Sanfte Vergrößerung beim Hover */
}

.team-marker svg {
  display: block;
  /* Stabilisiert SVG-Rendering, verhindert line-height Probleme */
}

.team-marker:hover {
  transform: scale(1.1);
  /* 10% Vergrößerung */
  z-index: 1000;
  /* Bringt Marker in den Vordergrund */
}


/* =========================================================================
   WAYPOINT MARKER STYLES
   =========================================================================
   Styling für Wegpunkt-Marker (Start, Ziel, Zwischenpunkte)
   ========================================================================= */
.waypoint-marker {
  transition: transform 0.2s;
  /* Sanfte Vergrößerung beim Hover */
}

.waypoint-marker:hover {
  transform: scale(1.2);
  /* 20% Vergrößerung (stärker als Team-Marker) */
}

.waypoint-marker svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  /* Leichter Schatten */
}

/* =========================================================================
   MAPLIBRE POPUP STYLING
   =========================================================================
   Anpassung der Standard-Popups (zeigen Team-Informationen)
   ========================================================================= */
.maplibregl-popup-content {
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.maplibregl-popup-tip {
  border-top-color: white;
}

/* =========================================================================
   RESPONSIVE DESIGN
   =========================================================================
   Anpassungen für mobile Geräte (Tablets und Smartphones)
   Breakpoint: 768px (typische Tablet-Breite)
   ========================================================================= */
@media (max-width: 768px) {

  /* Layer Control: Positionierung anpassen für mobile Geräte */
  .layer-control {
    top: 80px;
    /* Weiter unten (Platz für mobile Browser-UI) */
    left: 10px;
    max-width: calc(100vw - 20px);
    /* Passt sich Bildschirmbreite an */
  }

  /* Team Marker: Kleinere Darstellung auf mobilen Geräten */
  .team-marker {
    transform: scale(0.8);
    /* 20% kleiner */
  }

  .team-marker:hover {
    transform: scale(0.9);
    /* Beim Hover nur 10% kleiner (statt normal) */
  }
}

/* =========================================================================
   POI MODAL STYLES
   =========================================================================
   Modal für Points of Interest (Wettbewerb-Schmuckelemente)
   Design: Zweispaltig - Links: Medium (Bild/Video), Rechts: Info
   ========================================================================= */

/* Overlay - Dunkler Hintergrund */
.poi-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

/* Modal Container - Zweispaltig mit separaten Kästen */
.poi-modal-container {
  display: flex;
  gap: 20px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  animation: modalFadeIn 0.3s ease-out;
  position: relative;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Linker Bereich: Medium (Bild/Video) - Separater Kasten */
.poi-modal-media {
  flex: 1;
  background: #f0f0f0;
  border-radius: 8px;
  border: 3px solid #4A90E2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.poi-modal-media img,
.poi-modal-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poi-modal-media canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Rechter Bereich: Informationen - Separater Kasten */
.poi-modal-info {
  flex: 0 0 380px;
  background: white;
  border-radius: 8px;
  padding: 40px 30px;
  position: relative;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Close Button - Außerhalb des weißen Kastens, relativ zum Container */
.poi-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  color: #333;
  border: 2px solid #e0e0e0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translate(50%, -50%);
}

.poi-modal-close:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: translate(50%, -50%) scale(1.1);
}

/* Titel */
.poi-modal-info h2 {
  margin: 0 0 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

/* Beschreibung */
.poi-modal-info p {
  margin: 0 0 15px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.poi-modal-info p:last-child {
  margin-bottom: 0;
}

/* Responsive Design für Modal */
@media (max-width: 768px) {
  .poi-modal-container {
    flex-direction: column;
    max-height: 85vh;
    overflow-y: auto;
  }

  .poi-modal-media {
    min-height: 300px;
    max-height: 400px;
  }

  .poi-modal-info {
    flex: 0 0 auto;
    padding: 30px 20px;
  }
}