/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: #eaeaea;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #090909; /* fallback global */
}

a {
  text-decoration: none;
  color: inherit;
}

/* ================= HEADER ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: rgba(10,10,10,.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1f1f1f;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-brand img {
  height: 26px;
}

.site-name {
  font-size: 15px;
  font-weight: 800;
  color: #ff5fa2;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 30px;
  color: #ff5fa2;
  cursor: pointer;
}

/* ================= SIDE MENU REFINADO ================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
}

.menu-overlay.hidden {
  display: none;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -320px; /* ligeiramente maior para sensação premium */
  width: 320px;
  height: 100vh;
  background: linear-gradient(180deg, #0b0b0b 0%, #1a1a1a 100%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.77, 0, 0.175, 1);
  box-shadow: -25px 0 60px rgba(0,0,0,0.8), inset 0 0 15px rgba(255,95,162,0.1);
  border-left: 1px solid rgba(255,95,162,0.15);
  backdrop-filter: blur(6px);
}

.side-menu.open {
  right: 0;
}

/* ================= PERFIL ================= */
.side-menu-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  gap: 10px;
  background: rgba(255,95,162,0.03);
  border-bottom: 1px solid rgba(255,95,162,0.1);
}

.avatar-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff5fa2;
  box-shadow: 0 4px 18px rgba(255,95,162,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.avatar-wrapper img:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(255,95,162,0.5);
}

.upload-btn {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: #fff;
  padding: 7px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,95,162,0.4);
  transition: all 0.3s ease;
}

.upload-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(255,95,162,0.6);
}

#userName {
  font-weight: 800;
  color: #ff5fa2;
  font-size: 15px;
}

.profile-btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255,95,162,.15);
  color: #ff5fa2;
  text-decoration: none;
  font-weight: 700;
  transition: all .2s ease;
}

.profile-btn:hover {
  background: #ff5fa2;
  color: #000;
}

/* ================= NAVEGAÇÃO ================= */
.side-menu-nav {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-menu-nav a {
  text-decoration: none;
  color: #ddd;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(3px);
}

.side-menu-nav a:hover {
  background: rgba(255,95,162,0.2);
  color: #ff5fa2;
  box-shadow: 0 6px 18px rgba(255,95,162,0.35);
  transform: translateX(3px);
}

/* ================= FILTROS RÁPIDOS ================= */
.side-menu-filters {
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  gap: 8px;
  font-size: 13px;
  color: #ccc;
}

.side-menu-filters span {
  font-weight: 700;
  color: #ff5fa2;
  letter-spacing: 0.5px;
}

.side-menu-filters .filter-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 16px;
  background: rgba(255,95,162,0.08);
  color: #ff5fa2;
  font-weight: 600;
  margin-top: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.side-menu-filters .filter-link:hover,
.side-menu-filters .filter-link.active {
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,95,162,0.45);
  transform: scale(1.05);
}

/* ================= FOOTER ================= */
.side-menu-footer {
  padding: 24px 20px;
  border-top: 1px solid rgba(255,95,162,0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-auth {
  text-decoration: none;
  text-align: center;
  padding: 14px;
  border-radius: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255,95,162,0.15), rgba(255,47,133,0.15));
  color: #ff5fa2;
  transition: all 0.3s ease;
}

.menu-auth:hover {
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  color: #000;
  box-shadow: 0 6px 20px rgba(255,95,162,0.4);
  transform: translateY(-2px);
}

.logout-btn {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  color: #000;
  font-weight: 900;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  box-shadow: 0 8px 26px rgba(255,95,162,0.45);
  transform: translateY(-2px);
}

/* ================= HOME ================= */
body.home {
  background:
    radial-gradient(circle at top, rgba(255,95,162,.12), transparent 45%),
    radial-gradient(circle at bottom, rgba(255,47,133,.12), transparent 45%),
    #090909;
}

.hero {
  max-width: 1300px;
  margin: 60px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
}

.hero-content h1 {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.1;
  color: #ff5fa2;
}

.hero-content p {
  margin-top: 14px;
  font-size: 17px;
  color: #ccc;
}

.hero-image img {
  width: 100%;
  border-radius: 22px;
  box-shadow: 0 0 80px rgba(255,95,162,.25);
}

/* ================= PACK SECTIONS ================= */
.packs-section {
  max-width: 1300px;
  margin: 90px auto;
  padding: 0 24px;
}

.packs-section h2 {
  font-size: 26px;
  font-weight: 900;
  color: #ff5fa2;
  margin-bottom: 26px;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px;
}

.pack-card {
  position: relative;
  background: #0f0f0f;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.pack-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(0,0,0,.8);
}

.pack-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform .4s ease;
}

.pack-card:hover img {
  transform: scale(1.08);
}

.pack-title {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,.9), transparent);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

#featuredGrid .pack-card {
  border: 1px solid rgba(255,95,162,.45);
  box-shadow: 0 0 45px rgba(255,95,162,.25);
  transform: scale(1.03);
}

#featuredGrid .pack-card::before {
  content: "⭐ DESTAQUE";
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ff5fa2;
  color: #000;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 3;
}

.pack-card.nsfw img {
  filter: blur(14px) brightness(.6);
}

.nsfw-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff5fa2;
  font-weight: 800;
  background: rgba(0,0,0,.6);
  text-align: center;
}

/* ================= MODAL ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  border-radius: 22px;
  width: 95%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.close-modal {
  align-self: flex-end;
  background: none;
  border: none;
  color: #ff5fa2;
  font-size: 32px;
  padding: 10px 16px;
  cursor: pointer;
}

.modal-images {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  overflow-y: auto;
}

.modal-images.hidden {
  display: none;
}

.modal-images img {
  width: 100%;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .2s ease;
}

.modal-images img:hover {
  transform: scale(1.06);
}

.modal-warning {
  padding: 70px 20px;
  text-align: center;
}

.modal-warning.hidden {
  display: none;
}

.modal-warning p {
  margin-bottom: 20px;
  font-size: 16px;
  color: #ccc;
}

/* ================= IMAGE VIEWER ================= */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.image-viewer.hidden {
  display: none;
}

#viewerImage {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 18px;
}

.viewer-close,
.viewer-arrow {
  position: fixed;
  color: #ff5fa2;
  font-size: 42px;
  cursor: pointer;
  user-select: none;
}

.viewer-close {
  top: 18px;
  right: 22px;
}

.viewer-arrow.left {
  left: 18px;
}

.viewer-arrow.right {
  right: 18px;
}

/* ================= HOME FILTER ================= */
.home-filters {
  margin-bottom: 26px;
}

.nsfw-toggle {
  font-size: 14px;
  color: #ff5fa2;
  font-weight: 700;
}

.nsfw-toggle input {
  accent-color: #ff5fa2;
  width: 16px;
  height: 16px;
}

/* ================= MOBILE ================= */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-image img {
    margin-top: 24px;
  }
}

/* ================= AUTH PAGES ================= */
body.auth {
  background:
    radial-gradient(circle at top, rgba(255,95,162,.08), transparent 50%),
    radial-gradient(circle at bottom, rgba(255,47,133,.08), transparent 50%),
    #090909;
}

.auth-wrapper {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(20,20,20,.85);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow:
    0 30px 80px rgba(0,0,0,.8),
    inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(12px);
  animation: fadeUp .6s ease;
}

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

.auth-card h2 {
  font-size: 26px;
  text-align: center;
  color: #ff5fa2;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.auth-field label {
  font-size: 13px;
  color: #ccc;
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1f1f1f;
  background: #0e0e0e;
  color: #eee;
  font-size: 14px;
}

.auth-field input:focus {
  outline: none;
  border-color: #ff5fa2;
  box-shadow: 0 0 0 2px rgba(255,95,162,.15);
}

.auth-btn {
  width: 100%;
  margin-top: 10px;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  color: #000;
  font-weight: 800;
  cursor: pointer;
}

.form-subtitle {
  text-align: center;
  font-size: 14px;
  color: #aaa;
  margin: 10px 0 26px;
}

.auth-divider {
  margin: 22px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #1f1f1f;
}

.auth-divider span {
  font-size: 12px;
  color: #777;
}

.form-footer {
  text-align: center;
  font-size: 14px;
  color: #aaa;
}

.form-footer a {
  color: #ff5fa2;
  font-weight: 700;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ================= TAGS PAGE ================= */
body.tags {
  background: #0e0e0e;
}

#tagsList {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  padding: 24px;
}

#tagsList .filter-btn {
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255,95,162,.15);
  color: #ff5fa2;
  transition: all .2s ease;
}

#tagsList .filter-btn:hover,
#tagsList .filter-btn.active {
  background: #ff5fa2;
  color: #000;
}

/* ================= PERFIL PREMIUM ================= */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 50px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%; /* círculo perfeito */
  object-fit: cover;
  border: 3px solid #ff5fa2; /* borda neon rosa */
  box-shadow: 0 8px 25px rgba(255,95,162,.5); /* sombra suave */
  transition: transform .3s ease, box-shadow .3s ease;
}

.profile-avatar-wrapper img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(255,95,162,.7);
}

.profile-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(135deg, #ff5fa2, #ff2f85);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: #fff;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  transition: transform .2s ease, box-shadow .2s ease;
}

.profile-upload-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0,0,0,.5);
}

/* Nome do usuário */
.profile-username {
  font-size: 20px;
  font-weight: 900;
  color: #ff5fa2;
  text-align: center;
}

/* Botões de ação */
.profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-actions .auth-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 12px;
  transition: all .2s ease;
}

.profile-actions .auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255,95,162,.3);
}

/* ===== ANIMAÇÃO REMOVER FAVORITO ===== */
.pack-card.removing {
  animation: removeCard .45s ease forwards;
}

@keyframes removeCard {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  60% {
    opacity: .4;
    transform: scale(.92);
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    transform: scale(.8);
    filter: blur(6px);
  }
}

.fav-btn {
  background: rgba(0,0,0,.55);
  border: none;
  border-radius: 50%;
  padding: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.fav-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px rgba(255,95,162,.7);
}

/* ================= PACK CARDS 9:16 ================= */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.pack-card {
  position: relative;
  background: #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  /* Altura automática baseada na largura 9:16 */
  aspect-ratio: 9 / 16;
  max-height: 500px; /* Limite máximo */
  min-height: 350px; /* Altura mínima */
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.pack-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

/* Container da imagem com proporção exata 9:16 */
.pack-card .image-container {
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  flex-shrink: 0;
}

.pack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* Sempre mostra o topo */
  display: block;
  transition: transform 0.3s ease;
}

.pack-card:hover img {
  transform: scale(1.05);
}

/* Conteúdo (título + controles) ocupa o espaço restante */
.pack-card .card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Título */
.pack-card .pack-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Overlay NSFW */
.pack-card .nsfw-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff4444;
  font-size: 20px;
  font-weight: bold;
  z-index: 3;
}

.pack-card.nsfw .nsfw-overlay {
  display: flex;
}

/* Botão Favorito */
.pack-card .fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pack-card .fav-btn:hover {
  background: rgba(255,255,255,0.4);
  transform: scale(1.1);
}

/* Card NSFW desfocado */
.pack-card.nsfw:not(.show-nsfw) img {
  filter: blur(8px);
}

/* Responsivo */
@media (max-width: 768px) {
  .packs-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .pack-card {
    min-height: 320px;
  }
}

@media (max-width: 480px) {
  .packs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .pack-card {
    max-height: 450px;
  }
}
