/* ============================================================
   EthioRoute — Global Design System (main.css)
   Light mode, Ethiopian gold accents, Amharic font support
   ============================================================ */

/* --- Fonts (local, cached by Service Worker) --- */
@font-face {
  font-family: 'Noto Sans Ethiopic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/NotoSansEthiopic-Regular.woff2') format('woff2'),
    url('../fonts/NotoSansEthiopic-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Sans Ethiopic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/NotoSansEthiopic-Bold.woff2') format('woff2'),
    url('../fonts/NotoSansEthiopic-Bold.ttf') format('truetype');
}

/* --- CSS Custom Properties --- */
:root {
  /* Palette — Light Mode */
  --bg-0: #F8F9FA;
  --bg-1: #FFFFFF;
  --bg-2: #F1F3F5;
  --bg-3: #DEE2E6;
  --accent: #D4960C;
  --accent-dim: #B8820A;
  --accent-glow: rgba(212, 150, 12, 0.15);
  --text-primary: #1A1A1A;
  --text-secondary: #495057;
  --text-muted: #868E96;
  --danger: #FA5252;
  --success: #40C057;
  --info: #228BE6;
  --warning: #FAB005;
  --lrt-blue: #1C7ED6;
  --lrt-green: #37B24D;
  --anbessa: #E03131;
  --minibus: #1971C2;

  /* Spacing */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 32px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.25s;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans Ethiopic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- SPLASH SCREEN --- */
#splash-screen {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  animation: splashFadeIn 0.8s ease-out;
}

@keyframes splashFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}

.splash-title {
  font-size: 32px;
  font-weight: 800;
  color: #1A1A1A;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.splash-subtitle {
  margin-bottom: 36px;
}

.splash-loader {
  width: 48px;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.splash-loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  background: var(--accent);
  border-radius: 2px;
  animation: splashLoad 1.2s infinite ease-in-out alternate;
}

@keyframes splashLoad {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* --- HEADER --- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  background: #FFFFFF;
  border-bottom: 1px solid #E9ECEF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  will-change: transform;
}

#logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

#logo svg {
  width: 30px;
  height: 30px;
}

#logo-text {
  font-size: 19px;
  font-weight: 800;
  /* Extra bold like screenshot */
  letter-spacing: -0.5px;
  color: var(--accent);
  transition: opacity 0.2s ease;
}

#logo:active #logo-text {
  opacity: 0.7;
}

/* --- SEARCH BAR --- */
#search-wrapper {
  flex: 1;
  position: relative;
}

#search-input {
  width: 100%;
  height: 38px;
  background: #F1F3F5;
  border: 1px solid #DEE2E6;
  border-radius: 12px;
  color: #1A1A1A;
  font-family: inherit;
  font-size: 14px;
  padding: 0 14px 0 38px;
  outline: none;
  transition: all var(--dur) var(--ease);
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* --- HEADER BUTTONS --- */
.hdr-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid #DEE2E6;
  background: var(--bg-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.hdr-btn:hover {
  background: var(--bg-3);
  border-color: #ADB5BD;
  color: var(--text-primary);
}

.hdr-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* Language toggle pill */
#lang-toggle {
  font-size: 13px;
  justify-content: center;
}

/* --- SEARCH DROPDOWN --- */
#search-results {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 28px));
  background: var(--bg-1);
  border: 1px solid #DEE2E6;
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  overflow: hidden;
  z-index: 1100;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
  display: none;
}

#search-results.open {
  display: block;
  animation: slideDown 0.18s var(--ease);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #E9ECEF;
  transition: background var(--dur) var(--ease);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: var(--bg-3);
}

.result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  flex-shrink: 0;
}

.result-icon img {
  width: 20px;
  height: 20px;
}

.result-text {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.result-name-am {
  font-size: 12px;
  color: var(--accent);
  font-family: 'Noto Sans Ethiopic', sans-serif;
}

.result-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.result-sponsored {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.result-suggest {
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}

.result-suggest:hover {
  background: var(--accent-glow);
}

/* --- FAB BUTTONS --- */
#fabs {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.fab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 24px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s var(--ease),
    background-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
  font-family: inherit;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.fab:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.fab:active {
  transform: scale(0.96);
}

.fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#btn-waiting {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  color: #495057;
}

#btn-waiting.active {
  background: #ffaa00;
  border-color: #ffaa00;
  color: #000;
  animation: pulse-waiting 2s infinite ease-in-out;
}

@keyframes pulse-waiting {

  0%,
  100% {
    box-shadow: 0 0 16px 6px rgba(255, 170, 0, 0.4);
    opacity: 1;
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 4px 0px rgba(255, 170, 0, 0.1);
    opacity: 0.85;
    transform: scale(0.96);
  }
}

#btn-onbus {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  color: #495057;
}

#btn-onbus.active {
  background: #00cc66;
  /* Vibrant active color */
  color: #fff;
  animation: pulse-onbus 2s infinite ease-in-out;
}

@keyframes pulse-onbus {

  0%,
  100% {
    box-shadow: 0 0 16px 6px rgba(0, 204, 102, 0.7);
    opacity: 1;
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 4px 0px rgba(0, 204, 102, 0.2);
    opacity: 0.75;
    transform: scale(0.96);
  }
}

#btn-going-back {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  color: #495057;
}

#btn-going-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#btn-going-back.active {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #000;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  animation: toastIn 0.25s var(--ease);
  pointer-events: auto;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

.toast.info {
  border-color: var(--info);
  color: var(--info);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-sheet {
  width: min(520px, 100%);
  background: var(--bg-1);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 28px 24px 40px;
  animation: sheetUp 0.25s var(--ease);
  border-top: 1px solid #DEE2E6;
}

@keyframes sheetUp {
  from {
    transform: translateY(60px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* --- FORM CONTROLS (shared) --- */
.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid #DEE2E6;
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color var(--dur);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
}

.form-select option {
  background: var(--bg-2);
}

.btn-primary {
  width: 100%;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--accent);
  border: none;
  color: #000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur), transform 0.15s;
}

.btn-primary:hover {
  background: #d4b03e;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  #logo-text {
    display: none;
  }

  .hdr-btn span {
    display: none;
  }

  .hdr-btn {
    padding: 0 10px;
    min-width: 36px;
    justify-content: center;
  }

  .fab span {
    display: none;
  }

  .fab {
    width: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

/* User Location & Compass Marker */
.user-location-marker {
  position: relative;
  width: 32px;
  height: 32px;
}

.user-location-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: rgba(33, 150, 243, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-gps 2s infinite ease-out;
}

.user-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #2196F3;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.user-location-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid rgba(255, 68, 68, 0.8);
  transform-origin: center 10px;
  transform: translate(-50%, -24px);
  /* will also conditionally rotate */
  z-index: 1;
}

.driving-mode .user-location-dot {
  background: #eab135;
  /* Gold for driving indicator */
}

.driving-mode .user-location-arrow {
  border-bottom: 20px solid #eab135;
}

@keyframes pulse-gps {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ============================================================
   WELCOME INFO PANEL
   First-visit onboarding modal — centered, gold accents
   ============================================================ */

#welcome-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: welcomeFadeIn 0.22s ease-out;
}

#welcome-modal.hidden {
  display: none;
}

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

.welcome-card {
  width: min(420px, 100%);
  background: var(--bg-1);
  border-radius: var(--r-xl);
  padding: 28px 24px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  border: 1px solid #E9ECEF;
  animation: welcomeScaleUp 0.24s cubic-bezier(0.34, 1.3, 0.64, 1);
  position: relative;
}

@keyframes welcomeScaleUp {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.welcome-card-header {
  margin-bottom: 20px;
}

.welcome-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 6px;
}

.welcome-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.welcome-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* Numbered steps */
.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.welcome-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.welcome-step-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-step-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

.welcome-step-keyword {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid rgba(212, 150, 12, 0.3);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dim);
  font-family: inherit;
}

/* Divider */
.welcome-divider {
  border: none;
  border-top: 1px solid var(--bg-3);
  margin: 16px 0;
}

/* Data scarcity notice */
.welcome-notice {
  background: #FFFBF0;
  border: 1px solid rgba(212, 150, 12, 0.35);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin-bottom: 20px;
}

.welcome-notice-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-dim);
  margin-bottom: 4px;
}

.welcome-notice-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Dismiss button */
.welcome-dismiss {
  width: 100%;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--accent);
  border: none;
  color: #000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.1px;
  transition: background 0.18s ease-out, transform 0.15s ease-out;
}

.welcome-dismiss:hover {
  background: var(--accent-dim);
}

.welcome-dismiss:active {
  transform: scale(0.97);
}