/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f7f7f7;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 10px;
}

footer {
  text-align: center;
  padding: 15px;
  background: #f1f1f1;
  color: #333;
}

/* Header e modo escuro */
.dark-mode {
  background: #121212;
  color: #fff;
}

.dark-mode footer {
  background: #111;
  color: #ccc;
}

header {
  background: linear-gradient(135deg, #2c3e50, #3498db);
  padding: 20px;
  text-align: center;
  color: white;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 26px;
}

#modo-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 20px;
  cursor: pointer;
  color: white;
}

/* Navegação */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

nav a {
  padding: 8px 12px;
  background: #2196f3;
  color: #fff;
  border-radius: 5px;
  transition: 0.3s;
  text-decoration: none;
}

nav a:hover {
  background: #1976d2;
}

/* Filtro antigo (ainda usado para base) */
.filtro-categorias,
.form-pesquisa {
  text-align: center;
  margin: 20px 0;
}

.filtro-categorias select {
  padding: 8px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
}

/* Busca moderna */
.form-pesquisa.moderno {
  margin: 30px auto;
  max-width: 600px;
  width: 90%;
}

.barra-pesquisa {
  display: flex;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.barra-pesquisa input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 1em;
  border: none;
  outline: none;
  background: transparent;
}

.barra-pesquisa button {
  padding: 12px 20px;
  background: #2980b9;
  color: #fff;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 1em;
}

.barra-pesquisa button:hover {
  background: #1f6391;
}

/* Filtro moderno */
.filtro-categorias.moderno {
  display: flex;
  justify-content: center;
  margin: 10px auto 30px;
  max-width: 600px;
  width: 90%;
}

.filtro-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 10px 15px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.filtro-box label {
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap;
}

.filtro-box select {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  background: transparent;
  outline: none;
}

/* Grupos */
.grupos-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  padding: 20px;
}

.grupo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  border: 1px solid #ccc;
}

.grupo-card.vip {
  border: 3px solid gold;
}

.grupo-card.supervip {
  border: 3px solid #a6c9ff;
}

.grupo-card h3 {
  font-size: 18px;
  margin: 10px 0 5px;
}

.thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.descricao {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.descricao.expandida {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.ver-mais-btn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-bottom: 10px;
}

.grupo-card a {
  display: inline-block;
  margin-top: auto;
  padding: 10px 14px;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.grupo-card a:hover {
  background: #1f6391;
}

/* Paginação */
.paginacao {
  text-align: center;
  margin: 20px 0;
}

.paginacao a {
  margin: 0 5px;
  font-weight: bold;
  text-decoration: none;
}

.paginacao .atual {
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 5px;
}

/* Favorito */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  color: red;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.fav-btn.favorito {
  opacity: 1;
}

/* Formulário */
.formulario {
  max-width: 400px;
  width: 90%;
  margin: 30px auto;
  background: #fdfdfd;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
}

.formulario label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.formulario textarea {
  resize: vertical;
  min-height: 120px;
  margin-bottom: 5px;
}

.formulario input,
.formulario textarea,
.formulario select {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1em;
  background: #fff;
  color: #000;
}

.formulario button {
  width: 100%;
  padding: 12px;
  background: #0077ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s;
}

.formulario button:hover {
  background: #005cd6;
}

.formulario a {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #0077ff;
  text-decoration: none;
}

.formulario a:hover {
  text-decoration: underline;
}

.formulario small {
  display: block;
  margin-bottom: 10px;
  color: #666;
}

.alerta {
  max-width: 400px;
  margin: 10px auto;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
}

.alerta.erro {
  background: #ffe0e0;
  color: #a00;
  border: 1px solid #d33;
}

.alerta.sucesso {
  background: #e0ffe0;
  color: #080;
  border: 1px solid #3c3;
}

/* Estilos modo escuro adicionais */
.dark-mode .formulario,
.dark-mode .grupo-card {
  background-color: #1e1e1e;
  color: #fff;
}

.dark-mode .formulario input,
.dark-mode .formulario textarea,
.dark-mode .formulario select {
  background-color: #2a2a2a;
  color: #fff;
  border-color: #444;
}

.dark-mode .formulario small {
  color: #ccc;
}

.dark-mode .ver-mais-btn {
  color: #66b2ff;
}

.dark-mode .filtro-categorias select,
.dark-mode .form-pesquisa input,
.dark-mode .barra-pesquisa,
.dark-mode .filtro-box select {
  background-color: #2a2a2a;
  color: #fff;
  border-color: #444;
}

.dark-mode .barra-pesquisa button,
.dark-mode .filtro-box {
  background-color: #2a2a2a;
  border-color: #444;
}

.dark-mode .barra-pesquisa button:hover {
  background-color: #274c87;
}

.dark-mode .filtro-box label {
  color: #fff;
}

/* Responsividade */
@media (min-width: 768px) {
  .grupos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
  }

  .paginacao {
    width: 100%;
    margin-top: 40px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    grid-column: 1 / -1;
    order: 9999;
  }

  .grupos-lista + .paginacao {
    margin-top: 0;
  }
}

.ver-mais-btn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-bottom: 10px;
}

.btn-impulsionar {
  display: inline-block;
  padding: 10px 14px;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-impulsionar:hover {
  background: #1f6391;
}

#voltarTopo {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: none;
  background: linear-gradient(135deg, #2c3e50, #2980b9);
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 22px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition: background 0.3s, transform 0.2s;
}

#voltarTopo:hover {
  background: #1f6391;
  transform: scale(1.1);
}
.voltar-home {
  position: fixed;
  bottom: 85px;
  left: 20px;
  background: #3498db;
  color: #fff;
  padding: 10px 16px 10px 14px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease, transform 0.2s;
  opacity: 1;
}

.voltar-home svg {
  stroke: white;
}

.voltar-home.oculto {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 500px) {
  .voltar-home {
    font-size: 13px;
    padding: 8px 14px 8px 12px;
  }

  .voltar-home svg {
    width: 16px;
    height: 16px;
  }
}

/* Modo escuro */
.dark-mode .voltar-home {
  background: #3b6fc4;
  color: #fff;
}

.dark-mode .voltar-home svg {
  stroke: #fff;
}

.dropdown-categorias {
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  cursor: pointer;
  padding: 12px;
  margin-bottom: 15px;
}

.dropdown-categorias .dropdown-selecionadas {
  font-weight: bold;
  color: #333;
}

.dropdown-opcoes {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-top: none;
  background: #fff;
  z-index: 10;
  border-radius: 0 0 10px 10px;
}