:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-2: #24243e;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #4a9eff;
  --accent-2: #2d7dd2;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --border: #333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* Offline-Banner */
.offline-banner {
  background: var(--warning);
  color: #000;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  font-weight: 600;
}
.hidden { display: none !important; }

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Views */
.view-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 16px;
  display: none;
}
.view.active { display: block; }

h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--accent);
}
.hint { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }

/* Buttons */
.btn-primary, .btn-secondary {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-primary:active, .btn-secondary:active { opacity: 0.7; }

/* Reisekarten */
.journey-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.journey-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.journey-card .leg {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.journey-card .leg:last-child { border-bottom: none; }
.leg-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
}
.leg-times {
  display: flex;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
}
.delay { color: var(--danger); font-weight: 600; }
.on-time { color: var(--success); }
.platform-change { color: var(--warning); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 { margin-bottom: 16px; }
.modal-content label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.modal-content input, .modal-content select {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.modal-content fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.modal-content legend {
  font-size: 12px;
  color: var(--accent);
  padding: 0 6px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions button { flex: 1; }

/* Journey Actions */
.journey-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.journey-actions button, .journey-actions label {
  font-size: 12px;
  padding: 8px 12px;
  flex: 1;
  text-align: center;
}

/* Check-in Button */
.btn-checkin {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
}

/* Live-Daten */
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  animation: pulse 2s infinite;
}
.live-indicator.offline { background: var(--warning); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Karte */
#map-content {
  height: 100%;
  min-height: 400px;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
