/* ============================================================
   WitchArts.in — ANIMATIONS
   animations.css | Preloader, Scroll Reveal, Micro-interactions
   ============================================================ */

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo-img {
  max-width: 320px;
  width: 80%;
  height: auto;
  object-fit: contain;
  margin-bottom: var(--space-6);
  filter: drop-shadow(0 0 25px rgba(201, 168, 76, 0.5));
  animation: preloaderLogoGlow 2s ease-in-out infinite alternate;
}

@keyframes preloaderLogoGlow {
  0% {
    transform: scale(0.97);
    filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.3));
  }
  100% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 35px rgba(201, 168, 76, 0.8));
  }
}

.preloader-bar {
  width: 200px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.preloader-bar-fill {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: var(--radius-full);
  animation: preloaderFill 1.8s ease-in-out forwards;
}

.preloader-tagline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-top: var(--space-4);
  animation: fadeInUp 1s ease 0.5s both;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes preloaderFill {
  0% { width: 0; }
  100% { width: 100%; }
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.6s; }
.stagger-children .reveal:nth-child(8) { transition-delay: 0.7s; }

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  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 scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInFromBottom {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes goldShine {
  0%   { left: -100%; }
  100% { left: 200%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.8; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.02); }
}

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

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

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(4); opacity: 0; }
}

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

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(201,168,76,0.3); }
  50%       { box-shadow: 0 0 20px rgba(201,168,76,0.6), 0 0 40px rgba(201,168,76,0.2); }
}

@keyframes textGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(201,168,76,0.4); }
  50%       { text-shadow: 0 0 20px rgba(201,168,76,0.8), 0 0 40px rgba(201,168,76,0.3); }
}

@keyframes heroTextReveal {
  from { opacity: 0; transform: translateY(60px) skewY(3deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0); }
}

@keyframes navbarSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   ANIMATION UTILITY CLASSES
   ============================================================ */
.animate-fadeIn      { animation: fadeIn var(--transition-slow) both; }
.animate-fadeInUp    { animation: fadeInUp 0.7s ease both; }
.animate-fadeInDown  { animation: fadeInDown 0.7s ease both; }
.animate-fadeInLeft  { animation: fadeInLeft 0.7s ease both; }
.animate-fadeInRight { animation: fadeInRight 0.7s ease both; }
.animate-scaleIn     { animation: scaleIn 0.5s ease both; }
.animate-float       { animation: float 4s ease-in-out infinite; }
.animate-pulse       { animation: pulse 2s ease-in-out infinite; }
.animate-breathe     { animation: breathe 4s ease-in-out infinite; }
.animate-shimmer     { animation: shimmer 2.5s linear infinite; }
.animate-rotate      { animation: rotateSlow 20s linear infinite; }

/* Delays */
.delay-100  { animation-delay: 0.1s; }
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }
.delay-600  { animation-delay: 0.6s; }
.delay-700  { animation-delay: 0.7s; }
.delay-800  { animation-delay: 0.8s; }
.delay-1000 { animation-delay: 1.0s; }

/* ============================================================
   GOLD SHIMMER TEXT EFFECT
   ============================================================ */
.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 25%,
    #fff5c0 50%,
    var(--color-gold-light) 75%,
    var(--color-gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ============================================================
   HOVER EFFECTS
   ============================================================ */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.hover-lift-sm {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift-sm:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.hover-gold {
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.hover-gold:hover {
  box-shadow: var(--shadow-gold);
  border-color: var(--color-gold);
}

.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover { transform: scale(1.03); }

.hover-scale-img img {
  transition: transform 0.6s ease;
  overflow: hidden;
}
.hover-scale-img:hover img { transform: scale(1.08); }

/* Image overlay on hover */
.hover-overlay {
  position: relative;
  overflow: hidden;
}
.hover-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0);
  transition: background var(--transition-base);
}
.hover-overlay:hover::after {
  background: rgba(10, 10, 10, 0.3);
}

/* ============================================================
   BUTTON RIPPLE EFFECT
   ============================================================ */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ============================================================
   GOLD SHINE SWEEP EFFECT
   ============================================================ */
.gold-shine {
  position: relative;
  overflow: hidden;
}

.gold-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  z-index: 1;
  pointer-events: none;
}

.gold-shine:hover::before {
  animation: goldShine 0.7s ease forwards;
}

/* ============================================================
   MARQUEE / TICKER
   ============================================================ */
.marquee-wrapper {
  overflow: hidden;
  position: relative;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.marquee-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg), transparent);
}

.marquee-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg), transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter-item {
  animation: countUp 0.6s ease both;
}

/* ============================================================
   ACCORDION ANIMATION
   ============================================================ */
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s ease,
              opacity 0.3s ease;
  opacity: 0;
}

.accordion-item.active .accordion-body {
  max-height: 500px;
  opacity: 1;
}

/* ============================================================
   PAGE TRANSITION
   ============================================================ */
.page-transition {
  animation: fadeIn 0.4s ease both;
}

/* ============================================================
   BEFORE / AFTER SLIDER ANIMATION
   ============================================================ */
.before-after-handle {
  transition: box-shadow var(--transition-base);
}

.before-after-handle:hover {
  box-shadow: 0 0 0 6px rgba(201, 168, 76, 0.3);
}

/* ============================================================
   PARALLAX BASE
   ============================================================ */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gradient-gold);
  z-index: calc(var(--z-sticky) + 1);
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(201,168,76,0.5);
}

/* ============================================================
   CURSOR CUSTOM (DESKTOP ONLY)
   ============================================================ */
@media (hover: hover) {
  .custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--color-gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease, opacity 0.15s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
  }

  .custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.8);
    background: rgba(201, 168, 76, 0.15);
  }
}

/* ============================================================
   MODAL ANIMATIONS
   ============================================================ */
.modal-overlay {
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  animation: slideInFromBottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.hiding {
  animation: fadeIn 0.3s ease reverse;
}

/* ============================================================
   CHAT BUBBLE ANIMATION
   ============================================================ */
.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gray-300);
  animation: pulse 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ============================================================
   RICH HOMEPAGE MICRO-ANIMATIONS
   ============================================================ */
.shimmer-gold {
  position: relative;
  overflow: hidden;
}
.shimmer-gold::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(201, 168, 76, 0.25) 50%,
    transparent 70%
  );
  transform: rotate(30deg);
  animation: goldShimmerSweep 4s infinite;
}

@keyframes goldShimmerSweep {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  30%, 100% { transform: translate(100%, 100%) rotate(30deg); }
}

.floating-ambient-glow {
  animation: ambientFloat 4s ease-in-out infinite alternate;
}

@keyframes ambientFloat {
  0% { transform: translateY(0px); filter: drop-shadow(0 10px 20px rgba(201, 168, 76, 0.25)); }
  100% { transform: translateY(-8px); filter: drop-shadow(0 20px 35px rgba(201, 168, 76, 0.45)); }
}

.btn-whatsapp-pulse {
  animation: whatsappGlowPulse 2s infinite;
}

@keyframes whatsappGlowPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .marquee-track { animation: none; }
  #preloader { display: none; }
}
