/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #14001f, #2e004f);
  color: #fff;
  animation: shimmer 30s infinite alternate;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

/* Star field overlay (fixed + layered correctly) */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.stars::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("/stars.png") repeat;
  background-size: 300px 300px;
  opacity: 0.15;
  z-index: 0;
}

/* Layer content above stars */
main,
footer,
.view,
section,
header {
  position: relative;
  z-index: 2;
}

/* Genre Tabs (place in hero or marketplace) */
.genre-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.5rem 0;
  justify-content: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(45, 55, 72, 0.8);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
  background: #facc15;
  color: #1a202c;
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.code-card {
  background: rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s;
  backdrop-filter: blur(4px);
}

.code-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.2);
}

/* Header */
header {
  background: #290036;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 12px rgba(255, 0, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 1.5rem;
  color: #ffb3ff;
  font-weight: bold;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  color: #ff80df;
  text-shadow: 0 0 5px #ff80df;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  color: white;
  cursor: pointer;
}

/* Responsive Nav */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 0;
    background: #2a003a;
    width: 60%;
    padding: 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  nav.show {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 2rem;
}

.hero h2 {
  font-size: 2.4rem;
  color: #fff0ff;
}

.hero-buttons {
  margin-top: 1rem;
}

/* Buttons */
.btn {
  background: #33ccff;
  color: #000;
  padding: 0.6rem 1.4rem;
  margin: 0.5rem;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn.alt {
  background: #ff80df;
}

.btn:hover {
  transform: scale(1.05);
}

.glow {
  box-shadow: 0 0 12px #fff, 0 0 20px #ff00ff, 0 0 30px #33ccff;
}

/* Sections */
section {
  max-width: 900px;
  margin: auto;
  padding: 3rem 1rem;
}

section[id] {
  scroll-margin-top: 90px;
}

section h3 {
  font-size: 2rem;
  color: #ffd6ff;
  margin-bottom: 1rem;
}

.features li {
  margin-bottom: 0.5rem;
}

/* Product Cards */
.product {
  background: #1a0024;
  padding: 1.2rem;
  margin: 1rem 0;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.product:hover {
  transform: translateY(-5px);
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 600px;
  margin: 2rem auto;
}

form input,
form textarea,
form select {
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  background: #1a0024;
  color: white;
}

form input::placeholder,
form textarea::placeholder {
  color: #aaa;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.9rem;
  color: #ccc;
}

.footer-links {
  margin: 1rem 0;
}

.footer-links a {
  margin: 0 0.75rem;
  color: #ffccff;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px #fff;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utility */
.muted { color: #d4c4ff; opacity: 0.9; }
.small { font-size: 0.9rem; }
.hidden { display: none; }

.container,
.view {
  max-width: 900px;
  margin: 0 auto;
}

/* 404 */
.error-page {
  max-width: 900px;
  margin: 4rem auto;
  text-align: center;
}

.error-code {
  font-size: 4rem;
  font-weight: 800;
  color: #ffb3ff;
  margin-bottom: 0.5rem;
}

.error-subtitle {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.error-actions .btn {
  margin: 0.5rem;
}

/* Legal Pages */
.view-legal {
  position: relative;
  z-index: 3;
  background: rgba(10, 0, 20, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 2rem 1.5rem;
}

.view-legal h1,
.view-legal h2 {
  color: #ffd6ff;
  margin-bottom: 0.75rem;
}

/* Mobile Tuning */
@media (max-width: 768px) {
  section { padding: 2.5rem 1.25rem; }
  .hero { padding: 3rem 1.5rem; }
  .hero h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
  body { font-size: 0.95rem; }
  .hero h2 { font-size: 1.6rem; }
}

/* Legal Pages */
.view-legal {
  top: 0;
  position: relative;
  z-index: 3;
  background: rgba(10, 0, 20, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 2rem 1.5rem;
}

.view-legal h1,
.view-legal h2 {
  color: #ffd6ff;
  margin-bottom: 0.75rem;
}

main,
.view,
footer {
  position: relative;
  z-index: 2;
}

.genre-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0;
  justify-content: flex-end; /* aligns to right/end of nav */
  padding: 0 1rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(45, 55, 72, 0.8);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.tab-btn.active,
.tab-btn:hover {
  background: #facc15;
  color: #1a202c;
}

/* Mobile adjustments for tabs */
@media (max-width: 768px) {
  .genre-tabs {
    justify-content: center;
    padding: 0.5rem;
  }
}

/* Genres Tab in Header */
.genres-tab {
  position: relative;
  margin-left: 1.5rem; /* space from logo or nav */
}

.genres-btn {
  background: none;
  border: none;
  color: #ffb3ff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.genres-btn:hover {
  color: #ff80df;
}

.genres-btn .arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.genres-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #2a003a;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  min-width: 180px;
  z-index: 100;
  padding: 0.5rem 0;
}

.genres-dropdown.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  color: #fff;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(255, 128, 223, 0.2);
  color: #ff80df;
}

/* Genres Tab & Dropdown */
.genres-tab {
  position: relative;
  margin-left: 1.5rem; /* space from logo */
}

.genres-btn {
  background: none;
  border: none;
  color: #ffb3ff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.genres-btn:hover {
  color: #ff80df;
}

.genres-btn .arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.genres-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(42, 0, 58, 0.95);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  min-width: 180px;
  z-index: 999; /* high z-index to pop over everything */
  padding: 0.5rem 0;
  backdrop-filter: blur(4px);
}

.genres-dropdown.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  color: #fff;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(255, 128, 223, 0.2);
  color: #ff80df;
}


