/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Divine Color Palette */
  --primary-saffron: #ff9933;
  --secondary-saffron: #ffb366;
  --light-saffron: #ffead0;
  --cream: #fff8dc;
  --warm-white: #fefcf3;
  --soft-beige: #f5f5dc;
  --gold: #ffd700;
  --deep-gold: #b8860b;
  --text-dark: #4a4a4a;
  --text-light: #6b6b6b;
  --shadow-light: rgba(255, 153, 51, 0.1);
  --shadow-medium: rgba(255, 153, 51, 0.2);
  --gradient-divine: linear-gradient(
    135deg,
    var(--light-saffron) 0%,
    var(--cream) 50%,
    var(--warm-white) 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    var(--warm-white) 0%,
    var(--soft-beige) 100%
  );
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--gradient-divine);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Unified Header & Footer Styles */
:root {
  /* Brand Colors */
  --brand-primary: #2aa79b;
  --brand-header-bg: #bcc4dc;
  --brand-footer-bg: #ffffff;
  --brand-footer-text: #333333;
}

/* Main Content */
.main {
  margin-top: 90px; /* Space for fixed header */
  min-height: calc(100vh - 90px);
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  text-align: center;
  background: var(--gradient-divine);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="mandala" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="%23FF9933" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23mandala)"/>'); /* Background pattern */
  opacity: 0.3;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 25% 25%,
      var(--gold) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 75% 75%,
      var(--primary-saffron) 1px,
      transparent 1px
    );
  background-size: 50px 50px;
  background-position: 0 0, 25px 25px;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-title {
  font-family: "Dancing Script", cursive;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary-saffron);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px var(--shadow-light);
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-ornament {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}

/* Festival Sections */
.festival-section {
  padding: 4rem 0;
  position: relative;
}

.festival-section:nth-child(even) {
  background: rgba(255, 255, 255, 0.3);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--primary-saffron);
  margin-bottom: 0.5rem;
  position: relative;
}

.section-title::before {
  content: "🪷";
  position: absolute;
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: 0.7;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 100px;
  height: 3px;
  background: var(--gold);
  transform: translateX(-50%);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Festival Grid */
.festival-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Festival Cards */
.festival-card {
  background: var(--gradient-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow-light);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
  position: relative;
}

.festival-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-saffron),
    var(--gold),
    var(--primary-saffron)
  );
}

.festival-card::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.festival-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow-medium);
}

.festival-card:hover::after {
  opacity: 0.3;
}

.card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.festival-card:hover .card-image {
  transform: scale(1.05);
}

.card-content {
  padding: 2rem;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-date {
  font-size: 1rem;
  color: var(--primary-saffron);
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-date::before {
  content: "📅";
  font-size: 1.2rem;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.know-more-btn {
  background: linear-gradient(
    135deg,
    var(--primary-saffron),
    var(--secondary-saffron)
  );
  color: white;
  border: 1px solid var(--gold);
  padding: 0.8rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow-light);
}

.know-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.know-more-btn:hover::before {
  left: 100%;
}

.know-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow-medium);
  border-color: var(--deep-gold);
}

/* Festival Detail Page */
.festival-detail {
  max-width: 800px;
  margin: 2rem auto;
  background: var(--gradient-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px var(--shadow-medium);
  animation: fadeInUp 0.8s ease-out;
}

.festival-detail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--primary-saffron),
    var(--gold),
    var(--secondary-saffron),
    var(--gold),
    var(--primary-saffron)
  );
}

.detail-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.detail-content {
  padding: 3rem;
}

.detail-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-saffron);
  margin-bottom: 1rem;
  text-align: center;
}

.detail-date {
  font-size: 1.2rem;
  color: var(--primary-saffron);
  font-weight: 500;
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.detail-date::before {
  content: "🗓️";
  font-size: 1.5rem;
}

.detail-summary {
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.8;
  text-align: justify;
}

.detail-summary p {
  margin-bottom: 1.5rem;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--light-saffron);
  border-top: 4px solid var(--primary-saffron);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .festival-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .festival-card {
    margin: 0 1rem;
  }

  .detail-content {
    padding: 2rem;
  }

  .detail-title {
    font-size: 2rem;
  }

  .detail-image {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .card-content {
    padding: 1.5rem;
  }

  .detail-content {
    padding: 1.5rem;
  }

  .festival-card {
    margin: 0 0.5rem;
  }
}

.fest-card-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 20px;
}

.fest-card {
  width: 300px; /* ✅ fixes width for all cards */
  height : 550px;
  background: linear-gradient(145deg, #fff7e6, #ffe0b2);
  border-radius: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.fest-card-content img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.fest-card-content h2,
.fest-card-content p {
  word-wrap: break-word; /* ✅ forces long words to wrap */
  overflow-wrap: anywhere;
  margin: 5px;
}

/* Modal styling */
.fest-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.6);
}

.fest-modal-content {
  background: linear-gradient(145deg, #fff7e6, #ffecb3);
  margin: auto;
  padding: 20px;
  border-radius: 20px;
  max-width: 600px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease;
}

.fest-modal-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 15px;
}

.fest-close {
  color: #5d4037;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.fest-close:hover {
  color: #d32f2f;
}

#fest-modal-details p,
#fest-modal-details ul {
  text-align: left;
  color: #4e342e;
}

#fest-modal-details ul {
  margin: 10px 0 0 20px;
  padding: 0;
}

.heading-text {
  font-size: 5.5rem;
  color: #5d4037;
  text-align: center;
  margin: 40px 0;
  font-family: "Dancing Script", cursive;
}

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

/* Animation delays for staggered card appearance */
.festival-card:nth-child(1) {
  animation-delay: 0.1s;
}
.festival-card:nth-child(2) {
  animation-delay: 0.2s;
}
.festival-card:nth-child(3) {
  animation-delay: 0.3s;
}
.festival-card:nth-child(4) {
  animation-delay: 0.4s;
}
.festival-card:nth-child(5) {
  animation-delay: 0.5s;
}
.festival-card:nth-child(6) {
  animation-delay: 0.6s;
}

/* Notification improvements */
.error-message .error-content {
  background: var(--gradient-card);
  border: 2px solid var(--primary-saffron);
}

.retry-btn {
  background: var(--primary-saffron);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: var(--secondary-saffron);
  transform: translateY(-2px);
}
