/* ==========================================================================
   Luxora Blinds - Animation Styles
   Premium micro-interactions and visual effects
   ========================================================================== */

/* -------------------------------------------------------------------------
   Initial Page Load State
   ------------------------------------------------------------------------- */

/* No-JS fallback - elements visible if JavaScript fails */
.no-js .card--category,
.no-js .icon-box,
.no-js .testimonial {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------------------
   Custom Cursor
   ------------------------------------------------------------------------- */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
  mix-blend-mode: difference;
}

.custom-cursor--hover {
  width: 60px;
  height: 60px;
  border-color: var(--color-gold);
  background-color: rgba(200, 162, 77, 0.1);
}

.custom-cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--color-gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease;
}

.custom-cursor__dot--hover {
  transform: translate(-50%, -50%) scale(2);
  background-color: var(--color-teal);
}

/* Hide custom cursor on touch devices and mobile */
@media (max-width: 1023px), (hover: none) {
  .custom-cursor,
  .custom-cursor__dot {
    display: none !important;
  }
}

/* -------------------------------------------------------------------------
   Scroll Progress Indicator
   ------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-teal));
  transform-origin: left;
  transform: scaleX(0);
  z-index: 9998;
}

/* -------------------------------------------------------------------------
   Enhanced Button Animations
   ------------------------------------------------------------------------- */

.btn {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

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

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

/* Ripple effect container */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------
   Card Image Zoom Effect
   ------------------------------------------------------------------------- */

.card__image {
  overflow: hidden;
}

.card__image img {
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.card:hover .card__image img {
  transform: scale(1.08);
}

/* -------------------------------------------------------------------------
   Link Underline Animation
   ------------------------------------------------------------------------- */

.animated-link {
  position: relative;
  display: inline-block;
}

.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-gold);
  transition: width 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

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

/* -------------------------------------------------------------------------
   Icon Box Pulse Effect
   ------------------------------------------------------------------------- */

.icon-box__icon {
  position: relative;
}

.icon-box__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  transition: all 0.4s ease;
}

.icon-box:hover .icon-box__icon::after {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 0.5;
}

/* -------------------------------------------------------------------------
   Text Reveal Animation
   ------------------------------------------------------------------------- */

.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
}

.text-reveal.revealed span {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1),
              opacity 0.8s ease;
}

/* -------------------------------------------------------------------------
   Floating Animation
   ------------------------------------------------------------------------- */

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

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

/* Subtle float for decorative elements */
.float-subtle {
  animation: floatSubtle 4s ease-in-out infinite;
}

@keyframes floatSubtle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

/* -------------------------------------------------------------------------
   Parallax Background
   ------------------------------------------------------------------------- */

.parallax-bg {
  will-change: transform;
  transform: translateZ(0);
}

/* -------------------------------------------------------------------------
   Testimonial Card Effects
   ------------------------------------------------------------------------- */

.testimonial {
  transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1),
              box-shadow 0.4s ease;
}

.testimonial::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.testimonial:hover::before {
  border-color: var(--color-gold);
}

/* Quote icon animation */
.testimonial__quote {
  transition: transform 0.4s ease, color 0.3s ease;
}

.testimonial:hover .testimonial__quote {
  transform: scale(1.15) rotate(-5deg);
  color: var(--color-gold);
}

/* -------------------------------------------------------------------------
   Category Card Overlay Effect
   ------------------------------------------------------------------------- */

.card--category .card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 60%
  );
  opacity: 0.8;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.card--category:hover .card__image::before {
  opacity: 0.6;
}

/* -------------------------------------------------------------------------
   Badge Shine Effect
   ------------------------------------------------------------------------- */

.badge {
  position: relative;
  overflow: hidden;
}

.badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: rotate(25deg);
  animation: badgeShine 3s ease-in-out infinite;
}

@keyframes badgeShine {
  0%, 100% {
    left: -100%;
  }
  50%, 80% {
    left: 150%;
  }
}

/* -------------------------------------------------------------------------
   Social Links Hover
   ------------------------------------------------------------------------- */

.footer__social-link {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.footer__social-link:hover {
  transform: translateY(-4px) rotate(5deg);
}

/* -------------------------------------------------------------------------
   Form Input Focus Animation
   ------------------------------------------------------------------------- */

.form__input,
.form__textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form__input:focus,
.form__textarea:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(200, 162, 77, 0.15);
}

/* -------------------------------------------------------------------------
   Loading Skeleton Animation
   ------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-ivory) 25%,
    rgba(200, 162, 77, 0.1) 50%,
    var(--color-ivory) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

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

/* -------------------------------------------------------------------------
   Staggered List Animation Helper
   ------------------------------------------------------------------------- */

.stagger-list > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-list.revealed > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.stagger-list.revealed > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-list.revealed > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-list.revealed > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-list.revealed > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-list.revealed > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-list.revealed > *:nth-child(6) { transition-delay: 0.6s; }

/* -------------------------------------------------------------------------
   Hero Decorative Elements Animation
   ------------------------------------------------------------------------- */

.hero__image::before {
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.hero__image:hover::before {
  transform: translate(10px, 10px);
}

/* -------------------------------------------------------------------------
   CTA Section Background Animation
   ------------------------------------------------------------------------- */

.cta::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 20% 50%,
    rgba(200, 162, 77, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
  animation: ctaGlow 8s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
  0% {
    opacity: 0.5;
    transform: translateX(-10%);
  }
  100% {
    opacity: 1;
    transform: translateX(10%);
  }
}

/* -------------------------------------------------------------------------
   Reduce Motion Preference
   ------------------------------------------------------------------------- */

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

  .custom-cursor,
  .custom-cursor__dot {
    display: none !important;
  }
}
