/* Torch Shop Animation Enhancements - Purple Theme */
/* This file enhances the existing website without breaking functionality */

/* ===== HERO SECTION ANIMATIONS ===== */

/* Three-Layer Liquid Gradient Animations */
@keyframes liquidWave1 {
  0%, 100% {
    transform: rotate(0deg) translate(0, 0) scale(1);
  }
  33% {
    transform: rotate(3deg) translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: rotate(-3deg) translate(-30px, 30px) scale(0.95);
  }
}

@keyframes liquidWave2 {
  0%, 100% {
    transform: rotate(0deg) translate(0, 0);
  }
  50% {
    transform: rotate(-5deg) translate(-50px, 50px);
  }
}

@keyframes liquidWave3 {
  0%, 100% {
    transform: rotate(0deg) translate(0, 0);
  }
  50% {
    transform: rotate(7deg) translate(70px, -70px);
  }
}

.liquid-gradient {
  position: relative;
  overflow: hidden;
}

.liquid-gradient::before,
.liquid-gradient::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    rgba(139, 58, 139, 0.3),
    rgba(147, 51, 234, 0.3),
    rgba(168, 85, 247, 0.3),
    rgba(196, 181, 253, 0.3)
  );
  animation: liquidWave 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.liquid-gradient::after {
  animation-delay: -7.5s;
  background: linear-gradient(
    -45deg,
    rgba(147, 51, 234, 0.2),
    rgba(139, 58, 139, 0.2),
    rgba(196, 181, 253, 0.2),
    rgba(168, 85, 247, 0.2)
  );
}

/* Typewriter effect for headings */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}

.typewriter-text {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid;
  animation: 
    typewriter 3s steps(30, end),
    blinkCursor 0.75s step-end infinite;
}

/* Rainbow text animation for COLORFUL */
@keyframes rainbow {
  0% { 
    background-position: 0% 50%;
    filter: hue-rotate(0deg);
  }
  50% { 
    background-position: 100% 50%;
    filter: hue-rotate(180deg);
  }
  100% { 
    background-position: 0% 50%;
    filter: hue-rotate(360deg);
  }
}

.rainbow-text {
  background: linear-gradient(
    90deg,
    #9333ea,
    #ec4899,
    #f97316,
    #eab308,
    #22c55e,
    #06b6d4,
    #3b82f6,
    #9333ea
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow 3s linear infinite;
  font-weight: bold;
}

/* ===== WAVE DIVIDER ANIMATIONS ===== */

@keyframes wave {
  0%, 100% {
    d: path("M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L0,320Z");
  }
  50% {
    d: path("M0,64L48,80C96,96,192,128,288,128C384,128,480,96,576,90.7C672,85,768,107,864,106.7C960,107,1056,85,1152,69.3C1248,53,1344,43,1392,37.3L1440,32L1440,320L0,320Z");
  }
}

.wave-divider {
  animation: wave 4s ease-in-out infinite;
}

/* ===== PRODUCT CARD ANIMATIONS ===== */

/* 3D Tilt Effect */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tilt-3d:hover {
  transform: perspective(1000px) rotateX(-5deg) rotateY(5deg) translateZ(20px);
}

/* Enhanced hover effects */
@keyframes cardFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

.hover-float:hover {
  animation: cardFloat 2s ease-in-out infinite;
}

/* Product image zoom */
.product-image-zoom {
  overflow: hidden;
}

.product-image-zoom img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-image-zoom:hover img {
  transform: scale(1.15) rotate(2deg);
}

/* ===== FLYING CART ANIMATION ===== */

@keyframes flyToCart {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: scale(0.8) translate(50px, -50px) rotate(45deg);
  }
  40% {
    transform: scale(0.6) translate(150px, -150px) rotate(90deg);
  }
  60% {
    transform: scale(0.4) translate(250px, -300px) rotate(180deg);
  }
  80% {
    transform: scale(0.2) translate(350px, -450px) rotate(270deg);
    opacity: 0.5;
  }
  100% {
    transform: scale(0) translate(400px, -500px) rotate(360deg);
    opacity: 0;
  }
}

.flying-product {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none;
  animation: flyToCart 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Cart bounce animation */
@keyframes cartBounce {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
  }
  25% { 
    transform: scale(1.3) rotate(-5deg);
  }
  50% { 
    transform: scale(1.2) rotate(5deg);
  }
  75% { 
    transform: scale(1.25) rotate(-3deg);
  }
}

.cart-bounce {
  animation: cartBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== SCROLL ANIMATIONS ===== */

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in-up {
  opacity: 0;
}

.fade-in-up.animated {
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  opacity: 0;
}

.fade-in-left.animated {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
}

.fade-in-right.animated {
  animation: fadeInRight 0.8s ease-out forwards;
}

.zoom-in {
  opacity: 0;
}

.zoom-in.animated {
  animation: zoomIn 0.8s ease-out forwards;
}

/* Stagger animation for lists */
.stagger-animation > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

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

/* ===== BUTTON ANIMATIONS ===== */

/* Ripple effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-container:active::before {
  width: 300px;
  height: 300px;
}

/* Pulse animation for CTAs */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(147, 51, 234, 0);
  }
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* ===== LOADING ANIMATIONS ===== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ===== FLOATING ELEMENTS ===== */

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(5deg);
  }
  66% {
    transform: translateY(10px) rotate(-5deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(20px) rotate(-5deg);
  }
  66% {
    transform: translateY(-10px) rotate(5deg);
  }
}

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

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

/* ===== GEOMETRIC SHAPES ANIMATIONS ===== */

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

@keyframes morphShape {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

.shape-morph {
  animation: morphShape 8s ease-in-out infinite;
}

.rotate-slow {
  animation: rotate 20s linear infinite;
}

.rotate-medium {
  animation: rotate 15s linear infinite;
}

.rotate-fast {
  animation: rotate 10s linear infinite;
}

/* ===== PARALLAX SCROLLING ===== */

.parallax-slow {
  transition: transform 0.5s ease-out;
}

.parallax-medium {
  transition: transform 0.3s ease-out;
}

.parallax-fast {
  transition: transform 0.1s ease-out;
}

/* ===== ARABIC CALLIGRAPHY ANIMATION ===== */

@keyframes drawPath {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
  }
}

@keyframes floatAnimation {
  0%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  25% {
    transform: translateY(-10px) translateX(-50%);
  }
  75% {
    transform: translateY(10px) translateX(-50%);
  }
}

.arabic-calligraphy path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawPath 3s ease-in-out forwards;
}

/* ===== CATEGORY CARD SPECIAL EFFECTS ===== */

/* Category-specific theming */
.category-stickers {
  --primary: #9B59B6;
  --gradient: linear-gradient(135deg, #9B59B6, #BB8FCE);
  --shadow-color: rgba(155, 89, 182, 0.3);
}

.category-pins {
  --primary: #E74C3C;
  --gradient: linear-gradient(135deg, #E74C3C, #EC7063);
  --shadow-color: rgba(231, 76, 60, 0.3);
}

.category-cards {
  --primary: #F39C12;
  --gradient: linear-gradient(135deg, #F39C12, #F8C471);
  --shadow-color: rgba(243, 156, 18, 0.3);
}

.category-custom {
  --primary: #8E44AD;
  --gradient: linear-gradient(135deg, #8E44AD, #AF7AC5);
  --shadow-color: rgba(142, 68, 173, 0.3);
}

/* Purple gradient variations for backgrounds */
.gradient-purple-1 {
  background: linear-gradient(135deg, #8b3a8b 0%, #c77dff 100%);
}

.gradient-purple-2 {
  background: linear-gradient(135deg, #663399 0%, #9d4edd 100%);
}

.gradient-purple-3 {
  background: linear-gradient(135deg, #7209b7 0%, #b298dc 100%);
}

.gradient-purple-4 {
  background: linear-gradient(135deg, #6b2c6b 0%, #a374db 100%);
}

/* Icon animations */
@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes iconRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.icon-pulse:hover {
  animation: iconPulse 0.6s ease-in-out;
}

.icon-rotate:hover {
  animation: iconRotate 0.8s ease-in-out;
}

/* ===== TESTIMONIAL ANIMATIONS ===== */

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

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

.slide-in-left {
  animation: slideInFromLeft 0.8s ease-out;
}

.slide-in-right {
  animation: slideInFromRight 0.8s ease-out;
}

/* ===== NEWSLETTER SECTION ===== */

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(147, 51, 234, 0.6);
  }
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .tilt-3d:hover {
    transform: none;
  }
  
  .hover-float:hover {
    animation: none;
    transform: translateY(-5px);
  }
  
  .flying-product {
    animation-duration: 0.5s;
  }
}

/* ===== UTILITY CLASSES ===== */

.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* ===== CUSTOM SCROLLBAR ===== */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f3e8ff;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7e22ce, #a855f7);
}
