/* css/indrive-ui.css
   UI “calle” tipo InDrive (solo visual). No tocar lógica.
*/

/* ---------- tokens ---------- */
:root{
  --bg: #0b0f14;
  --card: #111826;
  --card2: #0f1623;
  --text: #e9eef6;
  --muted: rgba(233,238,246,.70);
  --line: rgba(233,238,246,.10);
  --accent: #ff7a00; /* mantiene tu identidad */
  --accent2: #ff9a2a;
  --radius: 18px;
  --radius2: 24px;
  --shadow: 0 14px 40px rgba(0,0,0,.45);
}

/* ---------- base ---------- */
html[data-mode="dark"] body{
  background: radial-gradient(1200px 600px at 50% -100px, rgba(255,122,0,.20), transparent 55%),
              linear-gradient(180deg, var(--bg), #070a0e 70%);
  color: var(--text);
}

html[data-mode="dark"] .container{
  max-width: 520px; /* mobile first */
}

/* tipografía suave */
html[data-mode="dark"] body, html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] button, html[data-mode="dark"] textarea{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- topbar ---------- */
html[data-mode="dark"] .topbar{
  background: rgba(17,24,38,.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

/* ---------- cards / panels ---------- */
html[data-mode="dark"] .card, html[data-mode="dark"] .panel, html[data-mode="dark"] .box, html[data-mode="dark"] .section, html[data-mode="dark"] .sheet{
  background: linear-gradient(180deg, rgba(17,24,38,.92), rgba(15,22,35,.92));
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

html[data-mode="dark"] hr, html[data-mode="dark"] .divider{
  border-color: var(--line);
}

/* ---------- labels / muted ---------- */
html[data-mode="dark"] label{ color: var(--muted); }
html[data-mode="dark"] .muted, html[data-mode="dark"] small, html[data-mode="dark"] .hint{ color: var(--muted) !important; }

/* ---------- inputs ---------- */
html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] textarea{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 16px !important;
  color: var(--text) !important;
}

html[data-mode="dark"] input::placeholder, html[data-mode="dark"] textarea::placeholder{
  color: rgba(233,238,246,.45);
}

/* focus */
html[data-mode="dark"] input:focus, html[data-mode="dark"] select:focus, html[data-mode="dark"] textarea:focus{
  outline: none !important;
  border-color: rgba(255,122,0,.55) !important;
  box-shadow: 0 0 0 4px rgba(255,122,0,.16) !important;
}

/* ---------- buttons ---------- */
html[data-mode="dark"] button, html[data-mode="dark"] .btn, html[data-mode="dark"] a.button{
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transform: translateY(0);
  transition: transform .08s ease, filter .08s ease, box-shadow .08s ease;
}

html[data-mode="dark"] button:active, html[data-mode="dark"] .btn:active, html[data-mode="dark"] a.button:active{
  transform: translateY(1px);
  filter: brightness(.98);
  box-shadow: 0 6px 18px rgba(0,0,0,.30);
}

/* primario */
html[data-mode="dark"] button.primary, html[data-mode="dark"] .btn.primary{
  background: linear-gradient(180deg, var(--accent2), var(--accent)) !important;
  color: #1b0f00 !important;
  border-color: rgba(255,154,42,.45) !important;
}

/* secundarios */
html[data-mode="dark"] button.secondary, html[data-mode="dark"] .btn.secondary{
  background: rgba(255,255,255,.05) !important;
  color: var(--text) !important;
}

/* ---------- map container (si existe) ---------- */
html[data-mode="dark"] #map, html[data-mode="dark"] .map, html[data-mode="dark"] .mapbox, html[data-mode="dark"] .map-wrap{
  border-radius: var(--radius2);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------- badges / estados ---------- */
.badge, .pill, .chip{
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
}

/* ---------- spacing helper: más aire en móvil ---------- */
.mt-8{ margin-top: 10px !important; }
.mt-10{ margin-top: 12px !important; }
.mt-12{ margin-top: 14px !important; }
.mt-16{ margin-top: 18px !important; }

/* ===== ETAPA 1.1 - polish mobile ===== */

/* contenedor: más aire */
html[data-mode="dark"] .container{
  padding-left: 14px;
  padding-right: 14px;
}

/* topbar tipo app */
html[data-mode="dark"] .topbar{
  position: sticky;
  top: 10px;
  z-index: 50;
  padding: 12px 14px;
  margin-top: 10px;
}

/* títulos */
h1, h2, h3{
  letter-spacing: .2px;
}

/* cards/panels: padding consistente */
html[data-mode="dark"] .card, html[data-mode="dark"] .panel, html[data-mode="dark"] .box, html[data-mode="dark"] .section, html[data-mode="dark"] .sheet{
  padding: 14px;
}

/* botones: altura y legibilidad */
html[data-mode="dark"] button, html[data-mode="dark"] .btn, html[data-mode="dark"] a.button{
  min-height: 46px;
  font-weight: 700;
}

/* botones full width si están dentro de .container */
.container button,
.container .btn,
.container a.button{
  width: 100%;
}

/* excepción: botones pequeños si el HTML ya usa .inline o .small */
.inline button, .inline .btn,
.small button, .small .btn{
  width: auto !important;
  min-height: 38px;
  font-weight: 600;
}

/* selects e inputs: altura consistente */
html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] textarea{
  min-height: 46px;
}

/* listas/tablas pequeñas (mis viajes) */
table{
  border-collapse: separate;
  border-spacing: 0 10px;
}
table tr{
  background: rgba(255,255,255,.03);
}
table td, table th{
  padding: 10px 12px;
}

/* ===== ETAPA 1.2 - botones inteligentes ===== */
/* Por defecto NO forzar 100% en todos los botones */
.container button,
.container .btn,
.container a.button{
  width: auto;
}

/* Full width solo para acciones principales */
html[data-mode="dark"] button.primary, html[data-mode="dark"] .btn.primary,
html[data-mode="dark"] button.secondary, html[data-mode="dark"] .btn.secondary{
  width: 100%;
}


/* ===== ETAPA 1.3 - AppBar PRO ===== */
.appbar{
  position: sticky;
  top: 10px;
  z-index: 60;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius2);
  background: rgba(17,24,38,.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.appbar-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand .name{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
}

.brand .sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.appbar-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.iconbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.iconbtn:active{ transform: translateY(1px); }

.chiprow{
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

html[data-mode="dark"] .chip{
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.chip.ok{ border-color: rgba(46, 204, 113, .35); }
.chip.warn{ border-color: rgba(255, 122, 0, .40); }


/* ===== ETAPA 1.4 - Header PRO (placeholders existentes) ===== */

/* Marca (Ayacucho / M&A Ayacucho) */
#brandName, .brand-city{
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .2px;
}

/* Subtítulo debajo del nombre (sin tocar HTML) */
#brandName::after, .brand-city::after{
  content: "Transporte seguro • App en prueba";
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Botón WhatsApp (solo se verá cuando city-ui lo muestre) */
#supportWhatsApp, .brand-support{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 800;
  white-space: nowrap;
}

/* Alineación: cuando estén dentro de topbar/brandbar */
.topbar, .brandbar, .brand-bar, .brand-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


/* ===== ETAPA 1.5b - WhatsApp visible solo si href es WhatsApp ===== */
/* Default: oculto (aunque el HTML tenga style=display:none) */
#supportWhatsApp,
.brand-support{
  display: none !important;
}

/* Mostrar SOLO cuando city-ui ya setea un link real */
#supportWhatsApp[href*="wa.me"],
#supportWhatsApp[href*="whatsapp"],
.brand-support[href*="wa.me"],
.brand-support[href*="whatsapp"]{
  display: inline-flex !important;
}


/* ===== ETAPA 1.7 - Header premium tipo app ===== */
/* intenta agarrar el contenedor existente del branding */
.brandbar, .brand-bar, .brand-header, .topbar{
  background: rgba(17,24,38,.78) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius2) !important;
  padding: 12px 14px !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(12px);
}

/* layout: marca a la izquierda, soporte a la derecha */
.brandbar, .brand-bar, .brand-header, .topbar{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

/* marca */
.brand-city, #brandName{
  font-size: 16px !important;
  font-weight: 900 !important;
}

/* el subtítulo ya lo agrega ETAPA 1.4 con ::after */

/* botón whatsapp */
.brand-support, #supportWhatsApp{
  min-height: 42px !important;
  padding: 0 12px !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  font-weight: 800 !important;
}

/* chips visuales opcionales sin HTML: una línea abajo como “estado” */
.brand-city::before, #brandName::before{
  content: "● ";
  color: rgba(46, 204, 113, .9);
}


/* ===== ETAPA 1.8 - Header responsive + WhatsApp accent ===== */
.brandbar, .brand-bar, .brand-header, .topbar{
  flex-wrap: wrap !important;
  row-gap: 10px !important;
}

/* asegura que marca pueda ocupar ancho y no reviente */
.brand-city, #brandName{
  flex: 1 1 auto;
  min-width: 180px;
}

/* botón soporte no se deforma */
.brand-support, #supportWhatsApp{
  flex: 0 0 auto;
}

/* cuando WhatsApp está visible (href real), se ve “accion principal” */
#supportWhatsApp[href*="wa.me"],
#supportWhatsApp[href*="whatsapp"],
.brand-support[href*="wa.me"],
.brand-support[href*="whatsapp"]{
  background: linear-gradient(180deg, var(--accent2), var(--accent)) !important;
  color: #1b0f00 !important;
  border-color: rgba(255,154,42,.45) !important;
}

@media (max-width: 360px){
  .brandbar, .brand-bar, .brand-header, .topbar{
    align-items: stretch !important;
  }
  .brand-support, #supportWhatsApp{
    width: 100% !important;
    justify-content: center !important;
  }
}


/* ===== ETAPA 1.9 - Brand row como header PRO ===== */
.brand-row{
  position: sticky;
  top: 10px;
  z-index: 80;

  max-width: 520px;
  margin: 10px auto 12px;
  padding: 12px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  background: rgba(17,24,38,.78);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand-platform{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border-radius: 14px;
  font-weight: 900;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

/* Si por alguna razón el link no tiene texto, mostrar "WhatsApp" */
#supportWhatsApp:empty::before,
.brand-support:empty::before{
  content: "WhatsApp";
}

/* En login: la topbar queda como fila secundaria (no compite con brand-row) */
.brand-row + .container .topbar{
  position: static !important;
  top: auto !important;
  z-index: auto !important;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;

  padding: 6px 2px !important;
  margin-top: 8px !important;
}




/* --- ETAPA 1.2b Flash visual nuevo viaje (BOOST) --- */
.ma-flash{
  animation: maFlashStrong 1s ease-in-out 1;
}
@keyframes maFlashStrong{
  0%   { box-shadow: 0 0 0 rgba(255,140,0,0); }
  30%  { box-shadow: 0 0 0 4px rgba(255,140,0,0.9), 0 0 25px rgba(255,140,0,0.8); background: rgba(255,140,0,0.08); }
  100% { box-shadow: 0 0 0 rgba(255,140,0,0); }
}
/* --- END ETAPA 1.2b --- */

/* --- ETAPA 1.2d Flash button (inequivoco) --- */
#available.ma-flash button,
#available.ma-flash .btn,
#available.ma-flash button[data-act="accept"]{
  box-shadow: 0 0 0 4px rgba(255,140,0,0.65), 0 0 25px rgba(255,140,0,0.75) !important;
  filter: brightness(1.12) !important;
}
/* --- END ETAPA 1.2d --- */

/* [PAX 3A] Autocomplete sugerencias (Pasajero) */
.ma-suggest{
  margin-top: 8px;
  display: none;
}
.ma-suggest.is-open{
  display: block;
}
.ma-suggest .item{
  border-radius: 14px;
  padding: 10px 12px;
  margin: 8px 0;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.ma-suggest .item:hover{
  background: rgba(255,255,255,0.09);
}
.ma-suggest .title{
  font-weight: 700;
  font-size: 14px;
}
.ma-suggest .sub{
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}

/* [POIS 02] Chips lugares frecuentes */
.poi-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 8px 0 10px 0;
}
.poi-chip{
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor:pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}
.poi-chip:hover{
  background: rgba(255,255,255,0.10);
}

/* =========================
   D-FIX-CSS-01 item-actions buttons (dark)
   Asegura que botones (Iniciar/Llegué/Finalizar) no queden ocultos
   ========================= */
html[data-mode="dark"] .item-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
html[data-mode="dark"] .item-actions button,
html[data-mode="dark"] .item-actions a{
  display:inline-flex !important;
  visibility:visible !important;
  opacity:1 !important;
}
html[data-mode="dark"] .item-actions button.secondary,
html[data-mode="dark"] .item-actions button.danger,
html[data-mode="dark"] .item-actions a.secondary{
  min-height:44px;
  padding:10px 14px;
  border-radius:12px;
  text-decoration:none;
}
