/* Grundlegendes Layout */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #f8f9fa;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 15px; /* Globaler Seitenabstand */
}

/* Track Liste Container & Typografie */
.container {
  max-width: 1100px;
  margin: 20px auto;
  width: 100%;
}

h1 {
  color: #2c3e50;
  font-weight: 300;
  margin-bottom: 30px;
  border-bottom: 3px solid #3498db;
  display: inline-block;
  padding-bottom: 10px;
}

.category-header {
  color: #34495e;
  margin: 40px 0 20px 0;
  font-size: 1.2em;
  border-left: 4px solid #3498db;
  padding-left: 15px;
  text-transform: capitalize;
}

/* Kachel-Grid */
.track-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.track-item {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
  position: relative;
  overflow: hidden;
}

.track-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #3498db;
}

.track-item a {
  display: block;
  padding: 25px;
  color: #34495e;
  font-weight: 600;
  text-decoration: none;
  height: 100%;
  box-sizing: border-box;
}

.track-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 6px;
  background: #3498db;
}

.track-item-meta {
  display: block;
  font-size: 0.85em;
  color: #95a5a6;
  margin-top: 8px;
  font-weight: 400;
}

/* Analyse-Ansicht: Stats-Bar */
.stats-bar {
  background: #34495e;
  color: #ecf0f1;
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.stats-bar b {
  color: #3498db;
  margin-left: 3px;
}
/* Button-Gruppe für die rechte Seite der Stats-Bar */
.button-group {
  display: flex;
  gap: 10px;
}

.btn-download {
  background-color: #3498db;
  color: white !important;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
}

.btn-download:hover {
  background-color: #2980b9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.btn-close {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ecf0f1 !important;
  padding: 6px 14px;
  border: 1px solid #7f8c8d;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

/* Map & Chart */
#map {
  flex: 1;
  width: 100%;
  border-radius: 8px;
  z-index: 1;
  border: 1px solid #ccc;
}
.leaflet-control-elevation .elevation-download,
.leaflet-control-elevation .download-link,
#elevation-chart .download-link,
.elevation-control-download {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  padding: 0 !important;
}
#elevation-chart {
  height: 180px;
  width: 100%;
  margin-top: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}

/* Mobile Optimierung */
@media (max-width: 600px) {
  body {
    padding: 8px;
  }

  .stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .tour-name {
    grid-column: span 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    font-size: 0.9em;
  }

  .btn-close {
    grid-column: span 2;
    text-align: center;
  }

  #map {
    height: 45vh;
  }
}
