:root {
  --primary-purple: #a855f7;
  --dark-purple: #7e22ce;
  --light-purple: #e9d5ff;
  --deep-purple: #4b0082;
  --orange: #ff6b35;
  --dark-orange: #f44336;
  --blood-red: #8b0000;
  --bg-pink: #fff0f5;
  --shadow-glow: 0 0 20px rgba(168, 85, 247, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(135deg, #0a0015 0%, #1a0033 25%, #2d0a4e 50%, #1a0033 75%, #0f001a 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><circle cx="10" cy="10" r="8" fill="rgba(168,85,247,0.5)" stroke="%23a855f7" stroke-width="2"/></svg>') 10 10, auto;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(126, 34, 206, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(139, 0, 0, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  animation: pulseGlow 8s ease-in-out infinite;
}

/* Fog effect at bottom */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(to top, rgba(168, 85, 247, 0.2), transparent);
  pointer-events: none;
  z-index: 2;
  animation: fogRise 10s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes fogRise {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-20px); opacity: 0.5; }
}

/* Lightning flash effect */
@keyframes lightning {
  0%, 10%, 20%, 100% { opacity: 0; }
  5%, 15% { opacity: 1; }
}

.lightning-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  animation: lightning 8s infinite;
  animation-delay: 3s;
}

/* Floating particles effect */
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: rgba(168, 85, 247, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  animation: float 10s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

header {
  background: rgba(30, 10, 60, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--primary-purple);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.2);
}

header h1 {
  font-family: 'Creepster', cursive;
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(45deg, var(--primary-purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
  animation: glow 2s ease-in-out infinite;
  position: relative;
  z-index: 10;
}

@keyframes glow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 10px rgba(168, 85, 247, 0.5)); }
  50% { filter: brightness(1.2) drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)); }
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 10;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--light-purple);
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-purple), var(--orange));
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--orange);
  transform: translateY(-2px);
}

nav a:hover::after {
  width: 100%;
}

.hero {
  text-align: center;
  padding: 6rem 1rem;
  position: relative;
  z-index: 10;
  animation: fadeInUp 1s ease;
}

.hero h2 {
  font-family: 'Creepster', cursive;
  font-size: 4rem;
  margin: 0 0 1rem 0;
  background: linear-gradient(45deg, #fff, var(--light-purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

@keyframes shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.hero p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--light-purple);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

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

section {
  padding: 4rem 1rem;
  max-width: 900px;
  margin: auto;
  position: relative;
  z-index: 10;
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

section h2 {
  font-family: 'Creepster', cursive;
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--orange);
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

#about {
  background: rgba(30, 10, 60, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  border: 2px solid var(--primary-purple);
  box-shadow: var(--shadow-glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#about:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
}

#about p {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--light-purple);
}

.donate {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(255, 107, 53, 0.2));
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  border: 2px solid var(--orange);
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
  transition: transform 0.3s ease;
}

.donate:hover {
  transform: scale(1.02);
}

.donate h2 {
  color: var(--orange);
}

.donate p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.donate button {
  background: linear-gradient(45deg, var(--orange), var(--dark-orange));
  color: #fff;
  border: none;
  padding: 1rem 3rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
  position: relative;
  overflow: hidden;
}

.donate button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.donate button:hover::before {
  width: 300px;
  height: 300px;
}

.donate button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 107, 53, 0.6);
}

.donate button:active {
  transform: translateY(-1px);
}

.qr {
  width: 200px;
  display: block;
  margin: 2rem auto;
  border-radius: 12px;
  border: 3px solid var(--orange);
  padding: 1rem;
  background: white;
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
  transition: transform 0.3s ease;
}

.qr:hover {
  transform: scale(1.05) rotate(2deg);
}

#gallery {
  padding: 4rem 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 15px;
  border: 2px solid var(--primary-purple);
  transition: all 0.4s ease;
  box-shadow: 0 5px 20px rgba(168, 85, 247, 0.3);
  cursor: pointer;
}

.grid img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.6);
  border-color: var(--orange);
}

#events {
  background: rgba(30, 10, 60, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  border: 2px solid var(--orange);
}

#events ul {
  list-style: none;
  padding: 0;
}

#events li {
  font-size: 1.2rem;
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(168, 85, 247, 0.1);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  transition: all 0.3s ease;
  color: #fff;
}

#events li:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: translateX(10px);
  border-left-width: 8px;
}

#events strong {
  color: var(--orange);
}

.contact {
  background: rgba(30, 10, 60, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  border: 2px solid var(--primary-purple);
  box-shadow: var(--shadow-glow);
}

.contact form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.contact input, .contact textarea {
  padding: 1rem;
  border: 2px solid var(--primary-purple);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.contact input::placeholder,
.contact textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.contact input:focus, .contact textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.contact textarea {
  min-height: 150px;
  resize: vertical;
}

.contact button {
  background: linear-gradient(45deg, var(--primary-purple), var(--dark-purple));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(168, 85, 247, 0.4);
}

.contact button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.6);
}

.contact button:active {
  transform: translateY(-1px);
}

footer {
  text-align: center;
  background: rgba(30, 10, 60, 0.95);
  backdrop-filter: blur(10px);
  padding: 2rem;
  margin-top: 4rem;
  border-top: 2px solid var(--primary-purple);
  position: relative;
  z-index: 10;
}

footer p {
  margin: 0;
  color: var(--light-purple);
  font-size: 1rem;
}

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  nav {
    flex-direction: column;
  }

  nav ul {
    justify-content: center;
  }

  .hero h2 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  section h2 {
    font-size: 2.2rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .donate button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }
}

/* Loading animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Flying bat animation */
.bat {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  z-index: 100;
  animation: flyBat 15s linear infinite;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

@keyframes flyBat {
  0% {
    left: -100px;
    top: 10%;
    transform: rotate(0deg) scaleX(1);
  }
  25% {
    top: 30%;
  }
  50% {
    left: 50%;
    top: 20%;
    transform: rotate(10deg) scaleX(-1);
  }
  75% {
    top: 40%;
  }
  100% {
    left: calc(100% + 100px);
    top: 15%;
    transform: rotate(0deg) scaleX(-1);
  }
}

/* Spider on web */
.spider {
  position: fixed;
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 100;
  animation: spiderDrop 8s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.9));
}

@keyframes spiderDrop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(200px) rotate(180deg); }
}

/* Cobweb decoration */
.cobweb {
  position: fixed;
  font-size: 4rem;
  opacity: 0.3;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
  animation: webSway 6s ease-in-out infinite;
}

@keyframes webSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

/* Cursor trail effect */
.cursor-trail {
  position: fixed;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-purple), transparent);
  pointer-events: none;
  z-index: 9998;
  animation: trailFade 0.8s ease-out forwards;
}

@keyframes trailFade {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Floating ghost */
.ghost {
  position: fixed;
  font-size: 3rem;
  pointer-events: none;
  z-index: 100;
  animation: ghostDrift 20s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
  opacity: 0.8;
}

@keyframes ghostDrift {
  0%, 100% {
    left: -100px;
    top: 20%;
    transform: translateY(0);
  }
  50% {
    left: calc(100% + 100px);
    top: 60%;
    transform: translateY(-50px);
  }
}

/* Creepy eyes following cursor */
.spooky-eyes {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  z-index: 100;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
  animation: eyeBlink 4s infinite;
}

@keyframes eyeBlink {
  0%, 90%, 100% { opacity: 1; }
  93%, 96% { opacity: 0.1; }
}

/* Blood drip effect */
.blood-drip {
  position: absolute;
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, var(--blood-red), transparent);
  top: 0;
  animation: drip 3s ease-in infinite;
  opacity: 0.8;
}

@keyframes drip {
  0% {
    height: 0;
    top: 0;
    opacity: 0.8;
  }
  50% {
    height: 100px;
    opacity: 0.8;
  }
  100% {
    height: 100px;
    top: 100px;
    opacity: 0;
  }
}

/* Glitch effect for headers */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch::before {
  animation: glitchTop 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
  animation: glitchBottom 1.5s infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
  0%, 90%, 100% {
    transform: translate(0);
  }
  92% {
    transform: translate(-2px, -2px);
    opacity: 0.8;
    color: var(--orange);
  }
}

@keyframes glitchBottom {
  0%, 85%, 100% {
    transform: translate(0);
  }
  88% {
    transform: translate(2px, 2px);
    opacity: 0.8;
    color: var(--primary-purple);
  }
}

/* Floating candle flicker */
.candle {
  position: relative;
  display: inline-block;
}

.candle::after {
  content: '🕯️';
  font-size: 2rem;
  animation: candleFlicker 0.3s infinite alternate;
  filter: drop-shadow(0 0 20px rgba(255, 150, 0, 0.8));
}

@keyframes candleFlicker {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(0.98);
  }
}

/* Pumpkin bounce */
.pumpkin-bounce {
  animation: pumpkinBounce 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes pumpkinBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* Shake effect on hover */
.shake-on-hover:hover {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Creepy shadow effect */
.shadow-creature {
  position: relative;
}

.shadow-creature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
  animation: shadowPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes shadowPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}
