/* Geo Go — premium Telegram Mini App (Uber / Yandex Go uslubi).
 * Aksent #3b6cff, pin #5b5bff. Shrift Inter. Silliq animatsiyalar, micro-interactions. */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #0b1220);
  --hint: var(--tg-theme-hint-color, #8b93a3);
  --card: var(--tg-theme-secondary-bg-color, #f5f6f8);
  --line: #eceef2;
  --blue: #3b6cff;
  --blue-dark: #2b54e0;
  --violet: #5b5bff;
  --green: #25c26e;
  --red: #ff4d4f;
  --r-lg: 22px;
  --r-md: 16px;
  --shadow: 0 8px 30px rgba(11,18,32,.16);
  --shadow-sm: 0 3px 14px rgba(11,18,32,.12);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tg-theme-bg-color, #0f1116);
    --text: var(--tg-theme-text-color, #f3f5f9);
    --hint: var(--tg-theme-hint-color, #8b93a3);
    --card: var(--tg-theme-secondary-bg-color, #1a1d25);
    --line: #262a33;
    --shadow: 0 8px 30px rgba(0,0,0,.5);
    --shadow-sm: 0 3px 14px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
.muted { color: var(--hint); }
button { font-family: inherit; }

#map { position: absolute; inset: 0; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; background: var(--bg);
  transition: opacity .5s var(--ease), visibility .5s;
}
.splash.gone { opacity: 0; visibility: hidden; }
.splash-logo {
  font-size: 40px; font-weight: 900; letter-spacing: -1px; color: var(--text);
  animation: rise .6s var(--ease-out) both;
}
.splash-logo span { color: var(--blue); }
.splash-dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- Radar pulse (qidiruv) ---------- */
.radar {
  position: absolute; left: 50%; top: 50%; z-index: 4;
  transform: translate(-50%, -50%); pointer-events: none;
  width: 0; height: 0;
}
.radar span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,108,255,.35), rgba(59,108,255,0) 70%);
  animation: radar 2.4s var(--ease-out) infinite;
}
.radar span:nth-child(2) { animation-delay: .8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar {
  0% { width: 30px; height: 30px; opacity: .9; }
  100% { width: 280px; height: 280px; opacity: 0; }
}

/* ---------- Markaziy pin ---------- */
.center-pin {
  position: absolute; left: 50%; top: 50%; z-index: 5;
  transform: translate(-50%, -100%); pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.3));
  animation: pin-drop .45s var(--ease-out);
}
.center-pin.lift svg { transform: translateY(-6px); transition: transform .2s var(--ease); }
.pin-shadow {
  position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%);
  width: 12px; height: 5px; border-radius: 50%; background: rgba(0,0,0,.22);
  filter: blur(1px);
}
@keyframes pin-drop { from { transform: translate(-50%,-150%); opacity: .4; } }

/* ---------- Dumaloq tugmalar ---------- */
.round-btn {
  width: 46px; height: 46px; border: none; border-radius: 50%;
  background: var(--bg); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.round-btn:active { transform: scale(.9); }

/* ---------- Yuqori panel ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 0;
}
.topbar-title, .price-pill {
  background: var(--bg); padding: 10px 16px; border-radius: 24px; box-shadow: var(--shadow-sm);
  animation: rise .4s var(--ease-out) both;
}
.topbar-title { font-weight: 700; font-size: 15px; }
.price-pill { display: flex; align-items: baseline; gap: 4px; font-weight: 800; font-size: 16px; }
.price-pill-sub { font-size: 11px; font-weight: 600; color: var(--hint); }

.map-controls {
  position: absolute; right: 14px; bottom: 250px; z-index: 7;
  display: flex; flex-direction: column; gap: 12px;
}

/* ---------- Bottom sheet ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -8px 36px rgba(11,18,32,.18);
  max-height: 78%; overflow: hidden;
  animation: sheet-up .5s var(--ease-out) both;
  transition: transform .35s var(--ease);
}
.sheet.down { transform: translateY(110%); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-inner { padding: 0 18px; overflow-y: auto; max-height: calc(78vh - 40px); }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 3px; background: var(--line);
  margin: 8px auto 12px;
}
.sheet-title { font-size: 20px; font-weight: 800; margin: 2px 0 16px; letter-spacing: -.3px; }

/* Ekran o'tish animatsiyasi */
.screen { animation: screen-in .35s var(--ease-out) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Manzil qatorlari ---------- */
.addr-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--card); border: none; border-radius: var(--r-md);
  padding: 15px 16px; font-size: 16px; color: var(--text); text-align: left; cursor: pointer;
  transition: transform .12s var(--ease), background .15s;
}
.addr-row:active { transform: scale(.985); background: var(--line); }
.addr-divider { height: 10px; }
.addr-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--bg); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.pin { width: 13px; height: 13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.pin-violet { background: var(--violet); }
.pin-dark { background: var(--text); }
.addr-text { font-size: 16px; font-weight: 600; }

.saved-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.saved-chip {
  background: var(--card); border-radius: 22px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; border: none; color: var(--text); cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: transform .12s var(--ease), background .15s;
  animation: rise .4s var(--ease-out) both;
}
.saved-chip:active { transform: scale(.95); background: var(--line); }

/* ---------- Tarif kartalari ---------- */
.tariff-list { display: flex; flex-direction: column; gap: 11px; }
.tariff-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 2px solid transparent; border-radius: var(--r-md);
  padding: 14px 16px; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s, transform .12s;
  animation: rise .4s var(--ease-out) both;
}
.tariff-card:active { transform: scale(.985); }
.tariff-card.active { border-color: var(--blue); background: rgba(59,108,255,.08); }
.tariff-emoji {
  font-size: 30px; flex: none; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease-out);
}
.tariff-card.active .tariff-emoji { transform: scale(1.12); }
.tariff-mid { flex: 1; }
.tariff-name { font-weight: 700; font-size: 16px; }
.tariff-eta { color: var(--hint); font-size: 13px; margin-top: 2px; }
.tariff-price { font-weight: 800; font-size: 18px; white-space: nowrap; }

/* Shimmer skeleton */
.skeleton {
  border-radius: var(--r-md); height: 74px;
  background: linear-gradient(100deg, var(--card) 30%, var(--line) 50%, var(--card) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
  margin-bottom: 11px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Kuzatuv ---------- */
.status-line { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.status-line.arrived { color: var(--blue); animation: pop .4s var(--ease-out); }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.driver-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border-radius: var(--r-md); padding: 14px 16px;
  animation: rise .45s var(--ease-out) both;
}
.driver-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--bg); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; font-size: 25px;
}
.driver-main { flex: 1; min-width: 0; }
.driver-name { font-weight: 700; font-size: 16px; }
.driver-car { color: var(--hint); font-size: 14px; margin-top: 2px; }
.driver-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.driver-plate {
  font-weight: 800; font-size: 14px; letter-spacing: .5px;
  background: var(--bg); padding: 7px 11px; border-radius: 9px; box-shadow: var(--shadow-sm);
}
.call-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 4px 14px rgba(37,194,110,.4); transition: transform .15s var(--ease);
}
.call-btn:active { transform: scale(.9); }
.track-price { margin-top: 16px; font-size: 16px; font-weight: 600; }
.ghost-btn {
  width: 100%; margin-top: 14px; border: none; border-radius: var(--r-md);
  background: var(--card); color: var(--red); font-size: 15px; font-weight: 700; padding: 15px; cursor: pointer;
  transition: transform .12s var(--ease), background .15s;
}
.ghost-btn:active { transform: scale(.98); background: var(--line); }

/* Haydovchi pill-markeri */
.driver-marker {
  display: flex; align-items: center; gap: 7px;
  background: var(--blue); color: #fff; padding: 5px 12px 5px 5px;
  border-radius: 24px; box-shadow: 0 6px 18px rgba(59,108,255,.45);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.driver-marker .dm-ava {
  width: 28px; height: 28px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ---------- Yakun ---------- */
.done-check { text-align: center; font-size: 50px; animation: pop .5s var(--ease-out); }
.done-title { font-size: 22px; font-weight: 800; text-align: center; margin-top: 6px; }
.final-price { font-size: 32px; font-weight: 900; text-align: center; margin: 12px 0 20px; color: var(--blue); animation: rise .5s var(--ease-out) both; }
.rate-label { text-align: center; color: var(--hint); font-size: 14px; margin-bottom: 10px; }
.rate-stars { text-align: center; font-size: 40px; color: #d8dbe2; margin-bottom: 22px; }
.rate-stars span { cursor: pointer; padding: 0 4px; display: inline-block; transition: transform .15s var(--ease); }
.rate-stars span:active { transform: scale(1.3); }
.rate-stars span.on { color: #ffc83d; transform: scale(1.1); }

/* ---------- Asosiy tugma ---------- */
.primary-btn {
  width: 100%; border: none; border-radius: var(--r-md);
  background: var(--blue); color: #fff; font-size: 17px; font-weight: 700; padding: 17px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(59,108,255,.36);
  transition: transform .14s var(--ease), box-shadow .2s, background .2s;
  position: relative; overflow: hidden;
}
.primary-btn:active { transform: translateY(2px) scale(.99); box-shadow: 0 4px 12px rgba(59,108,255,.3); }
.primary-btn.floating {
  position: absolute; left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 9; width: auto;
  animation: rise .4s var(--ease-out) both;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; bottom: 100px; transform: translate(-50%, 16px);
  background: rgba(11,18,32,.94); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600; z-index: 20; max-width: 84%; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
