/* Base global */
body {
  font-family: "Segoe UI", sans-serif;
  background: #e6f4f8;
  color: #123;
  margin: 2rem;
  line-height: 1.6;
}

/* Cabeçalho */
header h1 {
  color: #0288d1;
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 2.2rem;
}

/* Menu temporal abaixo do título */
#menu-tempo {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

#menu-tempo button,
#menu-tempo a {
  background: #0288d1;
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

#menu-tempo button:hover,
#menu-tempo a:hover {
  background: #0277bd;
}

/* Botão do menu hamburguer */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
}

/* Navegação entre horas */
#navegacao-horas {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#navegacao-horas button {
  background: #0288d1;
  color: #fff;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

#navegacao-horas button:hover {
  background: #0277bd;
}

#navegacao-horas button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Navegação entre dias */
#navegacao-dias {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#navegacao-dias button {
  background: #0288d1;
  color: #fff;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

#navegacao-dias button:hover {
  background: #0277bd;
}

#navegacao-dias button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Painel principal com grid */
main.painel {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* colunas com a mesma largura */
  column-gap: 2rem; /* Espaço horizontal */
  row-gap: 2rem; /* Espaço vertical para quando empilha */
  align-items: start; /* Alinhar pelo topo */
}

@media (max-width: 1100px) {
  main.painel {
    grid-template-columns: 1fr 1fr; /* empilha progressivamente */
  }
}

@media (max-width: 700px) {
  main.painel {
    grid-template-columns: 1fr; /* empilha tudo numa coluna */
  }
}


/* Avistamentos à direita */
#ultima-hora {
  border-left: 6px solid #2196f3;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  align-self: start; /* Alinha pelo topo */
  height: auto; /* Altura conforme conteúdo */
}

/* Lista de avistamentos com estilo de cartões */
#ultima-hora-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 75vh;
  overflow-y: auto;
}

#ultima-hora-lista li {
  background: #f2f9ff;
  border-left: 4px solid #2196f3;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  line-height: 1.4;
}

#ultima-hora-lista li strong {
  color: #0277bd;
}

/* Mapa no centro */
#rotas {
  border-left: 6px solid #9c27b0;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  height: min-content; /* Ocupa apenas o espaço do conteúdo */
}

#mapa {
  width: 100%;
  height: 100vh; /* ocupa toda a altura do ecrã */
  margin-top: 1rem;
  border-radius: 6px;
}


/* Coluna lateral (países + companhias) - agora fica abaixo do mapa */
#coluna-lateral {
  display: grid;
  grid-template-columns: 1fr; /* itens empilhados */
  row-gap: 2rem;
  align-items: start;
}

#coluna-lateral > div {
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

/* Bordas coloridas para cada painel lateral */
#painel-ultima-hora { border-left: 6px solid #03a9f4; }
#top-paises { border-left: 6px solid #4caf50; }
#top-companhias { border-left: 6px solid #ff9800; }
#top-destinos { border-left: 6px solid #3f51b5; }
#top-origens { border-left: 6px solid #009688; }
#painel-mais-proximo { border-left: 6px solid #e91e63; }

#painel-mais-proximo img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}


/* Painéis principais */
main.painel > section {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

main.painel > section:hover,
#coluna-lateral > div:hover {
  transform: translateY(-4px);
}

/* Títulos */
section h2,
#coluna-lateral h2 {
  color: #0277bd;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 2px solid #b3e5fc;
  padding-bottom: 0.3rem;
}

/* Listas */
ul {
  padding-left: 1.2rem;
  margin: 0;
}

li {
  margin-bottom: 0.4rem;
}

/* Canvas */
canvas {
  width: 100%;
  height: 240px;
  background: #cfd8dc;
  display: block;
  margin-top: 1rem;
  border-radius: 6px;
}

@media (max-width: 700px) {
  #menu-tempo {
    display: none;
    flex-direction: column;
    gap: 0.6rem;
  }
  #menu-tempo.open {
    display: flex;
  }
  #menu-toggle {
    display: block;
  }
  header {
    position: relative;
  }
}
