/* 
Oh Sugar Website - Animations Stylesheet
*/

/* ======= Animation Keyframes ======= */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Purple Glow Animations */
@keyframes purpleGlow {
  0% {
    box-shadow: 0 0 5px rgba(142, 68, 173, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.6),
      0 0 30px rgba(142, 68, 173, 0.4);
  }
  100% {
    box-shadow: 0 0 5px rgba(142, 68, 173, 0.3);
  }
}

@keyframes purplePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(142, 68, 173, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(142, 68, 173, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(142, 68, 173, 0);
  }
}

@keyframes purpleShimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes purpleFloat {
  0%,
  100% {
    transform: translateY(0px);
    box-shadow: 0 5px 15px rgba(142, 68, 173, 0.2);
  }
  50% {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(142, 68, 173, 0.3);
  }
}

@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 float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Extra animations used on contact page */
@keyframes tiltIn {
  0% {
    opacity: 0;
    transform: rotate(-3deg) translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) translateY(0) scale(1);
  }
}

@keyframes blurIn {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* ======= Animation Classes ======= */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s forwards;
  animation-delay: var(--delay, 0s);
}

.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-fade-down.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-fade-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 10s linear infinite;
}

.animate-tilt-in {
  opacity: 0;
  animation: tiltIn 600ms ease-out forwards;
}

.animate-blur-in {
  opacity: 0;
  animation: blurIn 600ms ease-out forwards;
}

/* Purple Glow Animation Classes */
.animate-purple-glow {
  animation: purpleGlow 2s ease-in-out infinite;
}

.animate-purple-pulse {
  animation: purplePulse 2s ease-in-out infinite;
}

.animate-purple-shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(142, 68, 173, 0.4),
    transparent
  );
  background-size: 200% 100%;
  animation: purpleShimmer 3s ease-in-out infinite;
}

.animate-purple-float {
  animation: purpleFloat 3s ease-in-out infinite;
}

/* Enhanced fade-in with purple glow */
.animate-fade-up-glow {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.animate-fade-up-glow.visible {
  opacity: 1;
  transform: translateY(0);
  animation: purpleGlow 1.5s ease-in-out 0.5s;
}

/* Button glow effects */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::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-glow:hover::before {
  left: 100%;
}

.btn-glow:hover {
  animation: purpleGlow 0.6s ease-in-out;
}

/* Apply delay to animations */
[data-delay="100"] {
  --delay: 0.1s;
}
[data-delay="200"] {
  --delay: 0.2s;
}
[data-delay="300"] {
  --delay: 0.3s;
}
[data-delay="400"] {
  --delay: 0.4s;
}
[data-delay="500"] {
  --delay: 0.5s;
}
[data-delay="600"] {
  --delay: 0.6s;
}
[data-delay="700"] {
  --delay: 0.7s;
}
[data-delay="800"] {
  --delay: 0.8s;
}
[data-delay="900"] {
  --delay: 0.9s;
}
[data-delay="1000"] {
  --delay: 1s;
}

/* Reduced Motion Media Query */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-up,
  .animate-fade-down,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale-in,
  .animate-float,
  .animate-pulse,
  .animate-rotate {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
