/* ═══════════════════════════════════════════════
   MotoLiv MR — Premium Design System
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --primary:        #1d4ed8;
  --primary-dark:   #1e3a8a;
  --primary-light:  #3b82f6;
  --primary-glow:   rgba(29,78,216,.18);
  --accent:         #f97316;
  --accent-dark:    #ea6c0a;
  --success:        #059669;
  --danger:         #dc2626;
  --warning:        #d97706;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --surface-3:      #f1f5f9;
  --text:           #0f172a;
  --text-2:         #334155;
  --muted:          #64748b;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-md: 0 8px 16px -4px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 16px 32px -8px rgba(0,0,0,.12), 0 8px 12px -4px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 48px -12px rgba(0,0,0,.16);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --pill:      999px;

  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  --gradient-primary: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  --gradient-accent:  linear-gradient(135deg, #ea6c0a, #f97316, #fb923c);
  --gradient-success: linear-gradient(135deg, #047857, #059669);
  --gradient-card:    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.6));

  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .4s cubic-bezier(.4,0,.2,1);
}

/* ── Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

/* ── Navbar ────────────────────────────────────── */
.navbar {
  background: rgba(15,23,42,.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 12px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav .nav-link {
  font-weight: 500;
  font-size: .875rem;
  color: rgba(255,255,255,.75) !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.navbar-nav .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.08);
}

.navbar .badge-mode {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--pill);
  letter-spacing: .04em;
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.dropdown-item {
  border-radius: var(--radius-xs);
  font-size: .875rem;
  font-weight: 500;
  padding: 8px 12px;
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--surface-3); }

/* ── Buttons ───────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .01em;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(29,78,216,.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: 0 6px 20px rgba(29,78,216,.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,.35);
}
.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(249,115,22,.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(5,150,105,.3);
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(5,150,105,.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline-primary {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-pill { border-radius: var(--pill) !important; }
.btn-lg   { padding: 12px 28px; font-size: 1rem; }
.btn-sm   { padding: 5px 12px; font-size: .8rem; }

/* ── Cards ─────────────────────────────────────── */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  background: var(--surface);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-premium {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--border) !important;
}

/* Stat cards */
.stat-card {
  border-radius: var(--radius) !important;
  border: none !important;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.stat-card .stat-icon {
  font-size: 2rem;
  opacity: .85;
}
.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .8rem;
  font-weight: 500;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-blue    { background: var(--gradient-primary); color: #fff; }
.stat-orange  { background: var(--gradient-accent);  color: #fff; }
.stat-green   { background: var(--gradient-success); color: #fff; }
.stat-slate   { background: linear-gradient(135deg,#334155,#475569); color:#fff; }

/* Clickable table rows */
.order-row-hover:hover { background:#f8fafc; }

/* Order cards */
.order-card {
  border-left: 4px solid var(--primary) !important;
  border-radius: var(--radius) !important;
  background: var(--surface);
  transition: var(--transition);
}
.order-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
[dir="rtl"] .order-card {
  border-left: 1px solid var(--border) !important;
  border-right: 4px solid var(--primary) !important;
}

/* ── Status badges ─────────────────────────────── */
.badge {
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--pill) !important;
  padding: 4px 12px;
  font-size: .72rem;
}

.badge-pending    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-accepted   { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-pickup     { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-in_transit { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-delivered  { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.badge-cancelled  { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }

/* ── Forms ─────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs) !important;
  font-size: .9rem;
  padding: 10px 14px;
  transition: var(--transition);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ── Map ───────────────────────────────────────── */
.map-box {
  height: 380px;
  border-radius: var(--radius) !important;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.map-lg { height: 460px; }
@media (max-width: 768px) {
  .map-box { height: 260px; }
  .map-lg  { height: 300px; }
}

/* ── Timeline ──────────────────────────────────── */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute; left: 12px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--border));
  border-radius: 2px;
}
[dir="rtl"] .timeline { padding-left: 0; padding-right: 32px; }
[dir="rtl"] .timeline::before { left: auto; right: 12px; }

.tl-item { position: relative; margin-bottom: 20px; }
.tl-item::before {
  content: '';
  position: absolute; left: -24px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  transition: var(--transition);
}
[dir="rtl"] .tl-item::before { left: auto; right: -24px; }
.tl-item.done::before  { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.2); }
.tl-item.active::before { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }

/* ── Stars ─────────────────────────────────────── */
.star-group { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-group input { display: none; }
.star-group label { font-size: 2rem; color: var(--border); cursor: pointer; transition: var(--transition); }
.star-group input:checked ~ label,
.star-group label:hover,
.star-group label:hover ~ label { color: #fbbf24; transform: scale(1.1); }

/* ── Hint box ──────────────────────────────────── */
.hint-map {
  font-size: .82rem;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  color: #1e40af;
}

/* ── Price big ─────────────────────────────────── */
.price-big {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ── Hero (landing) ────────────────────────────── */
.hero {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 48px;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-emoji { font-size: 5rem; margin-bottom: 20px; display: block; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span {
  background: linear-gradient(135deg, #fb923c, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: rgba(255,255,255,.7); font-size: 1.1rem; max-width: 520px; margin: 0 auto 32px; }

/* ── Feature cards (landing) ───────────────────── */
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}
.feature-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}
.fi-blue   { background: #dbeafe; }
.fi-orange { background: #ffedd5; }
.fi-green  { background: #d1fae5; }
.fi-purple { background: #ede9fe; }

/* ── Steps (landing) ───────────────────────────── */
.step-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 6px 20px rgba(29,78,216,.3);
}

/* ── Pulse ─────────────────────────────────────── */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(5,150,105,.5); }
  70%  { box-shadow: 0 0 0 10px rgba(5,150,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}
.pulse { animation: pulse 2s infinite; }

/* ── Misc ──────────────────────────────────────── */
.dot-online  { color: var(--success); }
.dot-offline { color: var(--muted); }

.page-link { border-radius: var(--radius-xs) !important; font-weight: 500; }

.table { border-radius: var(--radius) !important; overflow: hidden; }
.table-hover tbody tr:hover { background: var(--surface-3); cursor: default; }
thead.table-light th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2) !important;
  padding: 12px 16px;
}
tbody td { padding: 14px 16px; vertical-align: middle; }

/* ── Footer ────────────────────────────────────── */
.footer {
  background: var(--text) !important;
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  padding: 20px 0;
  margin-top: auto;
}

/* ── Alert ─────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm) !important;
  border: none;
  font-size: .875rem;
  font-weight: 500;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Animations ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s cubic-bezier(.4,0,.2,1) both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ── Section header ────────────────────────────── */
.section-header {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Driver card ───────────────────────────────── */
.driver-stat-ring {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
}

/* ── Autocomplete dropdown ─────────────────────── */
.ac-wrap { position: relative; }

.ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}

.ac-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: .875rem;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--surface-3); }
.ac-item-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #dbeafe;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.ac-item-icon.dropoff { background: #ffedd5; }
.ac-item-text { line-height: 1.3; }
.ac-item-text strong { font-weight: 600; color: var(--text); }
.ac-item-text span { font-size: .75rem; color: var(--muted); }

/* ── Mobile tweaks ─────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 48px 20px; border-radius: var(--radius-lg); }
  .hero-emoji { font-size: 3.5rem; }
  main { padding: 0 8px; }
  .stat-card .stat-value { font-size: 1.8rem; }
}
