/*
 * Global styles and theme variables
 * Dark neon palette with glitch aesthetics
 */

:root {
  --bg-dark: #0a0a0a;
  --neon-pink: #ff0080;
  --neon-blue: #00eaff;
  --accent-purple: #b100e8;
  --text-light: #f5f5f5;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
}

/* Navigation bar */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

header nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

header nav a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 4px 0;
  transition: color 0.3s;
}

/* animated underline for nav links */
header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
  transition: width 0.4s ease;
}

header nav a:hover::after,
header nav a.active::after {
  width: 100%;
}

header nav a:hover {
  color: var(--neon-blue);
}

/* Hero section on the index page */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
}

.hero-img {
  width: 280px;
  margin-top: 30px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* glitch effect for main title */
.glitch {
  font-family: 'Press Start 2P', monospace;
  font-size: 3rem;
  position: relative;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
}

.glitch::before {
  color: var(--neon-pink);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  animation: glitchTop 2s infinite;
}

.glitch::after {
  color: var(--accent-purple);
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  animation: glitchBottom 2s infinite;
}

@keyframes glitchTop {
  0%, 20%, 40%, 60%, 80%, 100% {
    transform: translate(0);
  }
  10% {
    transform: translate(-2px, -2px);
  }
  30% {
    transform: translate(2px, -3px);
  }
  50% {
    transform: translate(-3px, 1px);
  }
  70% {
    transform: translate(3px, 2px);
  }
  90% {
    transform: translate(-1px, 2px);
  }
}

@keyframes glitchBottom {
  0%, 20%, 40%, 60%, 80%, 100% {
    transform: translate(0);
  }
  10% {
    transform: translate(2px, 2px);
  }
  30% {
    transform: translate(-2px, 3px);
  }
  50% {
    transform: translate(3px, -1px);
  }
  70% {
    transform: translate(-3px, -2px);
  }
  90% {
    transform: translate(1px, -2px);
  }
}

.subtitle {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--neon-pink);
}

.cta {
  margin-top: 2rem;
  display: inline-block;
  padding: 12px 24px;
  border: 2px solid var(--neon-blue);
  color: var(--neon-blue);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.cta:hover {
  background: var(--neon-blue);
  color: var(--bg-dark);
}

/* Trending marquee section */
.trending {
  padding: 60px 20px;
  text-align: center;
}

.glitch-small {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  position: relative;
  color: var(--neon-blue);
}

.glitch-small::before,
.glitch-small::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
}

.glitch-small::before {
  color: var(--neon-pink);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  animation: glitchTop 2.5s infinite;
}

.glitch-small::after {
  color: var(--accent-purple);
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  animation: glitchBottom 2.5s infinite;
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  border-top: 1px dashed var(--accent-purple);
  border-bottom: 1px dashed var(--accent-purple);
  padding: 10px 0;
}

.marquee-content {
  display: inline-block;
  animation: marquee 20s linear infinite;
}

.marquee-content span {
  margin: 0 50px;
  font-size: 1rem;
  color: var(--neon-blue);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

footer {
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.5);
  margin-top: 40px;
}

/* Canvas fills the background for index animations */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* Page 2 styling */
body.page2 .hero2 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
  gap: 20px;
}

body.page2 .hero2 img {
  width: 320px;
  animation: float 5s ease-in-out infinite;
}

body.page2 .mood-slider {
  margin-top: 15px;
}

body.page2 .mood-slider input[type="range"] {
  width: 300px;
  -webkit-appearance: none;
  background: transparent;
}

/* custom range track */
body.page2 .mood-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
  border-radius: 3px;
}

body.page2 .mood-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  margin-top: -6px;
  transition: background 0.3s;
}

body.page2 .mood-slider input[type="range"]::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
  border-radius: 3px;
}

body.page2 .mood-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
}

body.page2 .mood-text {
  margin-top: 10px;
  font-size: 1.2rem;
  color: var(--neon-blue);
  font-weight: 500;
}

/* Hearts container for JS generated hearts */
.hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* Single heart shape created via CSS pseudo-elements */
.heart {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--neon-pink);
  transform: rotate(45deg);
}

.heart::before,
.heart::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--neon-pink);
  border-radius: 50%;
}

.heart::before {
  top: -10px;
  left: 0;
}

.heart::after {
  left: -10px;
  top: 0;
}

/* Animation for floating hearts on page 2 */
@keyframes floatUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh);
    opacity: 0;
  }
}

/* Page 3 styling */
body.page3 .content {
  padding-top: 100px;
  min-height: 100vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

body.page3 .glitch-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: #000;
}

body.page3 .trend-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 800px;
}

body.page3 .trend {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-purple);
  padding: 20px 30px;
  border-radius: 8px;
  font-family: 'Press Start 2P', monospace;
  color: var(--neon-blue);
  flex: 0 0 auto;
}
