/* ============================================================
   CASBAH ALGERIA — ANIMATIONS
   animations.css — Keyframes, Scroll Reveal Classes, Interactions
   ============================================================ */

/* ============================================================
   PAGE LOAD STAGGER CLASSES
   ============================================================ */

.stagger-1 { animation-delay: 100ms !important; }
.stagger-2 { animation-delay: 200ms !important; }
.stagger-3 { animation-delay: 300ms !important; }
.stagger-4 { animation-delay: 400ms !important; }
.stagger-5 { animation-delay: 500ms !important; }
.stagger-6 { animation-delay: 600ms !important; }
.stagger-7 { animation-delay: 700ms !important; }
.stagger-8 { animation-delay: 800ms !important; }

/* ============================================================
   SCROLL REVEAL (Used with Intersection Observer)
   ============================================================ */

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Base fade with delay option */
.fade-in {
  opacity: 0;
  transition: opacity 1s ease;
}

.fade-in.is-visible {
  opacity: 1;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

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

/* Nav links slide down */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero text letter by letter animation */
@keyframes textFocusIn {
  0% {
    filter: blur(8px);
    opacity: 0;
  }
  100% {
    filter: blur(0);
    opacity: 1;
  }
}

/* Continuous rotation */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes float-complex {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -15px) rotate(2deg); }
  66% { transform: translate(-5px, -8px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Continuous horizontal scroll for marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   SPECIFIC ANIMATION CLASSES
   ============================================================ */

.anim-fade-up {
  animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-nav-slide {
  animation: slideDownFade 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-letter {
  display: inline-block;
  opacity: 0;
  animation: textFocusIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.anim-spin-hover:hover {
  animation: spinSlow 3s linear infinite;
}

.anim-float {
  animation: float 6s ease-in-out infinite;
}

.anim-float-complex {
  animation: float-complex 8s ease-in-out infinite;
}

/* ============================================================
   3D FLIP (For Recipe Cards)
   ============================================================ */

.flip-card-container {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card-container:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  top: 0;
  left: 0;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ============================================================
   CARDS HOVER EFFECTS (Bleed in)
   ============================================================ */

.card-hover-bleed {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card-hover-bleed::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(to top, var(--shadow-warm), transparent);
  transition: height 0.4s ease;
  z-index: -1;
  opacity: 0;
}

.card-hover-bleed:hover::before {
  height: 100%;
  opacity: 1;
}

/* ============================================================
   ACCORDION TRANSITIONS (For Arts Techniques)
   ============================================================ */

.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.accordion-content > div {
  overflow: hidden;
}

.accordion-item.active .accordion-content {
  grid-template-rows: 1fr;
}

.accordion-header .icon {
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header .icon {
  transform: rotate(180deg);
}
