/* Importando fonte */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap");

/* =========================================
   VARIÁVEIS DE CORES
   ========================================= */
:root {
  --azul-escuro: #002244;
  --azul-primario: #00509d;
  --amarelo-destaque: #ffd500;
  --fundo-site: #f4f7f6;
  --texto-principal: #2c3e50;
  --branco: #ffffff;
  --sombra-suave: 0 8px 24px rgba(0, 34, 68, 0.08);
  --sombra-hover: 0 15px 35px rgba(0, 80, 157, 0.15);
}

/* =========================================
   CONFIGURAÇÕES GERAIS
   ========================================= */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--fundo-site);
  color: var(--texto-principal);
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, var(--azul-escuro), var(--azul-primario));
  color: var(--branco);
  text-align: center;
  padding: 3rem 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0 0 10px 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}

main {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

h2 {
  color: var(--azul-escuro);
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 30px;
}

h2::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 4px;
  background-color: var(--amarelo-destaque);
  bottom: 0;
  left: 0;
  border-radius: 2px;
}

/* =========================================
   BARRA DE NAVEGAÇÃO SUPERIOR (Navbar)
   ========================================= */
.menu-principal {
  background-color: var(--branco);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-principal ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1000px;
}

.menu-principal a {
  display: block;
  padding: 22px 35px;
  color: var(--azul-escuro);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  transition: color 0.3s ease;
}

.menu-principal a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 4px;
  bottom: 0;
  left: 50%;
  background-color: var(--amarelo-destaque);
  transition: all 0.3s ease-in-out;
  transform: translateX(-50%);
  border-radius: 4px 4px 0 0;
}

.menu-principal a:hover,
.menu-principal a.ativo {
  color: var(--azul-primario);
}

.menu-principal a:hover::after,
.menu-principal a.ativo::after {
  width: 100%; /* Força a linha amarela a ficar 100% visível na página ativa */
}

/* =========================================
   WIDGET DE CLIMA
   ========================================= */
.clima-container {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 20px;
  border-radius: 30px;
  margin-top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 95%;
  box-sizing: border-box;
}

#clima-texto {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.95rem;
  line-height: 1.4;
}

#clima-texto img {
  width: 32px;
  height: 32px;
  margin-right: -4px;
}

/* =========================================
   GALERIA DE IMAGENS
   ========================================= */
.grid-fotos {
  display: grid;
  /* O pulo do gato: o cartão nunca será menor que 220px e se adapta sozinho! */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%; /* Garante que a galeria ocupe todo o espaço até à direita */
}

.foto-item {
  background: var(--branco);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--sombra-suave);
  text-align: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.foto-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra-hover);
}

.imagem-container {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
}

.imagem-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.foto-item:hover .imagem-container img {
  transform: scale(1.1);
}

/* =========================================
   AGENDA E COLETA (Cards de Eventos)
   ========================================= */
.lista-eventos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.evento-card {
  background: var(--branco);
  border-radius: 16px;
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  box-shadow: var(--sombra-suave);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease;
}

.evento-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra-hover);
  border-bottom: 4px solid var(--azul-primario);
}

.evento-icone {
  background: var(--fundo-site);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.evento-icone img {
  width: 48px;
  height: 48px;
  transition: transform 0.4s ease;
}

.evento-card:hover .evento-icone img {
  transform: scale(1.15) rotate(5deg);
}

.evento-info {
  flex-grow: 1;
}

.data-badge {
  background: var(--amarelo-destaque);
  color: var(--azul-escuro);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.evento-info h3 {
  margin: 0 0 10px 0;
  color: var(--azul-escuro);
  font-size: 1.15rem;
  font-weight: 800;
}

.evento-info p {
  margin: 0;
  color: var(--texto-principal);
  font-size: 0.85rem;
}

/* =========================================
   TELEFONES ÚTEIS (Grid de Contatos)
   ========================================= */
.grid-telefones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tel-item {
  background: var(--branco);
  padding: 25px 15px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--sombra-suave);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tel-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--sombra-hover);
}

.tel-item img.icone-img {
  width: 64px;
  height: 64px;
  margin-bottom: 15px;
}

.tel-item a {
  color: var(--branco);
  background-color: #d32f2f;
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  padding: 8px 25px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

/* =========================================
   AJUSTES ESPECÍFICOS: PÁGINA DE COLETA
   ========================================= */
.lista-coleta {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

.lista-coleta .evento-card {
  flex-direction: row;
  text-align: left;
  padding: 30px;
  width: 100%;
  box-sizing: border-box;
}

/* =========================================
   FOOTER (Rodapé Institucional)
   ========================================= */
footer {
  background-color: var(--azul-escuro);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 4px solid var(--amarelo-destaque);
}

footer strong {
  color: var(--branco);
}

.footer-autor {
  margin-top: 20px;
  font-size: 0.85rem;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   ÁREA ADMINISTRATIVA E MODAIS
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 34, 68, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--branco);
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--sombra-hover);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  box-sizing: border-box;
}

.btn-admin {
  background: var(--azul-primario);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-admin:hover {
  background: var(--azul-escuro);
}

.btn-fechar-modal {
  background: transparent;
  color: #e74c3c;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
  justify-content: center;
}

.btn-editar {
  background: #f39c12;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-excluir {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 5px;
  cursor: pointer;
}

/* =========================================
   RESPONSIVIDADE CONSOLIDADA (MOBILE)
   ========================================= */
@media (max-width: 768px) {
  /* Ajustes do Menu Principal */
  .menu-principal ul {
    flex-wrap: wrap;
  }
  .menu-principal a {
    padding: 12px 15px;
    font-size: 0.85rem;
  }
  .menu-principal a::after {
    display: none;
  }

  /* Ajustes do Cabeçalho e Clima */
  header {
    padding: 2rem 1rem;
  }
  header h1 {
    font-size: 1.5rem;
  }
  header p {
    font-size: 0.85rem;
    margin-bottom: 15px;
  }

  #clima-texto {
    font-size: 0.8rem;
  }

  /* Ajustes das Grelhas (Grids) */
  .grid-telefones {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .grid-fotos {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .imagem-container {
    height: 120px;
    margin-bottom: 10px;
  }
  .foto-item p {
    font-size: 0.8rem;
  }
  .foto-item {
    padding: 8px;
  }

  .lista-eventos {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .evento-card {
    padding: 20px 10px;
  }
  .evento-info h3 {
    font-size: 1rem;
  }
  .evento-info p {
    font-size: 0.75rem;
  }

  /* Ajustes específicos para a Página de Coleta no Mobile */
  .lista-coleta .evento-card {
    flex-direction: column;
    text-align: center;
    padding: 25px 15px;
  }
  .lista-coleta ul {
    text-align: left;
    display: inline-block;
  }
}

/* Regras específicas para Celulares muito pequenos (até 576px) */
@media (max-width: 576px) {
  .tel-item {
    padding: 20px 10px;
  }
  .tel-item img.icone-img {
    width: 48px;
    height: 48px;
  }

  .evento-card {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
}

/* Ajuste extra para ecrãs muito pequenos */
@media (max-width: 380px) {
  .menu-principal a {
    padding: 10px 5px;
    font-size: 0.75rem;
  }
}

/* =========================================
   GALERIA INTERNA (FOTOS DO ÁLBUM)
   ========================================= */
.grid-fotos-interna {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  max-height: 50vh; /* Se tiver muita foto, cria barra de rolagem só aqui dentro */
  overflow-y: auto;
  padding: 5px;
}

.foto-modal-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--sombra-suave);
}

.foto-modal-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

/* Botão de excluir foto (Admin) */
.btn-excluir-foto {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-excluir-foto:hover {
  background: #c0392b;
}

/* =========================================
   LIGHTBOX (FOTO AMPLIADA)
   ========================================= */
#img-lightbox {
  max-width: 90%;
  max-height: 85vh; /* Ocupa no máximo 85% da altura da tela */
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  object-fit: contain; /* Garante que a foto não seja cortada nem esticada */
}

.btn-fechar-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.btn-fechar-lightbox:hover {
  color: #e74c3c; /* Fica vermelho ao passar o mouse */
}

/* Efeito de "clicável" nas fotos pequenas do álbum */
.foto-modal-item img {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.foto-modal-item img:hover {
  transform: scale(1.05); /* Dá um leve zoom quando o mouse passa por cima */
}

/* =========================================
   AGENDA DE EVENTOS
   ========================================= */
.grid-eventos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.cartao-evento {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--sombra-suave);
  border-left: 5px solid var(--amarelo-secundario);
  position: relative;
}

.cartao-evento h3 {
  color: var(--azul-primario);
  margin-bottom: 10px;
}

.cartao-evento p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* Painel de botões do Admin no cartão */
.acoes-admin-evento {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.btn-editar,
.btn-deletar {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.btn-editar {
  background: #3498db;
  color: white;
}
.btn-deletar {
  background: #e74c3c;
  color: white;
}

/* =========================================
   BOTÃO DE SAIR (LOGOUT ADMIN)
   ========================================= */
.btn-sair {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  margin-left: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
  position: absolute;
  right: 10px;
  top: 10px;
}

.btn-sair:hover {
  background: #c0392b;
}

/* =========================================
   MARCADOR PERSONALIZADO DO MAPA (CENTRALIZADO)
   ========================================= */
.marcador-personalizado {
  background-color: white;
  border: 2px solid var(--azul-primario, #0b5ed7);
  border-radius: 50%;
  
  /* O !important bloqueia a interferência do Leaflet */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  margin: 0 !important;
  padding: 0 !important;
  
  /* Mantém tudo contido dentro da "bolinha" */
  overflow: hidden; 
}

/* 1. Se estiver a usar texto ou Emojis lá dentro */
.marcador-personalizado div,
.marcador-personalizado span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1; /* Remove espaços invisíveis acima/abaixo da letra */
  font-size: 24px !important;
}

/* 2. Se estiver a usar Imagens Reais (PNG/SVG) lá dentro */
.marcador-personalizado img {
  width: 85%; /* Deixa uma margem branca elegante à volta da imagem */
  height: 85%;
  object-fit: contain; /* Evita que a imagem fique esticada/deformada */
  display: block;
}

/* =========================================
   LEGENDA DO MAPA
   ========================================= */
.legenda-mapa {
  display: flex;
  flex-wrap: wrap; /* Permite que os itens saltem para a linha de baixo se o ecrã do telemóvel for pequeno */
  justify-content: center; /* Centra os itens */
  gap: 15px 25px; /* Espaço vertical e horizontal entre cada item */
  background-color: #ffffff;
  padding: 15px 20px;
  border-radius: 0 0 8px 8px; /* Arredonda apenas os cantos de baixo */
  box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Sombra suave idêntica ao mapa */
  border-top: 1px solid #eeeeee; /* Uma linha muito fina para separar do mapa */
}

.legenda-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #444;
  font-weight: 500;
}

.legenda-item span {
  margin-right: 6px;
  font-size: 1.1rem;

}

/* =========================================
   EFEITO DE LUZ (GLOW) NOS CARTÕES DA GALERIA
   ========================================= */
.foto-item {
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  padding-bottom: 10px; /* Dá um respiro para o texto dentro do cartão */
  
  /* AQUI ESTÁ A MÁGICA DA LUZ: 
     0 0 significa que a luz está centralizada atrás do cartão.
     15px é o desfoque (espalhamento).
     rgba(11, 94, 215, 0.3) é a cor azul primária do seu site com 30% de transparência. */
  box-shadow: 0 0 15px rgba(11, 94, 215, 0.3); 
  
  /* Deixa a animação de passar o rato bem suave */
  transition: all 0.3s ease; 
}

/* O efeito quando o rato (mouse) passa por cima */
.foto-item:hover {
  /* Aumentamos o desfoque para 25px e a cor para 60% (Luz mais forte) */
  box-shadow: 0 0 25px rgba(11, 94, 215, 0.7); 
  
  /* Faz o cartão dar um pequeno "pulo" de 5 pixels para cima */
  transform: translateY(-5px); 
}
