/* ==========================================================================
   2WHEEL CONNECT WEB APP STYLESHEET
   Supports Asphalt Gold (default), Midnight Road, Classic Themes
   ========================================================================== */

:root {
  /* Default Theme: Asphalt Gold */
  --asphalt-0: #0f1114;
  --asphalt-1: #15171c;
  --asphalt-2: #1d2026;
  --asphalt-3: #262a32;
  --primary: #E8A33D;
  --primary-dim: #C98A2E;
  --secondary: #C1443B;
  --bg: #15171C;
  --surface: #1D2026;
  --surface-variant: #262A32;
  --text: #EDEBE4;
  --text-muted: #B9C1CB;
  --line: #33383F;

  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 12px;
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Midnight Road Theme */
body[data-theme="midnight"] {
  --asphalt-0: #050b12;
  --asphalt-1: #09131d;
  --asphalt-2: #101e2a;
  --asphalt-3: #1b2b39;
  --primary: #43E0C2;
  --primary-dim: #006B5B;
  --secondary: #FFB870;
  --bg: #09131D;
  --surface: #101E2A;
  --surface-variant: #1B2B39;
  --text: #E6F0F4;
  --text-muted: #B9CAD3;
  --line: #334957;
}

/* Classic Theme */
body[data-theme="classic"] {
  --asphalt-0: #09090a;
  --asphalt-1: #0f0f10;
  --asphalt-2: #171719;
  --asphalt-3: #222226;
  --primary: #FF2E51;
  --primary-dim: #D11D3D;
  --secondary: #FF5E3A;
  --bg: #0F0F10;
  --surface: #171719;
  --surface-variant: #222226;
  --text: #EEEEEE;
  --text-muted: #B0B0B8;
  --line: #2D2D32;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.text-accent { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Layout Structure */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 9999;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--primary);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
}
.brand-title span {
  color: var(--primary);
}

.badge-beta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-variant);
  color: var(--primary);
  border: 1px solid var(--line);
}

.btn-radar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-radar-toggle.active {
  background: var(--primary);
  color: var(--asphalt-0);
  border-color: var(--primary);
}

/* Content Container */
.content-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 90px;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 9999;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  transition: color 0.2s ease;
}

.nav-item i {
  font-size: 1.25rem;
}

.nav-item.active {
  color: var(--primary);
}

/* Tab Pages */
.tab-page {
  display: none;
}
.tab-page.active {
  display: block;
}

/* Cards & Components */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* News List & Cards */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
}
.news-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.news-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.news-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.news-card-body {
  padding: 20px;
}
.news-date-badge {
  display: inline-block;
  background: rgba(232, 163, 61, 0.12);
  border: 1px solid rgba(232, 163, 61, 0.25);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.news-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.3;
}
.news-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Spot GPS Notice Box */
.spot-gps-notice {
  background: rgba(232, 163, 61, 0.12);
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}
.spot-gps-notice i {
  font-size: 1.35rem;
  margin-top: 2px;
  color: var(--primary);
  flex-shrink: 0;
}
.spot-gps-notice strong {
  display: block;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.spot-gps-notice p {
  color: var(--text-muted);
  margin: 0;
}
.spot-gps-notice u {
  color: var(--text);
  text-decoration-color: var(--primary);
}

.alert-banner {
  background: rgba(193, 68, 59, 0.15);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text);
}
.alert-banner .alert-icon {
  color: var(--secondary);
  font-size: 1.5rem;
}
.alert-banner strong {
  color: var(--secondary);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--asphalt-0);
}
.btn-primary:hover {
  background: var(--primary-dim);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: #c1443b;
  color: #fff;
}

.btn-accent {
  background: var(--surface-variant);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-input {
  width: 100%;
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Live Radar Card */
.radar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface-variant);
}
.status-badge.online {
  color: #25D366;
}
.status-badge.offline {
  color: var(--text-muted);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.online .pulse-dot {
  box-shadow: 0 0 8px #25D366;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.active-riders-counter {
  text-align: center;
  padding: 16px 0;
}
.counter-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  display: block;
}
.counter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Riders Grid */
.riders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.rider-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.rider-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}
.rider-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--asphalt-0);
  font-weight: 800;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rider-info h4 {
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.rider-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Map Section */
#tab-map.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 165px);
}
.map-wrapper {
  position: relative;
  flex: 1;
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
#leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* OpenStreetMap Dark Mode Filter (Optional Toggle) */
#leaflet-map.osm-dark-mode .leaflet-tile-pane {
  filter: brightness(0.68) invert(1) contrast(3) hue-rotate(200deg) saturate(0.32);
}
.map-warning-overlay {
  background: rgba(193, 68, 59, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.map-legend-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  background: rgba(23, 26, 31, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1001;
  font-size: 0.8rem;
}

/* Leaflet Custom Popup Styling */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
}
.leaflet-popup-tip {
  background: var(--surface) !important;
}

/* Feed Section */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.feed-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.feed-body {
  padding: 14px;
}
.feed-author {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.feed-caption {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
}
.feed-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Profile / Garage */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
}
.profile-avatar-container {
  position: relative;
  cursor: pointer;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}
.profile-avatar-fallback {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--asphalt-0);
  font-size: 2.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
}
.profile-avatar-container:hover .avatar-edit-overlay {
  opacity: 1;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.tag {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--primary);
}

.service-list {
  margin-top: 14px;
}
.service-item {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* SOS Section */
.sos-container {
  padding: 40px 0;
}
.sos-icon-pulse {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(193, 68, 59, 0.15);
  border: 3px solid var(--secondary);
  color: var(--secondary);
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(193, 68, 59, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(193, 68, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(193, 68, 59, 0); }
}

/* Themes Options */
.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.theme-option {
  cursor: pointer;
}
.theme-option input {
  display: none;
}
.theme-preview {
  background: var(--surface-variant);
  border: 2px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s;
}
.theme-preview strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}
.theme-option input:checked + .theme-preview {
  border-color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  margin: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.backup-code-box {
  background: var(--surface-variant);
  border: 2px dashed var(--primary);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* Top bar cockpit toggle button */
.btn-cockpit-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-variant);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-cockpit-toggle:hover {
  background: var(--primary);
  color: var(--asphalt-0);
}

/* Segment Control */
.segment-control {
  display: flex;
  background: var(--surface-variant);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  gap: 6px;
}
.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.segment-btn:hover {
  color: var(--text);
}
.segment-btn.active {
  background: var(--primary);
  color: var(--asphalt-0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Events */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.15s;
}
.event-card:hover {
  border-color: var(--primary);
}
.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.event-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.event-date-chip {
  background: var(--surface-variant);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.event-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.event-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-line;
}
.event-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.btn-event-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-event-nav:hover {
  background: var(--primary);
  color: var(--asphalt-0);
  border-color: var(--primary);
}

/* Tour Recording Bar */
.tour-recording-bar {
  position: absolute;
  bottom: 20px;
  left: 14px;
  right: 14px;
  background: rgba(23, 26, 31, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.tour-status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tour-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
}
.tour-dot.recording {
  background: #ff3344;
  box-shadow: 0 0 10px #ff3344;
  animation: pulse-border 1.5s infinite;
}
.tour-stats {
  display: flex;
  flex-direction: column;
}
.tour-time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.tour-dist {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-tour-rec {
  background: var(--primary);
  color: var(--asphalt-0);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-tour-rec.recording {
  background: #ff3344;
  color: #fff;
}
.btn-tour-mgr {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-tour-mgr:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Saved Routes */
.saved-routes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}
.route-item {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.route-item-info h4 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}
.route-item-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.route-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-route-action {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-route-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-route-action.btn-route-del:hover {
  border-color: #ff4444;
  color: #ff4444;
}

/* Digital Live Cockpit */
.cockpit-modal-card {
  max-width: 580px;
  background: #0d0f12;
  border: 2px solid var(--primary);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(232, 163, 61, 0.2);
}
.cockpit-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}
.cockpit-speedo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 10px;
  background: radial-gradient(circle, #1a1e26 0%, #0d0f12 75%);
  border-radius: 16px;
  border: 1px solid var(--line);
  position: relative;
}
.speedo-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.speedo-number {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -2px;
  text-shadow: 0 0 20px rgba(232, 163, 61, 0.4);
}
.speedo-unit {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}
.cockpit-trips {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cockpit-trips span strong {
  color: var(--text);
  font-family: var(--font-mono);
}

/* Lean Angle Section */
.lean-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lean-title-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lean-visual-box {
  width: 180px;
  height: 120px;
  border-radius: 10px;
  background: #090a0d;
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lean-horizon-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  top: 50%;
}
.lean-bike-wrapper {
  transition: transform 0.1s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}
.lean-bike-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}
.lean-degrees-box {
  text-align: center;
}
.lean-deg-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.lean-deg-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lean-records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.lean-record-card {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}
.lean-record-card.record-left {
  border-left: 3px solid #3da9fc;
}
.lean-record-card.record-right {
  border-right: 3px solid #ff5964;
}
.lean-rec-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.lean-rec-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.cockpit-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}
.cockpit-btn {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cockpit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Onboarding Pending Animation */
.pending-icon-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pending-spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(232, 163, 61, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}
.pending-icon {
  font-size: 2.5rem;
  animation: pulse-icon 2s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
  .top-bar { padding: 10px 14px; }
  .content-container { padding: 12px; padding-bottom: 80px; }
  .profile-header { flex-direction: column; text-align: center; }
  .tag-row { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .tour-recording-bar { bottom: 75px; }
}

/* ==========================================================================
   GLOBALER BIKER LIVE CHAT
   ========================================================================== */
#tab-chat.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 165px);
}
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-variant);
}
.chat-badge-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #43E0C2;
  background: rgba(67, 224, 194, 0.12);
  border: 1px solid rgba(67, 224, 194, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43E0C2;
  box-shadow: 0 0 8px #43E0C2;
  animation: pulse-icon 1.8s infinite;
}
.chat-messages-box {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.chat-msg-row.me {
  justify-content: flex-end;
}
.chat-msg-row.other {
  justify-content: flex-start;
}
.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
  flex-shrink: 0;
}
.chat-msg-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-variant);
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-msg-content {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.chat-msg-row.me .chat-msg-content {
  align-items: flex-end;
}
.chat-msg-row.other .chat-msg-content {
  align-items: flex-start;
}
.chat-msg-sender {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg-row.me .chat-msg-bubble {
  background: var(--primary);
  color: var(--asphalt-0);
  font-weight: 500;
  border-bottom-right-radius: 2px;
}
.chat-msg-row.other .chat-msg-bubble {
  background: var(--surface-variant);
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.chat-msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-mono);
}
.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-variant);
}
.chat-input-bar input {
  flex: 1;
}
.chat-input-bar button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* ==========================================================================
   COMMUNITY MOMENTE: LIKES & KOMMENTARE
   ========================================================================== */
.feed-actions-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.btn-feed-action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.btn-feed-action:hover {
  background: var(--surface-variant);
  color: var(--text);
}
.btn-feed-action.liked {
  color: #ff2e51;
}
.btn-feed-action.liked i {
  color: #ff2e51;
  animation: heart-pop 0.3s ease;
}
@keyframes heart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.feed-comments-section {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  display: none;
}
.feed-comments-section.open {
  display: block;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.comment-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
}
.comment-content {
  flex: 1;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.comment-author {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--primary);
}
.comment-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.comment-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.35;
}
.comment-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}
.comment-delete-btn:hover {
  color: #ff2e51;
}
.comment-input-row {
  display: flex;
  gap: 8px;
}
.comment-input-row input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
}
.comment-input-row button {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* ==========================================================================
   BIKER-EVENTS: ARCHIV VERGANGENER TERMINE
   ========================================================================== */
.events-archive-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 24px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  transition: background 0.2s ease;
}
.events-archive-toggle:hover {
  background: var(--line);
}
.events-archive-container {
  display: none;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.events-archive-container.open {
  display: flex;
}
.event-card.past {
  opacity: 0.65;
  border-style: dashed;
  filter: grayscale(0.2);
}
