/*
 * RouteHome – css/themes.css
 * Pfad: css/themes.css
 * → routehome\css\themes.css
 *
 * Zweck: Leaflet Dark Mode Anpassungen,
 *        Tab-Panel Inhalte, Dashboard-Komponenten.
 */

/* ═══════════════════════════════════════════════════════════════
   1. LEAFLET DARK MODE FIX
═══════════════════════════════════════════════════════════════ */
.leaflet-container {
  background: #0B132B !important;
  font-family: var(--font-body) !important;
}

[data-theme="light"] .leaflet-container {
  background: #e8f0fe !important;
}

/* Leaflet Attribution */
.leaflet-control-attribution {
  background: rgba(11, 19, 43, 0.75) !important;
  color: var(--c-text-muted) !important;
  font-size: 9px !important;
  backdrop-filter: blur(4px);
}

[data-theme="light"] .leaflet-control-attribution {
  background: rgba(255,255,255,0.8) !important;
  color: #666 !important;
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
  background: var(--c-bg-surface) !important;
  color: var(--c-text-primary) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--c-border-strong) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
}

.leaflet-popup-tip {
  background: var(--c-bg-surface) !important;
}

.leaflet-popup-close-button {
  color: var(--c-text-muted) !important;
  font-size: 16px !important;
}

/* ═══════════════════════════════════════════════════════════════
   2. TAB-PANEL ROUTE – Dashboard Inhalt
═══════════════════════════════════════════════════════════════ */

/* Routen-Vergleich Karten */
.route-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.route-compare-card {
  background: var(--c-bg-elevated);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.route-compare-card.recommended {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, var(--c-bg-elevated), rgba(34,197,94,0.05));
}

.route-compare-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.route-compare-card__time {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--c-text-primary);
}

.route-compare-card__details {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-compare-card__status {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  background: var(--c-bg-card);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  margin-top: var(--sp-1);
}

/* Schnellste Badge */
.badge-fastest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--c-green);
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: var(--r-full);
}

/* ═══════════════════════════════════════════════════════════════
   3. BORDER LIST – Grenz-Monitor
═══════════════════════════════════════════════════════════════ */
#border-list-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* ═══════════════════════════════════════════════════════════════
   4. TAB-PANEL SAFETY – Sicherheits-Inhalte
═══════════════════════════════════════════════════════════════ */
.fatigue-widget {
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.fatigue-widget__bar-wrap { flex: 1; }

.fatigue-widget__label {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  margin-bottom: 4px;
}

.fatigue-widget__track {
  height: 8px;
  background: var(--c-bg-card);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.fatigue-widget__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-green), var(--c-yellow));
  border-radius: var(--r-full);
  transition: width 0.5s linear;
}

.fatigue-widget__time {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   5. MORE PANEL – Mehr-Grid
═══════════════════════════════════════════════════════════════ */
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.more-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2);
  background: var(--c-bg-elevated);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 80px;
  transition: all var(--dur-fast);
}

.more-tile:active {
  transform: scale(0.95);
  border-color: var(--c-blue);
  background: var(--c-blue-soft);
}

.more-tile__icon { font-size: 1.6rem; }

.more-tile__name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-text-secondary);
  text-align: center;
}

/* Premium Teaser */
.premium-teaser {
  background: linear-gradient(135deg, var(--c-bg-elevated), rgba(244,208,63,0.08));
  border: 1.5px solid rgba(244, 208, 63, 0.3);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
}

.premium-teaser__title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}

.premium-teaser__text {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--sp-4);
  background: linear-gradient(135deg, var(--c-yellow), #E67E22);
  color: #0B132B;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  border-radius: var(--r-md);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(244,208,63,0.3);
  transition: transform var(--dur-fast);
}

.btn-upgrade:active { transform: scale(0.97); }

/* ═══════════════════════════════════════════════════════════════
   6. WAKELOCK BADGE ANIMATION
═══════════════════════════════════════════════════════════════ */
.wakelock-badge__dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════
   7. RESPONSIVE ANPASSUNGEN
═══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 380px) {
  .route-compare { grid-template-columns: 1fr; }
  .more-grid     { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (orientation: landscape) and (min-width: 768px) {
  .route-compare { grid-template-columns: 1fr; }
}
