/* Interactive demo frame and shared iOS pieces (same as our other app sites).
   Car & Play's own screens are in carplay.css. */

/* ---------- iPhone ---------- */
.iphone {
  --frame: 12px;
  position: relative; width: 340px; max-width: calc(100vw - 56px); aspect-ratio: 340 / 720;
  padding: var(--frame); border-radius: 60px;
  background: linear-gradient(145deg, #5b5d63 0%, #2b2c30 18%, #1a1b1e 50%, #2e2f33 82%, #6a6c72 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,.18),
    inset 0 0 0 4px #0b0b0c,
    0 50px 90px -30px rgba(0, 0, 0, .7),
    0 18px 36px -18px rgba(0, 0, 0, .5);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; color-scheme: dark; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.iphone .btn-side { position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #45464b, #1c1d20); }
.iphone .btn-side.action { left: -3px; top: 15%; height: 4.5%; }
.iphone .btn-side.vol-up { left: -3px; top: 23%; height: 8%; }
.iphone .btn-side.vol-down { left: -3px; top: 33%; height: 8%; }
.iphone .btn-side.power { right: -3px; top: 27%; height: 13%; background: linear-gradient(270deg, #45464b, #1c1d20); }

.iscreen {
  position: absolute; inset: var(--frame); border-radius: 48px; overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  background: #0E0F11; color: #fff; isolation: isolate;
}
.island { position: absolute; z-index: 30; top: 11px; left: 50%; transform: translateX(-50%); width: 34%; height: 32px; border-radius: 20px; background: #000; pointer-events: none; }
.sb {
  position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 28px 0 40px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; pointer-events: none; color: #fff;
}
.sb .right { display: flex; gap: 6px; align-items: center; }
.sb svg { display: block; fill: currentColor; }
.home-ind { position: absolute; z-index: 45; bottom: 7px; left: 50%; transform: translateX(-50%); width: 36%; height: 5px; border-radius: 3px; background: #fff; opacity: .85; pointer-events: none; }

.app { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 54px; background: #0E0F11; color: #fff; }
.app.out { opacity: 0; transition: opacity .25s; }
.app.in { animation: appFade .3s ease; }
@keyframes appFade { from { opacity: 0; } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.tap { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tap:focus-visible { outline: 2px solid #00D46A; outline-offset: 2px; border-radius: 10px; }
.teal { color: #00D46A; }

/* iOS action sheet (dark) */
.asheet { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 0 8px 30px; animation: fadeIn .2s ease; }
.asheet .grp { border-radius: 14px; overflow: hidden; background: rgba(44,44,46,.96); animation: slideUp .28s cubic-bezier(.2,.9,.3,1); }
.asheet button { display: block; width: 100%; height: 50px; font-size: 17px; color: #0A84FF; border-top: .5px solid rgba(84,84,88,.6); }
.asheet .grp button:first-child { border-top: 0; }
.asheet .tap:focus-visible { outline-offset: -3px; border-radius: 12px; }
.asheet button.destructive { color: #FF453A; }
.asheet button.bold { font-weight: 600; }

/* iOS alert (dark) */
.ios-dim { position: absolute; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: grid; place-items: center; animation: fadeIn .18s ease; }
.ios-alert { width: 78%; border-radius: 16px; overflow: hidden; background: rgba(44,44,46,.97); color: #fff; text-align: center; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.ios-alert .body { padding: 18px 16px 16px; }
.ios-alert h5 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; }
.ios-alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.32; }
.ios-alert .btns { display: flex; border-top: .5px solid rgba(84,84,88,.6); }
.ios-alert .btns button { flex: 1; padding: 12px 6px; font-size: 16px; color: #0A84FF; font-family: inherit; background: none; border: 0; cursor: pointer; }
.ios-alert .btns button + button { border-left: .5px solid rgba(84,84,88,.6); }
.ios-alert .btns .bold { font-weight: 600; }
.ios-alert .btns .destructive { color: #FF453A; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { transform: scale(1.12); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }

/* toast */
.toast { position: absolute; z-index: 60; pointer-events: none; left: 50%; top: 62px; transform: translateX(-50%); width: 86%; background: rgba(58,60,66,.96); color: #fff; border-radius: 16px; padding: 11px 14px; font-size: 12.5px; line-height: 1.35; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .3s ease; }
.maps ~ .toast { top: 134px; }
.locbtn { transition: opacity .2s; }
.iscreen.toasting .locbtn { opacity: 0; }
.toast b { display: block; font-size: 14px; margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- Demo switch (above the phone) ---------- */
.demo-seg {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 340px; max-width: calc(100vw - 56px);
  padding: 3px; border-radius: 14px; background: color-mix(in srgb, var(--text) 8%, transparent);
}
.demo-seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0;
  padding: 8px 6px; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s;
}
.demo-seg button svg { width: 16px; height: 16px; flex: none; }
.demo-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 .5px rgba(255,255,255,.06); }
.demo-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- idle tour cursor ---------- */
.tcursor { position: absolute; z-index: 100; left: 0; top: 0; width: 22px; height: 26px; margin: -2px 0 0 -3px; pointer-events: none; opacity: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); transition-property: left, top; transition-timing-function: cubic-bezier(.45,.05,.25,1); }
.tcursor.show { opacity: 1; transition-property: left, top, opacity; }
.tcursor svg { display: block; width: 100%; height: 100%; transform-origin: 4px 3px; transition: transform .12s; }
.tcursor.press svg { animation: tPress .3s ease; }
.tcursor i { position: absolute; left: 4px; top: 3px; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid rgba(0, 212, 106, .85); opacity: 0; }
.tcursor.press i { animation: tRing .45s ease-out; }
@keyframes tPress { 50% { transform: scale(.85); } }
@keyframes tRing { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .tcursor { display: none; }
  .orb.pulse i, .ring-wave svg, .spin { animation: none; }
  .map-inner { transition: none; }
}

/* ---------- profile photos + Directions (maps app) ---------- */
.av.photo { background-size: cover; background-position: center; color: transparent; }
.asheet .ttl { margin: 0; padding: 13px 16px; text-align: center; font-size: 13px; color: #8E8E93; }
.asheet .ttl + button { border-top: .5px solid rgba(84,84,88,.6); }
.maps { position: absolute; inset: 0; z-index: 20; overflow: hidden; background: #2E3249; animation: appIn .35s cubic-bezier(.2,.9,.3,1); }
@keyframes appIn { from { transform: scale(.94); opacity: 0; } }
.maps .map-inner { transition: transform .8s cubic-bezier(.45,.05,.25,1); }
.maps .route { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.maps .pin.dst .av { width: 38px; height: 38px; border-color: #FF453A; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.maps .pin.dst.hl .av { box-shadow: 0 0 0 5px rgba(255,69,58,.3); }
.sb.crumbed > span:first-child { visibility: hidden; }
.crumb { position: absolute; z-index: 31; top: 18px; left: 22px; font-size: 12px; font-weight: 600; color: #fff; }
.mtop { position: absolute; z-index: 2; top: 56px; left: 10px; right: 10px; display: grid; gap: 7px; padding: 11px 14px; border-radius: 16px; background: rgba(28,30,36,.94); box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 13px; font-weight: 600; }
.mtop div { display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .dot { box-sizing: border-box; width: 12px; height: 12px; flex: none; border-radius: 50%; }
.mtop .dot.from { background: #1AA8F9; border: 2px solid #fff; }
.mtop .dot.to { background: #FF453A; }
.mbot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px 18px 30px; border-radius: 22px 22px 0 0; background: #1C1E24; box-shadow: 0 -6px 24px rgba(0,0,0,.35); }
.mbot .eta { display: flex; align-items: baseline; gap: 6px; }
.mbot .eta b { font-size: 22px; font-weight: 800; color: #00D46A; }
.mbot .eta span { font-size: 14px; color: #A3A8B0; }
.mbot .mode { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12.5px; color: #A3A8B0; }
.mbot .mode svg { width: 14px; height: 14px; }
.mnote { margin: 8px 0 12px; font-size: 11px; line-height: 1.35; color: #7C7C8A; }
.mstart { display: block; width: 100%; height: 44px; border-radius: 22px; background: #1AA8F9; color: #fff; font-weight: 700; font-size: 16px; }
.mstart.end { background: #FF453A; }
.mstart:disabled { opacity: .55; cursor: default; }
/* right-to-left (Arabic): chevrons and back arrows point the other way, as on iOS */
html[dir="rtl"] .prow .chev { transform: rotate(-135deg); }
html[dir="rtl"] .backlink svg { transform: scaleX(-1); }
