/* =========================================================
   PORTAL CAIS DO SODRÉ — 476x1080 — CSS ÚNICO (Tema Claro)
   ========================================================= */

/* -----------------------------
   1) Variáveis (Tema + Base)
------------------------------ */
:root{
  /* Canvas */
  --w: 476px;
  --h: 1080px;

  /* Base */
  --bg: #FFFFFF;
  --bg-soft: #F6F7F9;
  --border: #E3E6EA;
  --shadow: rgba(0,0,0,.08);

  /* Texto */
  --text: #111827;
  --text-2: #374151;
  --muted: #6B7280;
  --inverse: #FFFFFF;

  /* Live / atenção */
  --live: #16A34A;

  /* Espaçamentos */
  --pad: 14px;
  --gap: 10px;

  /* Tipografia (ajusta se necessário no Ayuda) */
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;

  /* Tamanhos */
  --fs-xxl: 34px;   /* horas principais */
  --fs-xl: 22px;    /* títulos bloco */
  --fs-lg: 18px;    /* destino/linha */
  --fs-md: 15px;    /* texto normal */
  --fs-sm: 12.5px;  /* legendas/aux */
  --lh: 1.15;

  /* Alturas de blocos (guia; o HTML vai respeitar) */
  --h-header: 80px;
  --h-boat-dep: 240px;
  --h-boat-arr: 150px;
  --h-train: 190px;
  --h-metro: 190px;
  --h-bus: 170px;
  --h-agenda: 60px;
}

/* -----------------------------
   2) Estados globais
------------------------------ */
:root{
  --state-normal:   #16A34A;
  --state-boarding: #2563EB;
  --state-delay:    #F59E0B;
  --state-cancel:   #DC2626;

  --state-normal-bg:   #EAF7EF;
  --state-boarding-bg: #EAF1FF;
  --state-delay-bg:    #FFF5E6;
  --state-cancel-bg:   #FDECEC;
}

/* -----------------------------
   3) Operadores / Linhas
------------------------------ */
/* CP */
:root{
  --cp-accent: #005AA9;
  --cp-accent-bg: #E8F1FB;
}

/* Carris */
:root{
  --carris-red: #D11F2A;
  --carris-red-bg: #FDECEF;
}

/* Metro Lisboa - linhas */
:root{
  --ml-blue:   #1D4ED8;
  --ml-green:  #16A34A;
  --ml-red:    #DC2626;
  --ml-yellow: #F59E0B;

  --ml-blue-bg:   #EAF1FF;
  --ml-green-bg:  #EAF7EF;
  --ml-red-bg:    #FDECEC;
  --ml-yellow-bg: #FFF5E6;
}

/* TTSL - linhas/destinos (substitui pelos hex exatos do teu projeto se quiseres) */
:root{
  --ttsl-cacilhas: #16A34A;
  --ttsl-seixal:   #2563EB;
  --ttsl-montijo:  #F97316;
  --ttsl-barreiro: #7C3AED;

  --ttsl-cacilhas-bg:#EAF7EF;
  --ttsl-seixal-bg:  #EAF1FF;
  --ttsl-montijo-bg: #FFF1E8;
  --ttsl-barreiro-bg:#F1EAFE;
}

/* -----------------------------
   4) Reset / Canvas
------------------------------ */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background: var(--bg); }
body{ font-family: var(--font); color: var(--text); }

#app{
  width: var(--w);
  height: var(--h);
  background: var(--bg);
  overflow: hidden;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* -----------------------------
   5) Layout base (slots)
------------------------------ */
.slot{ width:100%; }
.slot.header{ height: var(--h-header); }
.slot.boat-dep{ height: var(--h-boat-dep); }
.slot.boat-arr{ height: var(--h-boat-arr); }
.slot.train{ height: var(--h-train); }
.slot.metro{ height: var(--h-metro); }
.slot.bus{ height: var(--h-bus); }
.slot.agenda{ height: var(--h-agenda); }

/* -----------------------------
   6) Componentes
------------------------------ */
.card{
  width:100%;
  height:100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cardHead{
  padding: 10px 12px 8px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.cardTitle{
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text);
  letter-spacing: .2px;
  text-transform: uppercase;
}

.cardMeta{
  display:flex;
  align-items:center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.cardBody{
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Destaques */
.hBig{
  font-size: var(--fs-xxl);
  font-weight: 900;
  line-height: var(--lh);
}
.hMid{
  font-size: var(--fs-lg);
  font-weight: 900;
  line-height: var(--lh);
}
.p{
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.2;
}
.muted{
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
}

/* Linhas em grelha */
.row{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.left{ display:flex; flex-direction: column; gap: 4px; }
.right{ display:flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Badge / estado */
.badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: var(--fs-sm);
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge.normal{   background: var(--state-normal);   color: var(--inverse); }
.badge.boarding{ background: var(--state-boarding); color: var(--inverse); }
.badge.delay{    background: var(--state-delay);    color: var(--inverse); }
.badge.cancel{   background: var(--state-cancel);   color: var(--inverse); }

/* “Accent bar” (TTSL, Metro, etc.) */
.accentBar{
  height: 10px;
  width: 100%;
  background: var(--bg-soft);
}

/* Chips transbordos */
.transferLine{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}
.transferChip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: var(--fs-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}
.dot{ width:10px; height:10px; border-radius:999px; }
.dot.blue{ background: var(--ml-blue); }
.dot.green{ background: var(--ml-green); }
.dot.red{ background: var(--ml-red); }
.dot.yellow{ background: var(--ml-yellow); }

/* Lista autocarros */
.busList{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.busItem{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.busLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.busLine{
  background: var(--carris-red);
  color: var(--inverse);
  font-weight: 900;
  font-size: var(--fs-md);
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 62px;
  text-align: center;
}
.busDest{
  font-weight: 900;
  font-size: var(--fs-md);
  color: var(--text);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px; /* ajusta no HTML se precisares */
}
.busETA{
  font-weight: 900;
  font-size: var(--fs-md);
  color: var(--text);
  white-space: nowrap;
}

/* Cabeçalho topo */
.headerWrap{
  height:100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--shadow);
}
.headerLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.logoBox{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.headerTitle{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.headerTitleTop{
  font-weight: 1000;
  font-size: 18px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.headerTitleSub{
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}
.headerRight{
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.clock{
  font-weight: 1000;
  font-size: 22px;
  letter-spacing: .3px;
}
.live{
  display:flex;
  align-items:center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 900;
  color: var(--muted);
}
.liveDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--live);
}

/* -----------------------------
   7) Acentos por bloco/linha
------------------------------ */

/* TTSL por linha */
.ttsl.line-cacilhas .accentBar{ background: var(--ttsl-cacilhas); }
.ttsl.line-seixal   .accentBar{ background: var(--ttsl-seixal); }
.ttsl.line-montijo  .accentBar{ background: var(--ttsl-montijo); }
.ttsl.line-barreiro .accentBar{ background: var(--ttsl-barreiro); }

/* CP */
.cp .cardTitle{ color: var(--cp-accent); }

/* Metro por linha */
.metro.line-blue   .cardTitle{ color: var(--ml-blue); }
.metro.line-green  .cardTitle{ color: var(--ml-green); }
.metro.line-red    .cardTitle{ color: var(--ml-red); }
.metro.line-yellow .cardTitle{ color: var(--ml-yellow); }

/* (Opcional) fundo suave por linha metro */
.metro.line-blue   .cardHead{ background: var(--ml-blue-bg); }
.metro.line-green  .cardHead{ background: var(--ml-green-bg); }
.metro.line-red    .cardHead{ background: var(--ml-red-bg); }
.metro.line-yellow .cardHead{ background: var(--ml-yellow-bg); }

/* -----------------------------
   8) Rodapé agenda
------------------------------ */
.agendaBar{
  height:100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--shadow);
  background: var(--bg);
}
.agendaText{
  font-weight: 900;
  font-size: var(--fs-md);
  color: var(--text);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agendaHint{
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}
/* ===== Stage / Preview scaling (browser) ===== */
html, body {
  width: 100%;
  height: 100%;
}

#stage{
  width: 100vw;
  height: 100vh;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Mantém o canvas perfeito e escala no preview */
#app{
  transform-origin: top left;
}

/* Opcional: evita diferenças de font rendering */
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}