/* Leaflet Map Integration für Übernachten-Seiten */

/* Zusätzliche Informationsbereiche */
.ausstattung,
.lageundanfahrt {
  margin: 30px 0;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #434fbf;
}

.ausstattung h4,
.lageundanfahrt h4 {
  margin: 0 0 15px 0;
  color: #434fbf;
  font-size: 1.3em;
  font-weight: 600;
}

.ausstattung p,
.lageundanfahrt p {
  margin: 0;
  line-height: 1.6;
  color: #555;
}

.location-map-container {
  margin: 30px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.location-map-header {
  background: #434fbf;
  color: white;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 1.1em;
}

.location-map {
  height: 400px;
  width: 100%;
  position: relative;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  .location-map {
    height: 300px;
  }
  
  .location-map-header {
    padding: 12px 15px;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .location-map {
    height: 250px;
  }
}

/* Custom Marker Styles */
.custom-marker {
  background: #434fbf;
  border: 3px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Route Marker Styles */
.route-marker {
  background: transparent;
  border: none;
  font-size: 20px;
  text-align: center;
  line-height: 25px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.start-marker {
  filter: drop-shadow(0 2px 4px rgba(0,128,0,0.3));
}

.end-marker {
  filter: drop-shadow(0 2px 4px rgba(255,0,0,0.3));
}

.route-info-marker {
  background: #434fbf;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  text-align: center;
  line-height: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* GPX Route Styles */
.leaflet-interactive {
  cursor: pointer;
}

/* Route Info Styles */
.route-stats {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  border-left: 4px solid #ff6b35;
}

.route-stats h4 {
  margin: 0 0 10px 0;
  color: #ff6b35;
  font-size: 1.2em;
}

.route-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.route-stats .stat-item {
  text-align: center;
  padding: 10px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.route-stats .stat-value {
  font-size: 1.3em;
  font-weight: 600;
  color: #434fbf;
  display: block;
}

.route-stats .stat-label {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 280px;
}

.leaflet-popup-content {
  margin: 15px;
  line-height: 1.5;
  max-width: 350px;
}

.leaflet-popup-content h4 {
  margin: 0 0 10px 0;
  color: #434fbf;
  font-size: 1.1em;
  font-weight: 600;
}

.leaflet-popup-content p {
  margin: 5px 0;
  font-size: 0.9em;
  color: #666;
}

.leaflet-popup-content a {
  color: #434fbf;
  text-decoration: none;
}

.leaflet-popup-content a:hover {
  text-decoration: underline;
}

/* Layer Control Styling */
.leaflet-control-layers {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.leaflet-control-layers-expanded {
  padding: 10px;
  background: white;
}

.leaflet-control-layers label {
  font-size: 0.9em;
  margin: 5px 0;
  display: flex;
  align-items: center;
}

.leaflet-control-layers input[type="radio"] {
  margin-right: 8px;
}

/* Loading State */
.map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: #f8f9fa;
  color: #666;
  font-size: 1.1em;
}

.map-loading::before {
  content: "🗺️";
  margin-right: 10px;
  font-size: 1.5em;
}

/* Error State */
.map-error {
  text-align: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
  color: #6c757d;
  height: auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.map-error .error-icon {
  font-size: 3em;
  margin-bottom: 15px;
  opacity: 0.7;
}

.map-error h4 {
  margin: 10px 0;
  color: #495057;
  font-size: 1.2em;
}

.map-error p {
  margin: 10px 0;
  color: #6c757d;
}

.map-error small {
  display: block;
  margin-top: 10px;
  font-style: italic;
  color: #868e96;
}

/* GPX Note Styles */
.gpx-note {
  background: #e8f5e8;
  border: 1px solid #c3e6c3;
  border-radius: 6px;
  padding: 10px;
  margin-top: 15px;
  text-align: center;
}

.gpx-note small {
  color: #2d5a2d !important;
}

/* Elevation Profile Styles */
.elevation-profile-container {
  margin-top: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}

.elevation-profile-header {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: white;
  padding: 15px 20px;
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.3s ease;
}

.elevation-profile-header:hover {
  background: linear-gradient(135deg, #e55a2b, #e8841a);
}

.elevation-profile-header .toggle-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.elevation-profile.collapsed .toggle-icon {
  transform: translateY(-50%) rotate(-90deg);
}

.elevation-profile {
  padding: 20px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.elevation-profile.collapsed {
  max-height: 0;
  padding: 0 20px;
  opacity: 0;
}

.elevation-profile canvas {
  width: 100%;
  height: 200px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
}

.elevation-info {
  margin-top: 20px;
}

.elevation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.elevation-stats .stat {
  background: #f8f9fa;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #ff6b35;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.elevation-stats .stat-label {
  font-weight: 500;
  color: #495057;
}

.elevation-stats .stat-value {
  font-weight: bold;
  color: #ff6b35;
  font-size: 1.1em;
}

.elevation-hint {
  margin-top: 15px;
  text-align: center;
  padding: 10px;
  background: #e8f4fd;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

.elevation-hint small {
  color: #0056b3;
  font-style: italic;
}

/* Route-Marker Styles */
.route-marker {
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid #fff;
}

.start-marker {
  background: #28a745;
  color: white;
}

.end-marker {
  background: #dc3545;
  color: white;
}

.route-info-marker {
  background: #007bff;
  color: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.elevation-hover-marker {
  background: #ffc107;
  color: #212529;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* GPX Route Styles */
.leaflet-interactive {
  cursor: pointer;
}

.leaflet-interactive:hover {
  stroke-width: 6;
  stroke-opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .elevation-profile {
    padding: 15px;
  }
  
  .elevation-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .elevation-stats .stat {
    padding: 10px 12px;
  }
  
  .elevation-profile-header {
    padding: 12px 15px;
    font-size: 1em;
  }
}

/* Elevation Hover Marker */
.elevation-hover-marker {
  background: none !important;
  border: none !important;
  font-size: 16px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Elevation Tooltip */
.elevation-tooltip {
  font-family: Arial, sans-serif;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 200px;
  word-wrap: break-word;
  /* Verhindert Tooltip-Flackern */
  transition: none;
  /* Stellt sicher, dass der Tooltip über allem anderen liegt */
  position: fixed !important;
  z-index: 10000 !important;
}

.elevation-tooltip div:first-child {
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 4px;
  margin-bottom: 4px;
  font-weight: bold;
}