/* ---------- RESET & BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #fce988;
  margin: 0;
  padding: 0;
}

/* ---------- HEADER ---------- */
header {
  background-color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 70px;
  width: auto;
}

.perfil-icon {
  font-size: 24px;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.perfil-icon:hover {
  color: #777;
}

/* ---------- LAYOUT ---------- */
.main-container {
  display: flex;
  align-items: flex-start; /* Alinha o topo dos filtros e conteúdo */
  gap: 10px;
  padding: 40px 5px;
}

/* ---------- FILTROS (SIDEBAR) ---------- */
.filtros {
  min-width: 250px;
  width: 250px;
  padding-top: 0;
  background-color: #fce988;
}

.filtros form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filtros input {
  background-color: #fce988;
  border: 1px solid black;
  border-radius: 0;
  padding: 8px;
  font-size: 13px;
  color: black;
  width: 100%;
  box-sizing: border-box;
}

.filtros .row {
  display: flex;
  gap: 10px;
}

.filtros .row input {
  flex: 1 1 0;
  min-width: 0;
}

.filtros button {
  background-color: transparent;
  border: none;
  font-weight: bold;
  font-size: 14px;
  padding: 10px 0 0 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filtros button::after {
  content: "";
  display: block;
  width: 100%;
  border-bottom: 1px solid black;
  margin-top: 5px;
}

/* ---------- CONTEÚDO PRINCIPAL ---------- */
.conteudo {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  background-color: #fce988;
  flex-grow: 1;
  padding: 40px 0;
}

.card {
  width: 300px;
  background: #fce988;
  padding: 10px;
}

.card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.card img:hover {
  transform: scale(1.03);
}

.card h3 {
  font-size: 15px;
  margin-top: 10px;
  text-transform: uppercase;
}

.card p {
  font-size: 13px;
  line-height: 1.5;
}

.filtros select {
  background-color: #fce988;
  border: 1px solid black;
  border-radius: 0;
  padding: 6px 8px;
  font-size: 13px;
  color: black;
  font-family: Arial, sans-serif;
  width: 100%;
  box-sizing: border-box;
  appearance: none;         /* remove estilo padrão */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg fill='black' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 30px; /* espaço para a seta */
}

.titulo-eventos {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
  line-height: 1.4;
}

/* Tamanho menor e fundo amarelo */
.flatpickr-calendar {
  background-color: #fce988 !important;
  border: none;
  box-shadow: none;
  font-family: Arial, sans-serif;
  font-size: 13px;
  transform: scale(0.85); /* ← reduz o tamanho do calendário */
  transform-origin: top left;
}

/* Cabeçalho centralizado */
.flatpickr-months {
  background-color: #fce988 !important;
  justify-content: center;
  font-weight: bold;
}

.flatpickr-month {
  margin: 0 auto;
}

.flatpickr-current-month {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.flatpickr-current-month input.cur-year {
  font-weight: bold;
  font-size: 16px;
  color: #000;
  background-color: transparent;
  border: none;
  width: 50px;
}

/* Botões de navegação com setas visíveis */
.flatpickr-prev-month,
.flatpickr-next-month {
  background-color: #f24e72;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flatpickr-prev-month::before {
  content: "‹";
}
.flatpickr-next-month::before {
  content: "›";
}

/* Remover os SVG padrões */
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  display: none;
}

/* Ocultar os dias da semana */
.flatpickr-weekdays {
  display: none;
}

/* Estilo dos dias */
.flatpickr-day {
  background-color: #fce988;
  border: 1px solid #000;
  color: #000;
  border-radius: 0;
  height: 30px;
  width: 30px;
  line-height: 30px;
  padding: 0;
  margin: 0;
}

.flatpickr-day.today {
  background-color: #f24e72;
  font-weight: bold;
}

.flatpickr-day.selected {
  background-color: #f24e72;
  color: #000;
}

.flatpickr-day:hover {
  background-color: #f24e72;
  cursor: pointer;
}

/* ---------- AUTOCOMPLETE CONCELHOS ---------- */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

#concelho-input {
  background-color: #fce988;
  border: 1px solid black;
  border-radius: 0;
  padding: 8px;
  font-size: 13px;
  color: black;
  width: 100%;
  box-sizing: border-box;
}

/* Caixa de sugestões */
.sugestoes-concelho {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fce988;
  border: 1px solid black;
  border-top: none;
  max-height: 150px;
  overflow-y: auto;
  z-index: 10;
  font-size: 13px;
}

/* Cada sugestão individual */
.sugestoes-concelho div {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid #ccc;
}

/* Hover em sugestão */
.sugestoes-concelho div:hover {
  background-color: #f24e72;
  color: white;
}

/* Dropdown customizado para tipologia e público-alvo */
.custom-dropdown {
  position: relative;
  width: 100%;
  font-family: Arial, sans-serif;
  font-size: 13px;
  user-select: none;
}

.custom-dropdown .selected {
  background-color: #fce988;
  border: 1px solid black;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  color: black;
}

.custom-dropdown .options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fce988;
  border: 1px solid black;
  border-top: none;
  max-height: 150px;
  overflow-y: auto;
  z-index: 999;
  display: none;
}

.custom-dropdown.open .options {
  display: block;
}

.custom-dropdown .option {
  padding: 6px 8px;
  cursor: pointer;
}

.custom-dropdown .option:hover {
  background-color: #f24e72;
  color: #fff;
}

.custom-dropdown .arrow {
  border: solid black;
  border-width: 0 1.5px 1.5px 0;
  display: inline-block;
  padding: 3px;
  margin-left: 10px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
}

/* ---------- AUTOCOMPLETE CONCELHOS UNIFICADO ---------- */

.concelho-container,
.autocomplete-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px; /* Ajuste conforme o layout */
}

#inputConcelho,
#concelho-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px; /* do segundo estilo */
  border: 1px solid black; /* borda preta do segundo estilo */
  border-radius: 0; /* zero para manter identidade */
  box-sizing: border-box;
  outline: none;
  background-color: #fce988; /* amarelo claro da paleta */
  color: black;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: text;
}

/* Caixa de sugestões */
#concelhoSuggestions,
.sugestoes-concelho,
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fce988; /* fundo amarelo */
  border: 1px solid black;
  border-top: none;
  max-height: 150px; /* fixado para não estourar */
  overflow-y: auto;
  z-index: 1000;
  font-size: 13px;
  display: none; /* fica oculto até ter sugestões */
  border-radius: 0 0 4px 4px;
}

/* Cada sugestão individual */
#concelhoSuggestions div,
.sugestoes-concelho div,
.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  color: black;
  font-size: 13px;
}

/* Hover/focus na sugestão */
#concelhoSuggestions div:hover,
#concelhoSuggestions div:focus,
.sugestoes-concelho div:hover,
.sugestoes-concelho div:focus,
.suggestion-item:hover,
.suggestion-item:focus {
  background-color: #f24e72; /* rosa */
  color: white;
}

/* ---------- RESPONSIVIDADE ---------- */

@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
    padding: 20px 15px;
    gap: 20px;
  }

  .filtros {
    width: 70%;
    padding: 0;
  }

  .conteudo {
    padding: 20px 0;
    justify-content: center;
  }

  .card {
    width: 70%;
    max-width: 400px;
    margin: 0 auto;
  }

  .filtros .row {
    flex-direction: column;
  }

  .filtros button {
    padding-top: 5px;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 10px;
  }

  .logo {
    height: 50px;
  }

  .perfil-icon {
    font-size: 20px;
  }

  .card img {
    height: 200px;
  }
}
.logo {
  height: 70px;
  width: auto;
  margin-right: auto;
}

.perfil-icon {
  font-size: 24px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
}

header {
  background-color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Quando tela for menor que 600px: */
@media (max-width: 600px) {
  header {
    justify-content: flex-start;
    gap: 10px;
  }
  
  .logo {
    height: 50px;
  }
  
  .perfil-icon {
    order: 1; 
  }
  
  .logo {
    order: 0;
  }
  
  .filtros {
    width: 100%; 
  }
  
  #concelho-input {
    width: 100%;
    box-sizing: border-box;
  }
}

/* Botão perfil fixo */
.profile-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background-color: #333;
    color: #fce988;
    font-weight: 700;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease;
    z-index: 1100;
}

.profile-button:hover {
    background-color: #555;
}

/* Painel perfil */
.painel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 280px;
    background: #fce988;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 28px 24px;
    z-index: 1099;
    font-size: 0.9rem;
    user-select: none;
    color: #333;
}

/* Botão fechar no painel */
.painel .fechar {
    font-size: 1.3rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    text-align: right;
}

/* Texto da gestão */
.painel .gestao {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 14px;
    text-align: center;
    font-style: italic;
}

/* Avatar círculo com inicial */
.painel .avatar {
    width: 60px;
    height: 60px;
    margin: 12px auto 18px;
    background-color: #333;
    color: #fce988;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.8rem;
}

/* Saudação */
.painel h3 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
}

/* Botões ação */
.painel .btn-acao {
    display: block;
    width: 100%;
    background-color: #333;
    color: #fce988;
    border: none;
    border-radius: 10px;
    padding: 12px 0;
    margin-bottom: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    user-select: none;
}

.painel .btn-acao:hover {
    background-color: #555;
}

/* Botão terminar sessão com cor diferente */
.painel .btn-terminar {
    background-color: #a63333;
}

.painel .btn-terminar:hover {
    background-color: #7a2525;
}

.alert {
  max-width: 400px;
  margin: 30px auto;
  padding: 16px 24px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInUp 0.35s ease forwards;
  cursor: default;
  border: 1px solid transparent;
}

/* Mensagens de erro */
.alert-error {
  background-color: #fdecea;
  color: #c62828;
  border-color: #d32f2f;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
