:root {
  --pumpkin: #f57c00;
  --pumpkin-dark: #d96e00;
  --pumpkin-light: #ff9d48;
  --ghost: #7a7d81;
  --bone: #f8f5f1;
  --font-head: 'Poppins', sans-serif;
  --dark-bg: #1a1a1a;
  --card-bg: #2d2d2d;
  --card-border: #3d3d3d;
  --gold: #FFD700;
}

/* Base styles for all devices */
* {
  box-sizing: border-box;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--pumpkin);
  color: white;
  padding: 8px;
  z-index: 1000;
  text-decoration: none;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Mobile-first approach - base styles for mobile */
body {
  background: var(--dark-bg);
  color: #fff;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 16px 12px 0;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2;
}

.container {
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Typography improvements */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--pumpkin-light);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Badge improvements */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 50px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.1);
}

.badge:hover {
  transform: translateY(-2px);
  background: rgba(245, 124, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Card improvements */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  border: 1px solid var(--card-border);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(245, 124, 0, 0.4);
}

/* Button improvements */
.btn {
  display: inline-block;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
  width: 100%;
  max-width: 280px;
}

.btn:focus {
  outline: 2px solid var(--pumpkin-light);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(45deg, var(--pumpkin), var(--pumpkin-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background: linear-gradient(45deg, var(--pumpkin-light), var(--pumpkin));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(245, 124, 0, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px);
}

/* Footer improvements */
.footer {
  margin-top: 40px;
  color: var(--ghost);
  font-size: 0.875rem;
  position: relative;
  z-index: 1;
  padding: 20px 0;
  text-align: center;
}

.footer a {
  color: var(--pumpkin-light);
  text-decoration: none;
  position: relative;
  font-weight: 600;
}

.footer a:hover {
  color: var(--pumpkin);
}

.footer a:after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -1px;
  left: 0;
  background-color: var(--pumpkin);
  transition: width 0.3s ease;
}

.footer a:hover:after {
  width: 100%;
}

/* Floating Halloween Elements */
.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating {
  position: absolute;
  font-size: 1.5rem;
  animation-duration: 20s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  opacity: 0.7;
  z-index: 0;
  text-shadow: 0 0 10px rgba(245, 124, 0, 0.5);
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.ghost {
  animation-name: floatGhost;
  top: 10%;
  left: 5%;
}

.bat {
  animation-name: floatBat;
  top: 20%;
  right: 5%;
}

.pumpkin {
  animation-name: floatPumpkin;
  bottom: 30%;
  left: 10%;
}

.candy {
  animation-name: floatCandy;
  bottom: 20%;
  right: 10%;
}

.spider {
  animation-name: floatSpider;
  top: 30%;
  right: 20%;
}

.moon {
  animation-name: floatMoon;
  top: 15%;
  left: 20%;
}

.web {
  animation-name: floatWeb;
  bottom: 25%;
  left: 15%;
}

.skull {
  animation-name: floatSkull;
  top: 25%;
  right: 15%;
}

/* Animation keyframes for floating elements */
@keyframes floatGhost {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-15px, -15px) rotate(5deg);
  }
  50% {
    transform: translate(0, -30px) rotate(0deg);
  }
  75% {
    transform: translate(15px, -15px) rotate(-5deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatBat {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 15px) rotate(15deg);
  }
  50% {
    transform: translate(0, 30px) rotate(0deg);
  }
  75% {
    transform: translate(-20px, 15px) rotate(-15deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatPumpkin {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-12px, -18px) rotate(-10deg);
  }
  50% {
    transform: translate(0, -36px) rotate(0deg);
  }
  75% {
    transform: translate(12px, -18px) rotate(10deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatCandy {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(18px, 18px) rotate(20deg);
  }
  50% {
    transform: translate(0, 36px) rotate(0deg);
  }
  75% {
    transform: translate(-18px, 18px) rotate(-20deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatSpider {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-22px, 22px) rotate(25deg);
  }
  50% {
    transform: translate(0, 44px) rotate(0deg);
  }
  75% {
    transform: translate(22px, 22px) rotate(-25deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatMoon {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(8px, -8px) rotate(8deg);
  }
  50% {
    transform: translate(0, -16px) rotate(0deg);
  }
  75% {
    transform: translate(-8px, -8px) rotate(-8deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatWeb {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(15px, -15px) rotate(15deg);
  }
  50% {
    transform: translate(0, -30px) rotate(0deg);
  }
  75% {
    transform: translate(-15px, -15px) rotate(-15deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes floatSkull {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-18px, 18px) rotate(-20deg);
  }
  50% {
    transform: translate(0, 36px) rotate(0deg);
  }
  75% {
    transform: translate(18px, 18px) rotate(20deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

/* Pulsing effect for header badge */
.badge:first-child {
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 124, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(245, 124, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 124, 0, 0);
  }
}

/* Animated background elements */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245,124,0,0.05) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Header title animation */
h1 {
  position: relative;
  display: inline-block;
  margin: 15px 0;
}

h1:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--pumpkin);
  border-radius: 3px;
  animation: titleUnderline 4s infinite;
}

@keyframes titleUnderline {
  0% {
    width: 0;
  }
  50% {
    width: 100px;
  }
  100% {
    width: 0;
  }
}

/* Card entrance animations */
.card {
  opacity: 0;
  transform: translateY(20px);
  animation: cardEntrance 0.6s forwards;
}

@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:nth-child(1) {
  animation-delay: 0.2s;
}

.card:nth-child(2) {
  animation-delay: 0.4s;
}

.card:nth-child(3) {
  animation-delay: 0.6s;
}

.card:nth-child(4) {
  animation-delay: 0.8s;
}

/* Countdown timer styles */
.countdown-container {
  margin: 30px 0;
  padding: 20px;
  background: rgba(245, 124, 0, 0.1);
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(245, 124, 0, 0.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.countdown-container h3 {
  margin-top: 0;
  color: var(--pumpkin-light);
  font-family: var(--font-head);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.countdown-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 12px 8px;
  min-width: 70px;
  border: 1px solid rgba(245, 124, 0, 0.2);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.countdown-item span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pumpkin-light);
}

.countdown-item small {
  display: block;
  font-size: 0.75rem;
  color: var(--ghost);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Theme gallery */
.theme-gallery {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.theme-gallery h3 {
  text-align: center;
  margin-bottom: 0;
  color: var(--pumpkin-light);
}

.theme-images {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.theme-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 70px;
}

.theme-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  animation: bounce 3s infinite;
}

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

/* Schedule section */
.schedule {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 15px;
}

.schedule-item {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
  align-items: flex-start;
}

.schedule-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.time {
  font-weight: 700;
  color: var(--pumpkin-light);
  min-width: 80px;
  font-size: 0.875rem;
  flex: 0 0 auto;
}

.event {
  flex: 1;
  font-size: 0.95rem;
  padding-left: 15px;
}

/* Social links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 20px;
}

.social-links a {
  font-size: 1.75rem;
  color: var(--pumpkin-light);
  transition: all 0.3s ease;
  display: inline-block;
}

.social-links a:hover {
  color: var(--pumpkin);
  transform: scale(1.2) rotate(15deg);
}

/* Decorative elements */
.halloween-decoration {
  position: relative;
  margin-bottom: 15px;
}

.halloween-decoration:before,
.halloween-decoration:after {
  content: "🕷️";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.7;
}

.halloween-decoration:before {
  left: 0;
}

.halloween-decoration:after {
  right: 0;
}

/* Form header */
.form-header {
  padding: 20px;
  text-align: center;
  background: linear-gradient(45deg, var(--pumpkin), var(--pumpkin-dark));
  color: #000;
  font-weight: 700;
}

.form-header h2 {
  margin: 0 0 5px;
  color: #000;
  font-size: 1.5rem;
}

.form-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* FAQ Accordion */
.faq-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  margin-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}

.faq-question {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
  flex: 0 0 auto;
}

.faq-question:hover {
  background: rgba(245, 124, 0, 0.1);
}

.faq-toggle {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.faq-answer {
  background: rgba(0,0,0,0.15);
  padding: 0 20px;
  display: none;
  flex: 0 0 auto;
}

.faq-answer p {
  margin: 15px 0;
  color: var(--bone);
  font-size: 0.95rem;
}

/* Invitation Section */
.invitation-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 30px auto;
  width: 100%;
  padding: 0 12px;
}

.invitation-card {
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 25px;
  background: rgba(245, 124, 0, 0.1);
  border: 1px solid var(--pumpkin);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.invitation-header {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pumpkin), transparent);
  width: 80%;
  margin: 0 auto;
}

.invitation-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
}

.invitation-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--gold);
  transition: transform 0.3s ease;
  object-fit: contain;
}

.invitation-image:hover {
  transform: scale(1.02);
}

.invitation-footer {
  margin-top: 0;
  flex: 0 0 auto;
}

/* Enhanced Header with Flex */
header.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}

.countdown-container {
  margin: 0;
  width: 100%;
}

/* Focus states for accessibility */
a:focus, 
button:focus, 
input:focus, 
textarea:focus {
  outline: 2px solid var(--pumpkin-light);
  outline-offset: 2px;
}

/* Tablet styles */
@media (min-width: 768px) {
  body {
    padding: 20px 16px 0;
  }
  
  .container {
    max-width: 768px;
  }
  
  .floating {
    font-size: 2rem;
  }
  
  .btn {
    width: auto;
    padding: 16px 36px;
  }
  
  .countdown-item {
    min-width: 90px;
    padding: 15px 10px;
  }
  
  .countdown-item span {
    font-size: 2rem;
  }
  
  .theme-images {
    gap: 20px;
  }
  
  .theme-icon {
    font-size: 2.5rem;
  }
  
  .schedule-item {
    padding-bottom: 20px;
  }
  
  .time {
    min-width: 100px;
    font-size: 1rem;
  }
  
  .event {
    font-size: 1.05rem;
  }
  
  .form-header h2 {
    font-size: 1.75rem;
  }
  
  .faq-question {
    padding: 20px 25px;
    font-size: 1.1rem;
  }
  
  .invitation-card {
    padding: 30px;
  }
}

/* Desktop styles */
@media (min-width: 1024px) {
  .floating {
    font-size: 2.5rem;
  }
  
  .countdown-item {
    min-width: 110px;
  }
  
  .countdown-item span {
    font-size: 2.25rem;
  }
  
  h1:after {
    width: 120px;
  }
  
  @keyframes titleUnderline {
    0% {
      width: 0;
    }
    50% {
      width: 140px;
    }
    100% {
      width: 0;
    }
  }
  
  .theme-icon {
    font-size: 3rem;
  }
  
  .schedule {
    gap: 22px;
  }
  
  .social-links {
    gap: 30px;
  }
  
  .social-links a {
    font-size: 2rem;
  }
  
  .invitation-card {
    padding: 40px;
  }
}

/* Large screen styles */
@media (min-width: 1200px) {
  .container {
    max-width: 960px;
  }
  
  .floating {
    font-size: 3rem;
  }
  
  .countdown-container {
    padding: 30px;
  }
  
  .countdown-item {
    min-width: 120px;
    padding: 20px 15px;
  }
  
  .countdown-item span {
    font-size: 2.5rem;
  }
  
  .theme-gallery {
    margin-top: 30px;
    padding-top: 25px;
  }
  
  .theme-item {
    min-width: 90px;
  }
  
  .theme-icon {
    font-size: 3.5rem;
  }
  
  .form-header {
    padding: 25px;
  }
  
  .form-header h2 {
    font-size: 2rem;
  }
  
  .faq-question {
    padding: 22px 30px;
    font-size: 1.15rem;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating {
    animation: none;
  }
  
  .badge:first-child {
    animation: none;
  }
  
  h1:after {
    animation: none;
  }
  
  .theme-icon {
    animation: none;
  }
  
  .invitation-image:hover {
    transform: none;
  }
}

/* Event Ended Message */
.event-ended-message {
  text-align: center;
  padding: 20px;
  width: 100%;
}

.event-ended-message h3 {
  color: var(--pumpkin-light);
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.event-ended-message p {
  color: var(--bone);
  margin: 0;
  font-size: 1.1rem;
}
