/* ==========================================================================
   The Boundary Restaurant + Bar - Animations (Light Mode + Olive)
   ========================================================================== */

/* Film Grain Texture */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Hero Cinematic Entrance Animation (Pure CSS - Always Animates on Enter)
   ========================================================================== */
@keyframes heroEntranceFadeUp {
  0% {
    opacity: 0;
    transform: translateY(32px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-reveal-fade-up {
  opacity: 1;
}

.hero-stagger-1 {
  opacity: 0;
  animation: heroEntranceFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.hero-stagger-2 {
  opacity: 0;
  animation: heroEntranceFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-stagger-3 {
  opacity: 0;
  animation: heroEntranceFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.hero-stagger-4 {
  opacity: 0;
  animation: heroEntranceFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero-stagger-5 {
  opacity: 0;
  animation: heroEntranceFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
@keyframes safetyRevealFallback {
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  /* Fallback: if observer or JS lags, ensure content smoothly reveals after 1.2s */
  animation: safetyRevealFallback 0.4s ease 1.2s forwards;
}

.reveal-fade-up.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
  animation: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  animation: safetyRevealFallback 0.4s ease 1.2s forwards;
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1 !important; transform: translateY(0) !important; animation: none; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.15s; opacity: 1 !important; transform: translateY(0) !important; animation: none; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.25s; opacity: 1 !important; transform: translateY(0) !important; animation: none; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.35s; opacity: 1 !important; transform: translateY(0) !important; animation: none; }

/* Booking Submit Loading Spinner */
.booking-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(180, 198, 151, 0.25);
  border-top-color: #B4C697;
  border-radius: 50%;
  animation: bookingSpin 0.75s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

/* Image Hover Zoom */
.img-zoom {
  transition: transform var(--transition-luxury), filter var(--transition-smooth);
}

.img-zoom:hover {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-fade-up, .reveal-stagger > *, .hero-stagger-1, .hero-stagger-2, .hero-stagger-3, .hero-stagger-4, .hero-stagger-5 {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
