/* ==============================
   STR BASE KIT — Components
   ============================== */

/* ===== HEADER ===== */
.header {
  background: var(--str-slate);
  color: #fff;
  padding: 18px 16px 12px;
  text-align: center;
}

.header-title {
  font-family: "Tormenta", serif;
  letter-spacing: 1px;
  font-size: 3.1rem;
  margin: 0;
}

.header::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--str-accent);
  margin-top: 12px;
}

/* Busca + filtros no header */
.search-container {
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 0 8px;
  display: grid;
  gap: 12px;
}

#searchInput {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

#searchInput::placeholder {
  color: rgba(255, 255, 255, .78);
}

/* ===== BOTÕES (pílulas do header) ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.filter-btn {
  border: 2px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, .14);
}

.filter-btn.active {
  background: var(--str-accent);
}

.filter-btn.sm {
  padding: 6px 10px;
  font-size: .85rem;
}

/* ===== SELECT (header escuro) ===== */
/* Unificando o estilo para Classes, Deuses e Regiões do Atlas */
#classSelector,
#godSelector,
#atlasRegionSelector {
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .45);
  background: rgba(0, 0, 0, .25);
  color: #fff;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

/* Estilo das opções para todos os seletores */
#classSelector option,
#godSelector option,
#atlasRegionSelector option {
  background: #111827;
  color: #fff;
}

/* Feedback visual ao passar o mouse */
#classSelector:hover,
#godSelector:hover,
#atlasRegionSelector:hover {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(0, 0, 0, .35);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  /* JS liga com display:flex */
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, .55);
  backdrop-filter: blur(2px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  width: min(720px, calc(100vw - 24px));
  max-height: 86vh;
  overflow: auto;
  background: linear-gradient(180deg, #0b0e1a 0%, #06070c 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #1a1f2e;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}


.close-btn:hover {
  background: #252b3d;
}

/* ===== BOTÃO "TOPO" ===== */
#backToTopBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--str-accent);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  display: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

@media (max-width:720px) {
  .header-title {
    font-size: 2.4rem;
  }

  .modal-content {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }
}

/* ==============================
   MOBILE: Search Row Reorder
   ============================== */
@media (max-width:600px) {
  .search-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .view-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
  }

  .view-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.8rem;
  }

  #searchInput,
  #origensSearch,
  #distincoesSearch {
    order: 2;
    width: 100%;
    padding: 10px;
    font-size: 0.95rem;
  }

  .filters {
    gap: 5px;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  #distincoesFilters {
    flex-wrap: wrap;
  }

  #distincoesFilters .filter-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 80px;
    text-align: center;
  }
}
