/* ==========================================================================
   TRACCAR LIVE TELEMETRY - COMPONENT STYLES
   ========================================================================== */

/* ==========================================================================
   1. SPEEDOMETER & GAUGE CARD
   ========================================================================== */

.gauge-card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 24, 38, 0.95) 0%, rgba(12, 16, 26, 0.98) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 16px 18px 18px 18px;
}

.gauge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  width: 100%;
}

.card-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.card-title-main .title-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
}

.motion-chip-wrap {
  display: flex;
  align-items: center;
}

.live-chip {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-chip.idle {
  background: rgba(255, 214, 0, 0.15);
  color: var(--accent-yellow);
  border-color: rgba(255, 214, 0, 0.35);
}

.live-chip.stopped {
  background: rgba(255, 23, 68, 0.15);
  color: var(--accent-red);
  border-color: rgba(255, 23, 68, 0.35);
}

.gauge-container {
  position: relative;
  width: 100%;
  max-width: 270px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speed-gauge-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}

.gauge-bg-arc {
  stroke: rgba(255, 255, 255, 0.08);
}

.gauge-zone-green {
  stroke: rgba(0, 230, 118, 0.25);
}

.gauge-zone-yellow {
  stroke: rgba(255, 214, 0, 0.25);
}

.gauge-zone-red {
  stroke: rgba(255, 23, 68, 0.25);
}

.gauge-fill-arc {
  stroke: var(--accent-cyan);
  stroke-dasharray: 283;
  stroke-dashoffset: 283; /* Controlled by JS */
  filter: drop-shadow(0 0 10px var(--accent-cyan));
  transition: stroke-dashoffset 0.35s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.35s ease;
}

.gauge-center-content {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.speed-value {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 0.9;
  letter-spacing: -1.5px;
  text-shadow: 0 0 22px var(--accent-cyan-glow);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.speed-unit {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  margin-top: 4px;
}

.gauge-scale-labels {
  display: flex;
  justify-content: space-between;
  width: 92%;
  margin-top: -8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Speed Sub Grid (Avg & Max) */
.speed-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.sub-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sub-stat-label svg {
  width: 13px;
  height: 13px;
  color: var(--accent-blue);
}

.sub-stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-stat-value small {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   2. METRIC CARDS (DISTANCE TODAY & ODOMETER)
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 14px;
}

.metric-card.highlight-metric {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08) 0%, rgba(18, 24, 38, 0.8) 100%);
  border-color: rgba(0, 229, 255, 0.3);
}

.metric-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-wrap.distance-today {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
}

.metric-icon-wrap.distance-total {
  background: rgba(41, 121, 255, 0.15);
  border: 1px solid rgba(41, 121, 255, 0.3);
  color: var(--accent-blue);
}

.metric-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.metric-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 2px 0;
}

.metric-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.metric-unit {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-footer-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--text-secondary);
}

.metric-footer-info svg {
  width: 11px;
  height: 11px;
  color: var(--accent-cyan);
}

/* ==========================================================================
   3. SENSORS & TELEMETRY STATUS LIST
   ========================================================================== */

.status-sensors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.sensor-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sensor-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
}

.sensor-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sensor-badge.badge-on {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.sensor-badge.badge-off {
  background: rgba(255, 23, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.sensor-val-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.sensor-val-bar span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.battery-mini-bar {
  width: 60px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.battery-fill {
  height: 100%;
  background: var(--accent-green);
  transition: width 0.4s ease, background-color 0.4s ease;
}

.sensor-coord-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  transition: var(--transition-fast);
}

.sensor-coord-link:hover {
  background: rgba(0, 229, 255, 0.2);
  text-decoration: underline;
}

/* ==========================================================================
   4. CHART CARD
   ========================================================================== */

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chart-header .section-title {
  margin-bottom: 0;
}

.chart-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glow);
}

.chart-wrapper {
  width: 100%;
  height: 120px;
  position: relative;
}

/* ==========================================================================
   5. LEAFLET CUSTOM VEHICLE MARKER & POPUP
   ========================================================================== */

.custom-vehicle-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.marker-beacon-pulse {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.25);
  animation: radar-pulse 2s infinite ease-out;
  pointer-events: none;
}

.marker-body-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan), 0 4px 10px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.marker-arrow-icon {
  width: 22px;
  height: 22px;
  fill: var(--accent-cyan);
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 4px var(--accent-cyan));
}

.marker-speed-tag {
  position: absolute;
  top: -24px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--accent-cyan);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Custom Leaflet Popups */
.leaflet-popup-content-wrapper {
  background: rgba(16, 21, 34, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glow) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 4px;
}

.leaflet-popup-tip {
  background: rgba(16, 21, 34, 0.92) !important;
  border: 1px solid var(--border-glow) !important;
}

.popup-telemetry-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  min-width: 200px;
}

.popup-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.popup-label {
  color: var(--text-muted);
}

.popup-val {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   6. MODAL & DIALOGS
   ========================================================================== */

.modal-backdrop, .device-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active, .device-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  width: 90%;
  max-width: 580px;
  background: #111726;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-dialog.share-dialog {
  max-width: 520px;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}

.modal-header, .device-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-cyan);
}

.modal-title h2, .device-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

/* Share Modal Info Box */
.share-info-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.share-info-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.share-info-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.share-info-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.copy-url-group {
  display: flex;
  gap: 8px;
}

.copy-url-group input {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.45);
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 255, 0.3);
}

.share-options-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.share-hint-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.share-hint-text svg {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* Tabs */
.config-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-cyan);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="text"],
input[type="url"],
input[type="password"],
select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.input-with-icon input {
  padding-left: 38px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

select {
  cursor: pointer;
}

select option {
  background: #111726;
  color: #ffffff;
}

.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.form-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.device-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-msg {
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  display: none;
}

.feedback-msg.success {
  display: block;
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.feedback-msg.error {
  display: block;
  background: rgba(255, 23, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.feedback-msg.info {
  display: block;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00c6eb, #0088cc);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.w-full {
  width: 100%;
}

.mt-3 {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

/* Toggle Switch Control */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-cyan);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.82rem;
  color: var(--text-primary);
}

/* ==========================================================================
   7. DEVICE SELECTOR DRAWER / MODAL
   ========================================================================== */

.device-modal-dialog {
  width: 90%;
  max-width: 420px;
  background: #111726;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.device-list-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.device-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.device-item-card:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--border-glow);
}

.device-item-card.active {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--accent-cyan);
}

.device-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.device-item-icon svg {
  width: 18px;
  height: 18px;
}

.device-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.device-item-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   8. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 21, 34, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.82rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
}

.toast-item.success {
  border-left: 4px solid var(--accent-green);
}

.toast-item.error {
  border-left: 4px solid var(--accent-red);
}

.toast-item.warning {
  border-left: 4px solid var(--accent-yellow);
}

.toast-item.info {
  border-left: 4px solid var(--accent-cyan);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   9. MOTORCYCLE DASHBOARD SPECIFIC COMPONENTS
   ========================================================================== */

/* Date Selector in Header */
.date-selector-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 4px;
  gap: 3px;
}

.date-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.date-pill-btn svg {
  width: 13px;
  height: 13px;
}

.date-pill-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.date-pill-btn.active {
  background: var(--accent-cyan);
  color: #0a0d14;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.icon-btn-refresh {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.icon-btn-refresh svg {
  width: 14px;
  height: 14px;
}

.icon-btn-refresh:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn-refresh.rotating svg {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Start Flag Marker on Map */
.leaflet-start-marker {
  background: transparent;
  border: none;
}

.start-flag-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.flag-icon {
  font-size: 22px;
  line-height: 1;
}

.flag-tag {
  background: #111726;
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 1px;
}

/* Speed Legend Overlay */
.speed-legend-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(16, 21, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.legend-title {
  font-weight: 700;
  color: var(--text-primary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-color.green { background: #00e676; box-shadow: 0 0 6px #00e676; }
.legend-color.yellow { background: #ffd600; box-shadow: 0 0 6px #ffd600; }
.legend-color.red { background: #ff1744; box-shadow: 0 0 6px #ff1744; }

/* Distance Hero Box */
.distance-hero-box {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08) 0%, rgba(41, 121, 255, 0.04) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 12px;
}

.hero-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.hero-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.hero-unit {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Address Card */
.address-display-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.addr-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 2px;
}

.address-actions {
  display: flex;
  justify-content: flex-end;
}

.addr-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition-fast);
}

.addr-link-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.addr-link-btn svg {
  width: 13px;
  height: 13px;
}

/* Chart Minimize */
.chart-card.minimized .chart-wrapper {
  display: none;
}

/* Language Selector Pills */
.lang-selector-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 4px;
  gap: 2px;
}

.lang-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-pill-btn:hover {
  color: var(--text-primary);
}

.lang-pill-btn.active {
  background: var(--accent-cyan);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

