:root {
  --primary-color: rgb(60, 36, 21);
  --accent-color: rgba(0, 0, 0, 0.01);
  --bg-color: #ffe4c0;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
  font-family: "Quicksand", sans-serif;
  /* Fallback with JPG first */
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.1) 100%
    ),
    url("https://masalaweds.com/assets/ebook/masala-weddings-2025-2026/images/background-pattern.png") center/cover
      no-repeat,
    linear-gradient(to bottom, #bf7273 0%, #eed8d9 100%);
  background-blend-mode: overlay, soft-light, normal;
  min-height: 100vh;
}

/* Enhanced version for WebP supporting browsers */
@supports (background-image: url("data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA")) {
  body {
    background:
      linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.1) 100%
      ),
      url("https://masalaweds.com/assets/ebook/masala-weddings-2025-2026/images/background-pattern.webp") center/cover
        no-repeat,
      linear-gradient(to bottom, #bf7273 0%, #eed8d9 100%);
  }
}

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

.hero-section {
  text-align: center;
  padding: 0.5rem 0;
  position: relative;
}

.logo-container {
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out;
}

.logo {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: right;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  animation: fadeInRight 1s ease-out 0.3s both;
}

.btn {
  padding: 12px 24px;
  border: 1.5px solid #ce8892;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(125deg, #de697b 0%, #ffffff 100%);
  color: var(--primary-color);
  
  box-shadow: 0 4px 15px rgba(60, 36, 21, 0.3);
  position: relative;
  overflow: hidden;
}

.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.6s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(60, 36, 21, 0.4);
}

.btn:hover::before {
  left: 100%;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.intro-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: fadeInLeft 1s ease-out 0.3s both;
}

.intro-image-container {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.intro-image {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  transition: var(--transition);
  display: block;
}

.intro-image-container:hover .intro-image {
  transform: scale(1.05);
}

.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.intro-image-container:hover .intro-overlay {
  opacity: 1;
}

.intro-overlay-content {
  text-align: center;
  color: var(--white);
}

.intro-overlay-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
  display: inline-block;
}

.intro-overlay-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.intro-overlay-text {
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.intro-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
  text-align: center;
}

.intro-text {
  color: var(--primary-color);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  animation: fadeInRight 1s ease-out 0.6s both;
}

.gallery-item {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  aspect-ratio: 3/4;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* Gallery overlay text styles */
.overlay-text {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .overlay-text {
  opacity: 1;
}

/* Adjust overlay icon position when text is present */
.gallery-item:hover .overlay-icon {
  margin-bottom: 8px;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.overlay-icon {
  color: var(--white);
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.overlay-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.footer {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  transition: var(--transition);
  position: relative;
}

.footer-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background: linear-gradient(90deg, rgb(200, 127, 128), #b58724);
  transition: var(--transition);
  transform: translateX(-50%);
}

.footer-link:hover {
  color: #b58724;
}

.footer-link:hover::after {
  width: 100%;
}

#backToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 1000;
  border: none;
  outline: none;
  background-color: rgba(212, 165, 116, 0.9);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 18px;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

#backToTopBtn:hover {
  background-color: rgba(33, 21, 13, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#backToTopBtn.show {
  opacity: 1;
  visibility: visible;
  animation: fadeInRight 0.5s ease forwards;
}

#backToTopBtn.hide {
  opacity: 0;
  visibility: hidden;
  animation: fadeOutDown 0.3s ease forwards;
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeOutDown {
  from {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
  }
}

/* Loading animation */
.gallery-item {
  animation: fadeInUp 0.6s ease-out backwards;
}

.gallery-item:nth-child(odd) {
  animation-delay: 0.1s;
}

.gallery-item:nth-child(even) {
  animation-delay: 0.2s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .logo {
    max-width: 67%;
  }
  .main-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 80%;
    max-width: 300px;
  }

  .intro-card {
    padding: 1.5rem;
  }

  .intro-title {
    font-size: 1.3rem;
  }

  .intro-text {
    font-size: 0.95rem;
  }
}

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

  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .gallery-item {
    aspect-ratio: 3/4;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .intro-card {
    background: var(--white);
    border: 2px solid var(--primary-color);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.btn:focus,
.gallery-item:focus,
.footer-link:focus,
.intro-image-container:focus-within {
  outline: 0px solid var(--accent-color);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}
