/* ============================================
   Grundlayout & Body
   ============================================ */
body.routen-seite {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  font-family: 'Open Sans', sans-serif;

  /* alter Hintergrund */
  background: radial-gradient(circle, rgba(204, 255, 102, 0.8), rgba(0, 102, 0, 0.8));
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;

  margin: 0;
  padding: 0;
}

/* ============================================
   Logo + Headline
   ============================================ */
.logo-text-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  flex-shrink: 0;
}

.logo-text-container img {
  width: 100px;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease;
}
.logo-text-container img:hover {
  transform: scale(1.08);
}

.headline-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a471f;
  text-align: center;
}

.sub-headline,
.sub-headline-link {
  display: block;
  font-size: 1rem;
  color: #2c6b2f;
  margin-top: 4px;
  text-decoration: none;
}

.sub-headline-link:hover {
  text-decoration: underline;
  color: #1a471f;
}

/* ============================================
   Sidebar (GPX-Liste)
   ============================================ */
.sidebar {
  width: 320px;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  margin: 20px;
  padding: 15px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow-y: auto;
  max-height: calc(100vh - 120px); /* Header abziehen */
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  position: relative;
}
.sidebar h3 {
  position: sticky;
  top: 0; /* Abstand vom oberen Rand der Sidebar */
  background-color: #fff; /* Hintergrund damit Text lesbar bleibt */
  z-index: 10; /* über anderen Elementen */
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid #ccc; /* optional: Trennung */
}

.gpx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: rgba(245,245,245,0.9);
  cursor: pointer;
  transition: all 0.25s ease, box-shadow 0.3s ease;
}

.gpx-item:hover {
  transform: translateX(4px);
  background: #e9fbe9;
  border-color: #2c6b2f;
  box-shadow: 0 0 10px rgba(44,107,47,0.5);
}

.gpx-name {
  flex: 1;
  cursor: pointer;
}

.download-link, .komoot-link {
  margin-left: 10px;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.download-link:hover,
.komoot-link:hover {
  transform: scale(1.2);
}

/* ============================================
   Content Bereich mit Karte & Track-Info
   ============================================ */
.content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#map {
  width: 100%;
  max-width: 900px;
  height: 500px;
  border-radius: 12px;
  border: 3px solid transparent;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  margin-bottom: 20px;
  position: relative;
}

#track-info {
  background: rgba(255,255,255,0.85);
  border: 1px solid #cde5cd;
  border-radius: 10px;
  padding: 12px 18px;
  width: 100%;
  max-width: 500px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.08);
}

#track-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#track-info li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

#track-info li:last-child {
  margin-bottom: 0;
}

h2, h3 {
  color: #1a471f;
  text-shadow: 1px 1px 3px rgba(255,255,255,0.7);
}
.track-button {
  display: block; /* Vollbreite für Sidebar-Items */
  width: 100%;
  padding: 10px 16px;
  background-color: #4caf50; /* Helleres Grün */
  color: white;
  border-radius: 8px;
  border: none;
  font-size: 1em;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
  transition: background-color 0.2s, transform 0.1s;
  text-decoration: none;
  user-select: none;
}

.track-button:hover {
  background-color: #66bb6a; /* etwas heller beim Hover */
  transform: translateY(-1px);
}

.track-button:active {
  background-color: #388e3c; /* dunkler beim Klick */
  transform: translateY(1px);
}

.track-button svg, .track-button img {
  margin-right: 6px; /* Icon besser sichtbar */
  vertical-align: middle;
}


/* ============================================
   Scrollbar für Sidebar
   ============================================ */
.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.3);
  border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6bd26b, #2c6b2f);
  border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2c6b2f, #6bd26b);
}

/* ============================================
   Responsive Anpassungen für Karte & Sidebar
   ============================================ */
@media (max-width: 1024px) {

  body.routen-seite {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    width: 95%;
    max-height: 35vh;  /* genug Platz für Header */
    margin: 10px 0;
    border-right: none;
    border-bottom: 1px solid #ccc;
    overflow-y: auto;
    padding: 10px 15px;
  }

  .content {
    width: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #map {
    width: 95%;
    max-width: 700px;
    height: auto;
    aspect-ratio: 1 / 1;  /* bleibt quadratisch auf Handy */
    margin: 15px auto;
  }

  #track-info {
    width: 95%;
    max-width: 450px;
  }
}
#track-title {
  cursor: pointer;
  display: inline-block;
  padding: 10px 16px;
  background-color: #2c6b2f;
  color: white;
  border-radius: 8px;
  border: none;
  font-size: 1.5em;
  transition: background-color 0.2s, transform 0.1s;
  user-select: none;
}

#track-title:hover {
  background-color: #3a8440;
  transform: translateY(-2px);
}

#track-title:active {
  background-color: #245026;
  transform: translateY(1px);
}

/* Speziell für kleine Smartphones */
@media (max-width: 480px) {

  .sidebar {
    max-height: 30vh;
    padding: 8px 12px;
  }

  #map {
    width: 95%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
  }

  #track-info {
    max-width: 90%;
    font-size: 0.9rem;
  }

  .logo-text-container {
    flex-direction: column;
    align-items: center;
  }

  .logo-text-container img {
    width: 80px;
  }

  .headline-text {
    font-size: 1.2rem;
  }
}

/* Querformat auf Handy (Landscape) */
@media (max-width: 820px) and (orientation: landscape) {
  body.routen-seite {
    flex-direction: row;
    align-items: flex-start;
  }

  .sidebar {
    width: 220px;
    max-height: 90vh;
    margin: 10px;
  }

  .content {
    flex: 1;
    padding: 15px;
  }

  #map {
    width: 100%;
    max-width: none;
    height: 80vh;
  }

  #track-info {
    max-width: 300px;
  }
}
