:root {
  --bg-light: #f9f9f9;
  --bg-dark: #1e1e1e;
  --bg-muted-light: #e4e9ef;
  --bg-muted-dark: #343434;

  --text-light: #000;
  --text-dark: #eee;
  --text-muted-light: #6c757d;
  --text-muted-dark: #ddd;

  --border-light: #ccc;
  --border-dark: #444;

  --success-light: #198754;
  --success-dark: #6edc7e;

  --warning-light: #ffc107;
  --warning-dark: #ffcc66;

  --gray-light: #6c757d;
  --gray-dark: #ccc;

  --danger-light: #dc3545;
  --danger-dark: #ff6b6b;

  --bg-strava: #fc4c02;
  --text-strava: #fc4c02;

  --bg-virtual: rgb(96, 36, 122);

  --skiing: #007d7f;
  --sledding: #8e44ad;
  --cycling: #ff7700;
  --running: #b50000;
  --hiking: #19a900;
  --swimming: #17a2b8;
  --wake: #00b0eb;
}

.text-skiing {
  color: var(--skiing) !important;
}
.text-sledding {
  color: var(--sledding) !important;
}
.text-cycling {
  color: var(--cycling) !important;
}
.text-running {
  color: var(--running) !important;
}
.text-hiking {
  color: var(--hiking) !important;
}
.text-swimming {
  color: var(--swimming) !important;
}
.text-wake {
  color: var(--wake) !important;
}

.stroke-skiing {
  stroke: var(--skiing) !important;
}
.stroke-sledding {
  stroke: var(--sledding) !important;
}
.stroke-cycling {
  stroke: var(--cycling) !important;
}
.stroke-running {
  stroke: var(--running) !important;
}
.stroke-hiking {
  stroke: var(--hiking) !important;
}
.stroke-swimming {
  stroke: var(--swimming) !important;
}
.stroke-wake {
  stroke: var(--wake) !important;
}


.text-primary {
  color: var(--primary) !important;
}

.text-accent {
  color: var(--accent) !important;
}

.bg-strava {
  color: var(--bg-light) !important;
  background-color: var(--bg-strava) !important;
}
.btn-outline-strava {
  color: var(--bg-strava) !important;
  border-color: var(--bg-strava) !important;
}
.btn-outline-strava:hover {
  color: white !important;
  background-color: var(--bg-strava) !important;
}

a > i.fa-strava {
  color: var(--bg-strava) !important;
}
a:hover > i.fa-strava {
  color: white !important;
}

.text-strava {
  color: var(--text-strava) !important;
}

.accordion {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}
.accordion-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--accent);
  color: white;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  z-index: 100;
}

@font-face {
    font-family: "FundamentalBrigade";
    src: url("../fonts/Fundamental\ Brigade.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Ubuntu";
    src: url("../fonts/Ubuntu-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Ubuntu";
    src: url("../fonts/Ubuntu-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Ubuntu";
    src: url("../fonts/Ubuntu-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Playtime";
    src: url("../fonts/PlaytimeRegular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Terminal";
    src: url("../fonts/Welbut__.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Retroville";
    src: url("../fonts/Retroville\ NC.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "MissingLinks";
    src: url("../fonts/MissingLinks.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Dinomouse";
    src: url("../fonts/Dinomouse-Regular.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Ubuntu', 'Trebuchet MS', 'Helvetica', 'FundamentalBrigade', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 64px !important;
    transition: background 0.3s ease, color 0.3s ease;
}

h4 {
  font-weight: 600;
}

h2 {
  font-weight: 900;
}

.sidebar {
  overflow: auto;
}
 .calendar-tile .chart-wrapper {
  position: absolute;
  bottom: 20px;        /* leicht über den Rand hinaus */
  left: 0;
  width: 100%;
  height: 50%;         /* Höhe des Charts */
  z-index: 0;           /* hinter dem Inhalt */
  pointer-events: none; /* macht Chart "durchklickbar" */
  opacity: 0.55;        /* dezent, im Hintergrund */
  overflow: hidden;
  filter: brightness(1.4) drop-shadow(4px 0 8px var(--accent));
}

.calendar-tile .monthly-km-chart {
  width: 100%;
  height: 100%;
  display: block;
}


.chart-wrapper-wide {
  width: 100%;
  height: 220px;
  display: block;
  position: relative;
}
.chart-wrapper-wide canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
#timelineChart {
  transition: background-color 0.3s ease, filter 0.3s ease;
}
/* Buttons etwas hervorgehoben, passend zu Boxdesign */
.btn-group-sm .btn.active {
  background-color: var(--accent);
  color: var(--text-dark);
}

    nav a {
      color: white;
      margin-right: 1rem;
      text-decoration: none;
      font-weight: bold;
    }

    .breadcrumbs {
      font-size: 0.9rem;
      margin: 0.5rem 0 1.5rem 0;
      color: #888;
    }

    .breadcrumbs a {
      color: var(--accent);
      text-decoration: none;
    }

    main {
      padding: 2rem;
    }

    .theme-switch i {
      font-size: 1.2rem;
      display: none;
    }

    .theme-switch i.visible {
      display: inline;
    }


/* Cursor für interaktive Elemente */
a,
button,
.btn,
.toggle {
    cursor: pointer;
}

/* Formularfelder */
textarea,
input[type="text"],
input[type="file"],
.form-control {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-family: monospace;
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 0.5em;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-select {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-family: monospace;
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 0.5em;
    border-radius: 4px;
    box-sizing: border-box;
    transition: background 0.2s, color 0.2s;
}
.btn:not(.copy-btn) {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.btn:hover:not(.copy-btn) {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}


.form-select:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}



/* Textarea-Spezifikationen */
textarea {
    resize: none;
    min-height: 150px;
    max-height: 40vh;
    flex: 1;
    width: 100%;
}

/* Drop-Zone */
.drop-zone {
    border: 2px dashed var(--accent);
    padding: 0.5em;
    text-align: center;
    margin-top: 0.5em;
    background: var(--bg-light);
    color: var(--text-light);
}



/* Toggle (z. B. in XML-Tree) */
.toggle {
    font-weight: bold;
    color: var(--accent);
}

/* XML/JSON Ausgabe */
.attr, .text {
    display: block;
    margin-left: 1em;
    white-space: pre-wrap;
    color: var(--text-light);
}



.collapsed > .content {
    display: none;
}

.hidden {
    display: none !important;
}

.node {
    margin-bottom: 0.3em;
}

.xml-output,
.xml-output ul,
.xml-output li {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}
/* Outline Buttons – shared */
.btn-outline-warning,
.btn-outline-success,
.btn-outline-secondary {
    border-width: 2px;
    background-color: transparent;
}

/* Primary Buttons */
button,
.btn {
    font-weight: 500;
    border-radius: 4px;
    padding: 0.5em 1em;
    transition: all 0.2s ease;
}
.btn.toggle-collapse-btn {
  background-color: var(--primary);
  color: var(--text-dark)
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Breadcrumbs */
.breadcrumb-nav {
    margin: 1rem 0 1.5rem 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    background: none;
    font-size: 0.95rem;
}

.breadcrumb-item a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-light);
}


/* Folium Map Wrapper */
.folium-wrapper {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.folium-wrapper .leaflet-container {
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 8px;
  overflow: hidden !important;
}

.folium-wrapper .folium-map {
  height: 100% !important;
  width: 100% !important;
  border-radius: 8px;
  overflow: hidden !important;
}

/* =============== Map 3D/Leaflet Layer Integration =============== */

/* Der 3D-Container sitzt oberhalb der Leaflet-Tiles, aber unter Markern/Overlays */
.leaflet-container .wb-maplibre3d {
  position: absolute;
  inset: 0;
  z-index: 500; /* zwischen Overlay und Tile */
  pointer-events: none; /* 3D-Karte bleibt sichtbar, Leaflet bleibt klickbar */
}

/* Wenn 3D aktiv, ordnen wir gezielt Leaflet-Panes um */
.leaflet-container.wb-3d-active .leaflet-overlay-pane {
  z-index: 400 !important; /* Track-Linie unter MapLibre */
}

.leaflet-container.wb-3d-active .leaflet-marker-pane {
  z-index: 400 !important; /* Track-Marker (Start/Ziel etc.) unter 3D */
}

/* Overlays, Popups und Controls bleiben darüber */
.leaflet-container.wb-3d-active .leaflet-popup-pane,
.leaflet-container.wb-3d-active .leaflet-shadow-pane,
.leaflet-container.wb-3d-active .leaflet-tooltip-pane,
.leaflet-container.wb-3d-active .leaflet-pane.leaflet-badge-pane,
.leaflet-container.wb-3d-active .leaflet-control-container {
  z-index: 700 !important;
}


.form-check-input {
  background-color: var(--accent) !important;
  border: 0;
}

/* Folium Checkbox oben rechts */
.folium-wrapper .leaflet-control-layers {
  color: white;
}
.folium-wrapper .leaflet-control-layers-scrollbar {
  overflow: auto !important;
}

.leaflet-control-layers.leaflet-control-layers-expanded.leaflet-control {
  background: rgba(0, 0, 0, 0.6) !important;
}

.folium-wrapper #map {
  height: 100% !important;
}

.leaflet-control-custom {
  background-color: white;
  color: black;
  border: 1px solid #ccc;
}
.dark-tiles .leaflet-control-custom,
.satellite-tiles .leaflet-control-custom {
  background-color: var(--bg-dark);
  color: black;
  border: 1px solid #ccc;
}


ul.xml-output {
  list-style: none;
  padding-left: 1.25rem;
  font-family: monospace;
}

ul.xml-output li::before {
  content: "\f0da"; /* Font Awesome caret-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

ul.xml-output li.collapsed::before {
  transform: rotate(0deg);
}

ul.xml-output li:not(.collapsed)::before {
  content: "\f0d7"; /* caret-down */
}

/* JSON Tree */
ul.json-tree {
  list-style: none;
  padding-left: 1.25rem;
  font-family: monospace;
}

ul.json-tree li {
  position: relative;
  padding-left: 1.5rem;
}

ul.json-tree li::before {
  position: absolute;
  left: 0;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  margin-right: 0.5rem;
}
ul.json-output {
  list-style: none;
  font-family: monospace;
  padding-left: 1rem;
}

ul.json-output,
ul.json-output ul,
ul.json-output li {
  list-style: none;
  margin: 0;
  padding: 0;
}

li.node {
  position: relative;
  padding-left: 1.5rem;
}

li.node::before {
  position: absolute;
  left: 0;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
}

.node > .toggle::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.5rem;
  content: "\f0da"; /* fa-caret-right */
  display: inline-block;
  transition: transform 0.2s ease;
}

.node:not(.collapsed) > .toggle::before {
  content: "\f0d7"; /* fa-caret-down */
}

/* Theme toggle button */
.theme-toggle-label {
  cursor: pointer;
}

.theme-switch input[type="checkbox"] {
  position: absolute;
  opacity: 1;
}

/* Fallback Map */
.fallback-map {
  background-color: var(--bg-muted-light);
  color: var(--text-light);
  height: 500px !important;
}

#mapSection:has(> .fallback-map)  {  
  height: 500px !important;
}


/* Grid passt die Spaltenzahl dynamisch an (mind. 180px pro Kachel) */
.wb-metric-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: clamp(0.5rem, 0.6vw, 1rem);
}

/* Kachel-Basis */
.wb-metric-card{
  /* Design */
  --wb-card-pad: clamp(8px, 0.9vw, 14px);
  --wb-radius: 10px;

  /* Typo (fluid mit clamp) */
  --fs-body: clamp(0.75rem, 0.55rem + 0.7vw, 0.95rem);
  --fs-title: clamp(0.75rem, 0.4rem + 0.8vw, 0.9rem);
  --fs-value: clamp(0.95rem, 0.7rem + 1.0vw, 1.3rem);
  --fs-small: clamp(0.7rem, 0.35rem + 0.7vw, 0.85rem);

  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: var(--wb-card-pad);
  border-radius: var(--wb-radius);
  line-height: 1.65;
  box-shadow: rgba(0,0,0,0.4) 0 2px 6px;

  /* gleiche Höhe in der Zeile */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(62px, 6.5vw, 100px);

  --wb-bg: rgba(0,0,0,0.6);
  --wb-fg: #fff;
  --wb-shadow: rgba(0,0,0,0.4) 0 2px 6px;

  background: var(--wb-bg);
  color: var(--wb-fg);
  box-shadow: var(--wb-shadow);
}

/* Light Mode leicht dunkler Hintergrund, bleibt aber overlay-ig */
:is(
  html.theme-light,
  html.theme-retro,
  html.theme-solarized,
  html.theme-strava,
  html.theme-concrete,
  html.theme-candy,
  html.theme-forest,
  html.theme-rainbow
) .wb-metric-card{
  --wb-bg: rgba(255,255,255,0.25);
  --wb-fg: #111;
  --wb-shadow: rgba(0,0,0,0.25) 0 2px 6px;
}
:is(
  html.theme-dark,
  html.theme-dark-midnight,
  html.theme-dark-terminal,
  html.theme-dark-violet,
  html.theme-dark-strava,
  html.theme-dark-winered
) .wb-metric-card{
  --wb-bg: rgba(0,0,0,0.6);
  --wb-fg: #fff;
  --wb-shadow: rgba(0,0,0,0.4) 0 2px 6px;
}
/* Header & Icons */
.wb-metric-header h6{
  font-size: var(--fs-title);
  font-weight: 600;
}

/* Hauptzeile */
.wb-metric-main{ gap: .25rem; }
.wb-metric-avg-label{ opacity:.75; font-size: var(--fs-body); }
.wb-metric-avg{ font-size: var(--fs-value); font-weight: 300; }
.wb-metric-unit{ opacity:.75; font-size: var(--fs-body); }

/* Zusatzinfo */
.wb-metric-extra{ margin-top: .25rem; font-size: var(--fs-small); opacity:.9; }
.wb-metric-extra--placeholder{ opacity: 0; }

/* Kleinere Screens: minimal breiteres Min-Width, damit nicht zu schmal */
@media (max-width: 420px){
  .wb-metric-grid{
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* Sehr breite Screens: maximal 5 in einer Reihe ohne zu groß zu werden */
@media (min-width: 1200px){
  .wb-metric-grid{
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}




/* Progress Bar beim Datei Upload */
/* Allgemein */
.progress {
  height: 20px;
  position: relative;
  background-color: var(--bg-muted-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar.uploading {
  width: 0%;
  transition: width 3s ease-out;
  background-color: var(--accent);
  color: var(--text-light);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-pagination {
  position: sticky;
  bottom: 0;
  padding: 0.5rem 1rem;
  z-index: 10;
  border-top: 0px solid var(--border-light);
}

.pagination .page-link {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.2s ease;
}

.pagination .page-link:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.info-card ul li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.tool-tile.glass-tile {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-light);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2),
              inset 0 0 12px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.tool-tile.glass-tile:hover,
.card.glass-tile:hover,
.calendar-cell.info-card.glass-tile:hover {
  cursor: pointer;
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3),
              inset 0 0 14px rgba(255, 255, 255, 0.15);  
}

.calendar-cell.info-card.glass-tile:hover {
  transform: translateY(-3px) !important;
}

.card.glass-tile {
  height: 240px;  
  min-height: 240px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3),
              inset 0 0 12px rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}


.card.glass-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4),
              inset 0 0 14px rgba(255, 255, 255, 0.1);
}

.card.glass-tile a.text-decoration-none {
  font-weight: 600;
  transition: color 0.2s ease;
}

.card.glass-tile a.text-decoration-none:hover {
  text-decoration: underline;
  color: white;
}


.label {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.tool-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 12px;
}


.info-card.glass-tile {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2),
              inset 0 0 12px rgba(255, 255, 255, 0.1);
  color: var(--text-light);  
}

.info-card.glass-tile:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2),
              inset 0 0 12px rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);            
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card ul li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.info-card h5 {
  font-size: 1.3rem;
  font-weight: 600;
}

.info-card.glass-tile:hover {
  transform: None;            
  transition: None;
}
.calendar-tile.info-card {
  display: flex;
  flex-direction: column;
  justify-content: center !important;
}


.media-thumb {
  height: 200px;
  object-fit: cover;
  transition: transform 0.2s ease;
  border-radius: 0.4rem;
}

.media-card:hover .media-thumb {
  transform: scale(1.02);
  cursor: zoom-in;
}


.modal-media {
  max-height: 80vh;
  max-width: 100%;
  object-fit: contain;
  margin: auto;
}

.modal .media-tile {
  aspect-ratio: 1 / 1;
  max-height: 200px;
  overflow: hidden;
  margin: 0.5rem;
}

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

.btn-delete-media {
  opacity: 1;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 0.3rem 0.5rem;
}

.btn-delete-media:hover {
  opacity: 1;
  background: rgba(220, 53, 69, 0.8);
  color: white;
}

canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

.chart-container {
  margin-bottom: 1.5rem;
}

#adminMenuDropdown .dropdown-header {
  font-size: 0.8rem;
  opacity: 0.75;
}

#adminMenuDropdown hr {
  border-top: 1px solid var(--border-dark);
}


.info-card-with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: 80% center;
  background-repeat: no-repeat;
  opacity: 0.12;
  z-index: 0;
}

.info-card-with-bg {
  position: relative;
}

.info-card-with-bg > * {
  position: relative;
  z-index: 1;
}

/* Dunkle Themes → weißes Bild */
html.theme-dark .info-card-with-bg::before,
html.theme-dark-midnight .info-card-with-bg::before,
html.theme-dark-terminal .info-card-with-bg::before,
html.theme-dark-violet .info-card-with-bg::before ,
html.theme-dark-strava .info-card-with-bg::before,
html.theme-dark-winered .info-card-with-bg::before {
  background-image: var(--preview-dark);
}

/* Alle anderen → schwarzes Bild */
html.theme-light .info-card-with-bg::before,
html.theme-retro .info-card-with-bg::before,
html.theme-solarized .info-card-with-bg::before,
html.theme-strava .info-card-with-bg::before,
html.theme-concrete .info-card-with-bg::before,
html.theme-candy .info-card-with-bg::before,
html.theme-forest .info-card-with-bg::before,
html.theme-rainbow .info-card-with-bg::before {
  background-image: var(--preview-light);
}

.accordion-body-with-bg {
  position: relative;       /* notwendig für ::before-Anker */
}

.accordion-body-with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: 80% center;
  background-repeat: no-repeat;
  opacity: 0.12;
  z-index: 0;
}

/* Alle Inhalte über dem Hintergrund */
.accordion-body-with-bg > * {
  position: relative;
  z-index: 1;
}

html.theme-dark .accordion-body-with-bg::before,
html.theme-dark-midnight .accordion-body-with-bg::before,
html.theme-dark-terminal .accordion-body-with-bg::before,
html.theme-dark-violet .accordion-body-with-bg::before,
html.theme-dark-strava .accordion-body-with-bg::before,
html.theme-dark-winered .accordion-body-with-bg::before {
  background-image: var(--preview-dark);
}

html.theme-light .accordion-body-with-bg::before,
html.theme-retro .accordion-body-with-bg::before,
html.theme-solarized .accordion-body-with-bg::before,
html.theme-strava .accordion-body-with-bg::before,
html.theme-concrete .accordion-body-with-bg::before,
html.theme-candy .accordion-body-with-bg::before,
html.theme-forest .accordion-body-with-bg::before,
html.theme-rainbow .accordion-body-with-bg::before {
  background-image: var(--preview-light);
}

html .table tbody tr td {
  border-top: none !important;
  border-bottom: none !important;
}


html .table {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* sanfter, weicher */
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-radius 0.2s ease;
}

html .table:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25); /* gleichmäßiger seitlich & oben */
  border-radius: 8px;
}

.folium-map.dark-tiles .leaflet-pane.leaflet-tile-pane .leaflet-layer:not(.wb-virtual-tiles) {
  filter: brightness(3);
}
/* virtuelle Tiles nicht aufhellen */
.folium-map.dark-tiles .leaflet-pane.leaflet-tile-pane .leaflet-layer.wb-virtual-tiles {
  filter: brightness(0.6) contrast(1.1) hue-rotate(30deg) !important;
}

.activity-heatmap .leaflet-pane.leaflet-overlay-pane .leaflet-interactive {
  mix-blend-mode: color-dodge;
}

.leaflet-tile-container.leaflet-zoom-animated img {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.folium-map.dark-tiles .map-color-overlay,
.folium-map.satellite-tiles .map-color-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500; /* über Tiles, unter Popups/Marker */
}

.media-tile {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: #000;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Sichtbar auch ohne hover */
}

.media-tile:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Medien selbst ohne eigenen Schatten */
.media-tile img,
.media-tile video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0; /* Kein Radius – das hat schon das äußere div */
  box-shadow: none;
}


.media-wrapper {
  position: relative;
  display: inline-block;
}

.media-date-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  width: 100%;
  text-align: center;        /* rechtsbündig */
  font-weight: 500;
  font-size: 1.1rem;        /* größer */
  padding: 0.5rem 1rem;     /* mehr Abstand innen */
  z-index: 0;
}

.media-title-overlay {
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  width: 100%;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
}

.media-badge-right {
  position: absolute;
  top: 0;
  right: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border-radius: 4px;
  z-index: 3;
  width: max-content;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}

.media-badge-left {
  position: absolute;
  top: 0;
  left: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border-radius: 4px;
  z-index: 3;
  width: max-content;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}
/* === 3D-MapLibre Overlays: Start/Ziel + Badges === */
#maplibre3d .wb-3d-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  line-height: 1;
  font-size: 14px;
}

#maplibre3d .wb-3d-marker.wb-3d-start { background: rgba(25,135,84,0.95); }   /* Start */
#maplibre3d .wb-3d-marker.wb-3d-end   { background: rgba(220,53,69,0.95); }   /* Ziel  */

#maplibre3d .wb-3d-badge img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  background: rgba(0,0,0,0.2);
}


#modalVideo {
  padding-bottom: 1.7rem;
}


.modal-media.swiping {
  transition: none !important;
}

.modal-media {
  transition: transform 0.2s ease;
}

.media-wrapper-wrapper {
  max-width: 100%;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
}

.media-wrapper img,
.media-wrapper video {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  transition: transform 0.2s ease;
}


.media-edge-left,
.media-edge-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12%;
  z-index: 10;
  cursor: pointer;
}

.media-edge-left {
  left: 0;
}

.media-edge-right {
  right: 0;
}

/* Feedback-Effekt */
.media-edge-left::after,
.media-edge-right::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.media-edge-left::after {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.3), transparent);
}

.media-edge-right::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.3), transparent);
}

.media-edge-left:active::after,
.media-edge-right:active::after {
    opacity: 1;
  }

@media (hover: hover) {
  .media-edge-left:hover::after,
  .media-edge-right:hover::after {
    opacity: 1;
  }
}


.dark-tiles .leaflet-control-layers,
.dark-tiles .leaflet-bar.leaflet-control.leaflet-control-custom,
.dark-tiles .leaflet-control-zoom-in,
.dark-tiles .leaflet-control-zoom-out,
.satellite-tiles .leaflet-control-layers,
.satellite-tiles .leaflet-bar.leaflet-control.leaflet-control-custom,
.satellite-tiles .leaflet-control-zoom-in,
.satellite-tiles .leaflet-control-zoom-out {
  background-color: var(--bg-dark) !important;
  color: white !important;
}


input.leaflet-control-layers-selector {
  accent-color: var(--primary) !important;
  background-color: var(--primary) !important;
}

.graph-wrapper {
  max-height: 30vh;
  height: 30vh;
}
.graph-wrapper canvas:last-of-type {
  padding-bottom: 2rem !important;
}
#chartSetZones canvas {
  max-height: 30vh;
  height: 30vh;
}


.outer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  padding: 0 8%;
}

.inner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1rem;
  min-height: 460px;
}

.tool-tile.glass-tile.stretch {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.tool-tile.stretch .tool-icon {
  width: 256px;
  height: 256px;
}

.summary-box {
min-width: 360px;
max-width: 400px; 
height: 800px; 
min-height: 800px;
}
.summary-box-wide {
min-width: 360px; 
width: 100%;
}
.summary-box-wide .btn-group .btn {
    flex: 1 1 auto;
    min-width: 70px; /* verhindert extremes Schrumpfen */
    text-align: center;
}
.summary-box-wide .summary-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Damit die Buttons bei wenig Platz automatisch schmaler werden */
.summary-box-wide .btn-group {
    flex-wrap: wrap;
    justify-content: flex-end !important;
}
div.centered {
  margin: 50% auto;  
}

.calendar-tile {
  min-width:480px; 
  height: 800px; 
  min-height: 800px;
}

.custom-point-marker {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 1px solid black;
}
.leaflet-popup-tip {
  background: rgba(0, 0, 0, 0.8) !important;
}


/* Media Popup */
.leaflet-popup .leaflet-popup-content-wrapper:not(.map-hover-info) {
  background-color: rgba(0, 0, 0, 0.7) !important;
  border: 1px solid black !important;
  border-radius: 6px !important;
  padding: 0px !important;
  margin: 5px 5px 0 5px;
  color: white;
  display: inline-block !important;
  width: auto !important;
  min-width: 140px;
  max-width: none !important;
  box-sizing: content-box !important;
}
.leaflet-popup .leaflet-popup-close-button {  
  color: white !important;
  margin: 5px;
}
.leaflet-popup-content:has(img) {
  margin: 10px !important;
  width: auto !important;
}
.leaflet-popup-content img:not([src*="zwift_logo.png"]):not([src*="tacx_logo.png"]):not([src*="gtav_logo.png"]):not([src*="mywhoosh_logo.png"]) {
  width: auto !important;
  min-width: 140px;
  max-width: 250px !important;
  max-height: 250px !important;
  border: 0px solid black !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  margin: 10px 0 10px 0 !important;
}
.leaflet-popup-content img[src*="tacx_logo.png"],
.leaflet-popup-content img[src*="gtav_logo.png"],
.leaflet-popup-content img[src*="zwift_logo.png"],
.leaflet-popup-content img[src*="mywhoosh_logo.png"] {
  width: auto !important;
  height: 15px !important;
  margin: 0 !important;
}
/* Hover Info Popup */
.leaflet-popup:has(.map-hover-info),
.leaflet-popup .leaflet-popup-content-wrapper:has(.map-hover-info) {
  border: 1px solid black !important;
  border-radius: 6px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing:border-box !important;
}
.leaflet-popup-content:has(.map-hover-info) {
  margin: 0 !important;
}
.leaflet-popup-content a{
  color: white !important;
}

.map-hover-info {
  width: 140px !important;
  font-size: 0.85rem;
  padding: 5 !important;
  margin: 0 !important;
  border: 0px solid black;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4) !important;
}

.map-hover-info .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5em;
}

#liveDataOverlay i,
.map-hover-info .info-row i {  
  margin-left: 0.5em;
  width: 1.2em;
  text-align: left;
  color: var(--accent);
}
.map-hover-info .info-row span {
  text-align: left;
  flex: 1;
  font-weight: 500;
  color: white !important;
  white-space: nowrap;
}

.card {
  background: var(--bg-muted);
  color: var(--text);
}


   
/* Upload-/Import-Cards: Aktionen nach unten schieben */
.upload-grid .import-card .card-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;            /* angenehmer Innenabstand */
  min-height: 100%;
}
/* Ganze Form ans Kartenende (inkl. File-Input + Button) */
.upload-grid .import-card .card-body > form {
  margin-top: auto;      /* schiebt das Form nach unten */
}
/* Karten mit nur Button (z. B. Strava) */
.upload-grid .import-card .card-body > .btn,
.upload-grid .import-card .card-body > .protect-btn {
  margin-top: auto;      /* schiebt den Button nach unten */
}
/* 🚀 Der Knackpunkt: Buttons IN Forms auch voll breit machen */
.upload-grid .import-card .card-body form .btn {
  width: 100%;
  display: block;         /* überschreibt Bootstrap inline-block */
}




/* Header immer einzeilig halten */
.table tbody td,
.table thead th,
.table thead th > a {
  white-space: nowrap;
  padding: 4px 6px 4px 10px;
}

/* Blog Tables */
figure > table {
  width: 100% !important;
  padding: 4px 4px;
}

figure.table  {
  overflow-x: auto;
}

/* Badge-Editor Karte */

#poiMapCard,
#segmentMapCard {
  height: 70vh;
  display: flex;
  flex-direction: column;
}
/* Map selbst soll immer 100 % des verfügbaren Platzes nutzen */
#poiMap,
#badgeMap,
#segmentMap {
  flex-grow: 1;
  width: 100%;
  height: 100% !important;
  min-height: 0; /* verhindert Überlauf in flexbox */
}
.badge-detail-header #segmentMap,
.badge-detail-header #poiMap {
  width: 95% !important;
  height: 30vh !important;
  display: block;
  align-self: center;
}
.badge-detail-header .card {
  width: 80%;
}
/* Badge Höhen Chart */
.badge-detail-header .card-body {
  width: 95%;
  margin-inline: auto;
  height: 350px;
  padding: 0;
}


.form-text {
  color: var(--text-muted-light)
}

/* Badge Counter Activity Ansicht */
.badge-count.badge-count-activity {
  position: absolute;
  top: -10px;
  right: -10px;
}

/* Badge Counter Detail Ansicht */
.badge-image-wrapper {
  position: relative;
  display: inline-block;
}
.badge-count-overlay {
  position: absolute;
  bottom: 240px;
  right: -10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-weight: 600;
  font-size: 1.3rem;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1;
}

.rank-gold   { color: #f4c542 !important; }   /* Gold */
.rank-silver { color: #c0c0c0 !important; }   /* Silber */
.rank-bronze { color: #cd7f32 !important; }   /* Bronze */

.subcat-heading {
  font-weight: 600;
  opacity: .9;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  grid-auto-rows: 1fr;
}

.calendar-cell.info-card.glass-tile {
  min-height: 100px;
  max-height: 120px;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-cell.info-card.glass-tile a {
  color: var(--text);
}

.calendar-cell ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.calendar-cell ul li {
  margin-bottom: 2px !important;
  padding: 0 !important;
  line-height: 1.2 !important;
  font-size: 0.72rem !important;
}

#activityPopup a {
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
}
#activityPopup a:hover {
  text-decoration: underline;
}

.leaflet-popup-content .wb-seg-popup .small { line-height: 1.25; }
.leaflet-popup-content .wb-seg-popup .fw-semibold { font-weight: 600; }
.leaflet-popup-content .wb-seg-popup i { opacity: .85; }

/* Container für Medaille + aufgedruckte Zahl */
.badge-count-activity .rank-medal{
  position: relative;
  display: inline-block;
  line-height: 1;
}

/* Medaillen-Icon (Größe bei Bedarf anpassen) */
.rank-medal-icon{
  font-size: 1.25rem;
  color:rgba(74, 83, 90, 0.8);
}

.rank-trophy-icon{
  font-size: 1.25rem;
  color: rgba(0, 0, 0, 0.7);
}
/* Platzierung mittig "auf" der Medaille */
.rank-ordinal-onmedal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%); /* leicht oberhalb der Mitte wirkt optisch zentrierter */
  font-size: 0.65rem;
  font-weight: 700;
  color: white;                      /* gut lesbar auf der Medaille */
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  pointer-events: none;             /* keine Klicks abfangen */
}

.toast.show {
  position: relative;
  opacity: 0.75 !important;
  font-weight: 600 !important;
  border-radius: 0.5rem;
  padding-right: 2.5rem;
}
.toast.show.text-bg-info {
  background-color: rgb(0, 0, 0) !important;
  color: white !important;
  font-weight: 600 !important;
}
.toast.show .btn-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
/* „th“ hochgestellt & dezent */
.rank-ordinal-onmedal sup {
  font-size: 0.7em;
  margin-left: 1px;
  color: rgb(197, 197, 197) !important;
}

.calendar-km-label {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0.5rem;
  font-size: clamp(0.65rem, 0.8vw, 0.85rem);
  text-align: right;
}

.calendar-title {
    text-align: center;
}

.year-link {
  border-radius: 6px;
  margin-bottom: 40px;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.year-link:hover {
  text-decoration: none;
  transform: scale(1.03);
}

.year-select-title {
    margin: 60px 0 60px 0;
  }

.container.custom-wide {
  max-width: 1600px;
}

.fallback-map {
  position: relative;
  overflow: hidden;
}


.fallback-map.with-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("..."); /* wird dynamisch via JS gesetzt */
  opacity: 0.3;
  z-index: 1;
}


.fallback-map .text-center {
  position: relative;
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 8px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 190px)); /* fixe Breite */
  gap: 1.5rem;
  justify-content: center;     /* verbleibenden Platz links lassen */
  margin: 0 auto;             /* Grid bei schmaleren Viewports zentrieren */
  max-width: calc(6 * 190px + 5 * 24px); /* maximal 6 Spalten + 5 Gaps = 1080px */
}

.badge-tile {
  position: relative;
  text-align: center;
  min-height: 250px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.badge-tile .badge-title {
  overflow: hidden;
}

.badge-tile:hover {
  transform: translateY(-5px);
}

.badge-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;   
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.5em;
  line-height: 1.5em;
  font-size: 0.85rem;
  color: var(--text-muted-light);
}


.badge-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.badge-tile.badge-locked .badge-icon {
  filter: grayscale(100%) brightness(0.6);
  opacity: 0.5;
}

.badge-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.badge-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-weight: bold;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.85rem;
}

.badge-count-no-background {
  position: absolute;
  top: -8px;
  right: -12px;
  background: none;
  color: white;
  font-weight: bold;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.85rem;
}

.badge-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
}

.badge-detail-header.glass-tile {
  backdrop-filter: blur(12px) saturate(180%);
  background-color: rgba(255,255,255,0.1);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.badge-detail-header {
  display:flex; 
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 400px!important;
  height: auto!important;
  padding: 2rem;
  text-align: center;
}

.badge-detail-header img.badge-icon {
  display: block;
  margin: 0 auto 1rem auto;
  width: 240px;
  height: 240px;
  object-fit: contain;
}

.badge-detail-header h2 {
  margin-bottom: 0.5rem;
}

.badge-detail-header p {
  margin-bottom: 0.3rem;
}


.badge-mini-strip {
  position: relative;
}

.badge-mini-strip a {
  display: inline-block;
  margin-left: -12px;
  position: relative;
  z-index: 1;
  border-radius: 40px;
  transition: transform 0.2s ease, z-index 0.2s;
  text-decoration: none;
}

.badge-mini-strip a:first-child {
  margin-left: 0;
}

.badge-mini-strip a:hover {
  z-index: 10;
  transform: scale(1.1);
}

.badge-mini {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 40px;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  display: block;
}

.badge-mini-strip a:hover .badge-mini {
  box-shadow: 4px 4px 8px rgba(0,0,0,0.3);
}


.badge-marker img {
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.badge-marker img:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}


/* === ROUTES LAYOUT === */
.routes-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* === GRID === */
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; /* geringerer Abstand */
  margin-bottom: 1rem;
}

/* === ROUTE-KACHEL === */
.route-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0.5rem; /* weniger vertikaler Abstand */
}

.route-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

/* === COVER (quadratisch & responsive) === */
.route-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-muted);
}

.route-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.route-cover[src*="previews/maps/"][src*="-schwarz.png"] {
  opacity: 0.55;
}

.route-cover[src*="previews/maps/"][src*="-weiss.png"] {
  opacity: 0.75;
}
/* Hover-Effekt für Previews: leicht sichtbar erhöhen */
.route-cover[src*="previews/maps/"][src*="-schwarz.png"]:hover {
  opacity: 0.7;
  transform: scale(1.05);
}

.route-cover[src*="previews/maps/"][src*="-weiss.png"]:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* Overlay-Farbton in Primärfarbe */
.route-cover-wrapper[data-has-custom-cover="false"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--primary, var(--route-accent, #3fa34d));
  opacity: 0.2;
  mix-blend-mode:color-burn;
  transition: opacity 0.3s ease;
}

/* Custom Covers – keine Färbung */
.route-cover-wrapper[data-has-custom-cover="true"]::after {
  content: none !important;
}

.route-card:hover .route-cover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* === BODY === */
.route-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  padding: 0.9rem 1rem 0.5rem;
}

.route-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.route-title-detail.editable-route-title {
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
  font-size: 2rem;
  cursor: pointer;
}

.route-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.route-title a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.route-desc {
  color: var(--text-muted-light);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* === STATS === */
.route-stats {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted-light);
}

.route-stats i {
  color: var(--accent-color);
  margin-right: 0.25rem;
}



/* ============================================
   ROUTE DETAIL SEITE – STYLING
============================================ */

/* Container allgemein */
.route-detail-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* === HERO-Bereich === */
.route-hero {
  position: relative;
  min-height: 480px;
  background-size: cover;
  background-position: center;
  border-radius: 24px !important;
  color: var(--text-light);
}

.route-hero > .route-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* füllt unverzerrt */
  object-position: center; /* zentriert */
  border-radius: inherit;
  pointer-events: none;    /* klicks gehen an Overlay/Form */
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  border-radius: inherit;
  overflow: auto;
}

/* === Karte === */
.route-map-wrapper {
  position: relative;
  height: 420px;
  min-height: 420px;
  overflow: hidden;
}

.route-map .folium-map {
  position: absolute !important;
  top: 0; left: 0;
  right: 0; bottom: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
}

.route-map .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  border-top-left-radius: 24px !important;
  border-top-right-radius: 24px !important;
}

/* Standard (helle Themes) */
.route-elevation {
  background-color: var(--bg-muted, #f9f9f9);
  color: var(--text, #222);
  overflow: hidden !important;
  border-bottom-left-radius: 24px !important;
  border-bottom-right-radius: 24px !important;
}

/* Dunkle Themes für route-chart*/
html.theme-dark .route-elevation,
html.theme-dark-midnight .route-elevation,
html.theme-dark-terminal .route-elevation,
html.theme-dark-strava .route-elevation,
html.theme-forest .route-elevation,
html.theme-concrete .route-elevation,
html.theme-dark-winered .route-elevation {
  background-color: var(--bg-muted, #2c2c2c);
  color: var(--text, #eee);
}

/* Violet etc. dürfen ihre eigenen Farben behalten */
html.theme-dark-violet .route-elevation {
  background-color: var(--bg-muted, #2c1d4f);
  color: var(--text, #e0d9f9);
}

.route-chart-wrapper {
  height: 200px;
  max-height: 30vh;
}

/* === Tabelle für Matches === */
.route-match-table tbody tr:hover {
  background-color: rgba(63, 163, 77, 0.05);
  cursor: pointer;
}

.route-match-table th {
  font-weight: 600;
}

.route-match-table td,
.route-match-table th {
  vertical-align: middle;
}

.route-match-table a {
  color: var(--accent);
}

.route-match-table a:hover {
  color: var(--primary);
  text-decoration: underline;
}



/* Fix: Chart-Hintergrund vollständig transparent machen */
#route-chart {
  background: transparent !important;
}

canvas#route-chart {
  background-color: transparent !important;
}

.route-chart-wrapper,
.route-chart-wrapper canvas {
  background: none !important;
  background-color: transparent !important;
}

/* ===============================
   ROUTE COVER IMAGE (quadratisch)
================================= */

/* Container fixiert das Seitenverhältnis */
#coverUploadForm {
  min-height: 200px;
  min-width: 33%;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 1 / 1 !important;
}
/* Das Bild selbst passt sich an, bleibt zentriert */
#routeCoverImage {
  min-height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border-radius: 24px;
}

/* Hover-Effekt für Interaktivität */
#routeCoverImage:hover {
  transform: scale(1.2);
  opacity: 0.9;
  cursor: pointer;
}

/* Positionierung des Löschbuttons */
#deleteCoverBtn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 50%;
  padding: 0.4rem 0.5rem;
}

#deleteCoverBtn:hover {
  opacity: 1;
  transform: scale(1.4);
}

#mapSection {
  height: 50em;
  isolation: isolate;
}

/* Summary Charts – feste Höhe, scrollt NICHT mit */
.summary-chart-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 260px;        /* hier limitierst du die Chart-Höhe */
  overflow: hidden;     /* falls Chart minimal rausläuft */
}

/* optional: etwas mehr Höhe für Jahreschart */
.summary-chart-container.summary-chart-year {
  height: 280px;
}

  /* Intensitätsfarben: Erholung blau; Grundlage grün; Tempo gelb; Schwelle/Hochaerob/VO2 orange; Anaerob/Sprint lila */
.intensity-easy {
  color: #3b82f6; /* blau */
}

.intensity-endurance {
  color: #22c55e; /* grün */
}

.intensity-tempo {
  color: #eab308; /* gelb */
}

.intensity-threshold,
.intensity-vo2,
.intensity-highaerobic {
  color: #f97316; /* orange */
}

.intensity-anaerobic,
.intensity-sprint {
  color: #a855f7; /* lila */
}

.intensity-unknown {
  color: #6b7280; /* grau */
}
.text-scrollable-wrapper {
  max-width: 100%;
  overflow: hidden;
}

/* JEDES scrollende Element bekommt seine eigene Scroll-Distanz */
.text-scrollable {
  display: inline-block;
  white-space: nowrap;
  transform: translateX(0);
  --scroll-distance: 0px;   /* Fallback, falls JS nicht läuft */
}

/* Hover startet die Animation nur für das Element, über dem die Maus ist */
.text-scrollable:hover {
  animation: text-bounce 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate;
}

@keyframes text-bounce {
  from {
    transform: translateX(0);
  }
  to {
    /* immer bis zum berechneten Ende scrollen */
    transform: translateX(calc(-1 * var(--scroll-distance)));
  }
}





@media (max-width: 1200px) {
  .card.glass-tile {
    height: 160px;
    min-height: 160px;
  }
  #mapSection {
    width: 100% !important;
    min-width: 100% !important;
    height: 67vh !important;
  }
}

@media (min-width: 2048px) {
  .dashboard-container {
    max-width: 80%;
  }
}


@media (max-width: 768px) {
  .year-link {
    margin-bottom: 0px;
  }
  .year-select-title {
    margin: 5px 0 5px 0;
  }
  .badge-detail-header .card {
    width: 100%;
    padding: 0;
  }
  .badge-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-width: calc(6 * 180px + 5 * 24px); /* maximal 6 Spalten + 5 Gaps = 1080px */
}
}

@media (max-width: 576px) {  
  #badgeMap,
  #poiMapCard { 
    height: 70vh; 
    min-height: 320px; 
  }

  #summaryBox {
    width: 100% !important;
    min-width: 100% !important;
  }

  #mapSection {
    width: 100% !important;
    min-width: 100% !important;
    height: 70vh !important;
  }
  .calendar-tile,
  .summary-box,
  .accordion,
  .outer-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .calendar-title {
     padding-left: 0px;
     padding-right: 0px;
  }

  body {
    padding: 5px !important;
    margin: 0px !important;
    padding-top: 64px !important;
    padding-bottom: 96px !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  .calendar-tile .calendar-chart-wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }

  .outer-grid {
  padding: 0 0%;
  }

  .workbench-title,
  .breadcrumb {
    margin: 0 4vw;
  }

  .dashboard-container {
    max-width: 100%;
  }

  .graph-wrapper-end {
    padding-bottom: 23rem !important;
  }

  .calendar-km-label {
    left: 0.5rem;
    text-align: left;
    padding: 0;
    margin: 0;
  }
  .calendar-tile.info-card.glass-tile .col {
    padding: 0.1rem;
    margin-top: 0.1rem;
  }
}
