/**
 * SafiPure Theme - CSS Animations
 * Converted from Framer Motion to pure CSS
 *
 * @package SafiPure
 */

/* ==========================================================================
   Animation Delays
   ========================================================================== */

.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-150 { animation-delay: 150ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-600 { animation-delay: 600ms; }
.animation-delay-700 { animation-delay: 700ms; }
.animation-delay-800 { animation-delay: 800ms; }
.animation-delay-1000 { animation-delay: 1000ms; }
.animation-delay-1500 { animation-delay: 1500ms; }
.animation-delay-2000 { animation-delay: 2000ms; }

/* ==========================================================================
   Fade In Animations
   ========================================================================== */

/* Fade In Up - Primary entrance animation */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Fade In Down */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
    opacity: 0;
}

/* Fade In Left */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
    opacity: 0;
}

/* Fade In Right */
@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
    opacity: 0;
}

/* Simple Fade In */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

/* ==========================================================================
   Scale Animations
   ========================================================================== */

/* Scale In - Pop entrance effect */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
    opacity: 0;
}

/* Scale In Up - Combined scale and translate */
@keyframes scaleInUp {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-scale-in-up {
    animation: scaleInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* ==========================================================================
   Pulse Animations
   ========================================================================== */

/* Slow Pulse - For decorative elements */
@keyframes pulseSlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

/* Slow Pulse Reverse - Offset timing for layered effects */
@keyframes pulseSlowReverse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
    50% {
        opacity: 0.3;
        transform: scale(1);
    }
}

.animate-pulse-slow-reverse {
    animation: pulseSlowReverse 4s ease-in-out infinite;
}

/* Ring Pulse - For badge/notification rings */
@keyframes pulseRing {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.animate-pulse-ring {
    animation: pulseRing 2s ease-in-out infinite;
}

/* Subtle Pulse - Very gentle pulse effect */
@keyframes pulseSubtle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

.animate-pulse-subtle {
    animation: pulseSubtle 3s ease-in-out infinite;
}

/* ==========================================================================
   Float Animations
   ========================================================================== */

/* Slow Float - Gentle up/down motion */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float-slow {
    animation: floatSlow 4s ease-in-out infinite;
}

/* Slow Float Reverse - Offset for layered floating */
@keyframes floatSlowReverse {
    0%, 100% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0);
    }
}

.animate-float-slow-reverse {
    animation: floatSlowReverse 4s ease-in-out infinite;
}

/* Float with Rotate - Adds slight rotation */
@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-2deg);
    }
}

.animate-float-rotate {
    animation: floatRotate 5s ease-in-out infinite;
}

/* ==========================================================================
   Bounce Animations
   ========================================================================== */

/* Slow Bounce - Gentle bouncing */
@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-15px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce-slow {
    animation: bounceSlow 2s infinite;
}

/* Bounce In - Entry bounce effect */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

/* ==========================================================================
   Progress Bar Animations
   ========================================================================== */

/* Progress Bar Width Animation */
@keyframes progressBar {
    0% {
        width: 0;
    }
    100% {
        width: var(--progress-width, 100%);
    }
}

.animate-progress-bar {
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

/* Specific Progress Widths */
.animate-progress-95 {
    --progress-width: 95%;
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

.animate-progress-90 {
    --progress-width: 90%;
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

.animate-progress-85 {
    --progress-width: 85%;
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

.animate-progress-75 {
    --progress-width: 75%;
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

.animate-progress-60 {
    --progress-width: 60%;
    animation: progressBar 1.5s ease-out forwards;
    animation-delay: 0.5s;
    width: 0;
}

/* ==========================================================================
   Rotation Animations
   ========================================================================== */

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

.animate-spin-slow {
    animation: spinSlow 20s linear infinite;
}

/* Reverse Slow Spin */
.animate-spin-slow-reverse {
    animation: spinSlow 25s linear infinite reverse;
}

/* Wiggle - For attention-grabbing elements */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(3deg);
    }
    75% {
        transform: rotate(-3deg);
    }
}

.animate-wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

/* ==========================================================================
   Water/Liquid Animations
   ========================================================================== */

/* Water Wave - For water-themed decorations */
@keyframes waterWave {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(-5px) translateY(3px);
    }
    50% {
        transform: translateX(0) translateY(5px);
    }
    75% {
        transform: translateX(5px) translateY(3px);
    }
}

.animate-water-wave {
    animation: waterWave 3s ease-in-out infinite;
}

/* Water Drop - Falling drop effect */
@keyframes waterDrop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

.animate-water-drop {
    animation: waterDrop 2s ease-in-out infinite;
}

/* Water Fill - For progress/fill animations */
@keyframes waterFill {
    0% {
        height: 0;
    }
    100% {
        height: var(--fill-height, 100%);
    }
}

.animate-water-fill {
    animation: waterFill 2s ease-out forwards;
    animation-delay: 0.3s;
    height: 0;
}

/* ==========================================================================
   Shimmer/Shine Effects
   ========================================================================== */

/* Shimmer - Loading/highlight effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Shine - Button/card shine effect */
@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.animate-shine {
    position: relative;
    overflow: hidden;
}

.animate-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

/* ==========================================================================
   Gradient Animations
   ========================================================================== */

/* Gradient Shift - Background color animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* ==========================================================================
   Accordion/Expand Animations
   ========================================================================== */

/* Height expand for accordions */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-content {
    max-height: 500px;
}

/* Chevron rotation */
.faq-chevron svg {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-chevron svg {
    transform: rotate(180deg);
}

/* Icon background change */
.faq-item.active .faq-icon {
    background: linear-gradient(135deg, #00B4E5 0%, #0099D6 100%);
    color: white;
}

/* Question text color change */
.faq-item.active .faq-question {
    color: #00B4E5;
}

/* Chevron background change */
.faq-item.active .faq-chevron {
    background: linear-gradient(135deg, #00B4E5 0%, #0099D6 100%);
    color: white;
}

/* ==========================================================================
   Tab Animations
   ========================================================================== */

/* Tab content fade */
.tab-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    opacity: 1;
}

/* Tab panel slide */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

/* ==========================================================================
   Number Counter Animation
   ========================================================================== */

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

.animate-count-up {
    animation: countUp 0.5s ease-out forwards;
    opacity: 0;
}

/* ==========================================================================
   Stagger Animation Helper Classes
   ========================================================================== */

/* For staggered list animations */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 100ms; }
.stagger-children > *:nth-child(3) { animation-delay: 200ms; }
.stagger-children > *:nth-child(4) { animation-delay: 300ms; }
.stagger-children > *:nth-child(5) { animation-delay: 400ms; }
.stagger-children > *:nth-child(6) { animation-delay: 500ms; }
.stagger-children > *:nth-child(7) { animation-delay: 600ms; }
.stagger-children > *:nth-child(8) { animation-delay: 700ms; }
.stagger-children > *:nth-child(9) { animation-delay: 800ms; }
.stagger-children > *:nth-child(10) { animation-delay: 900ms; }

/* ==========================================================================
   Scroll-Triggered Animation Setup
   ========================================================================== */

/* Elements that should animate when scrolled into view */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.in-view {
    opacity: 1;
}

.scroll-animate.fade-up {
    transform: translateY(30px);
}

.scroll-animate.fade-up.in-view {
    transform: translateY(0);
}

.scroll-animate.fade-down {
    transform: translateY(-30px);
}

.scroll-animate.fade-down.in-view {
    transform: translateY(0);
}

.scroll-animate.fade-left {
    transform: translateX(-30px);
}

.scroll-animate.fade-left.in-view {
    transform: translateX(0);
}

.scroll-animate.fade-right {
    transform: translateX(30px);
}

.scroll-animate.fade-right.in-view {
    transform: translateX(0);
}

.scroll-animate.scale-in {
    transform: scale(0.9);
}

.scroll-animate.scale-in.in-view {
    transform: scale(1);
}

/* ==========================================================================
   Hover Animation Utilities
   ========================================================================== */

/* Card lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Scale up on hover */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow effect on hover */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 180, 229, 0.4);
}

/* ==========================================================================
   Mobile Menu Animation
   ========================================================================== */

/* Mobile menu slide */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Hamburger animation */
.hamburger-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open .hamburger-line:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.open .hamburger-line:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Loading/Skeleton Animations
   ========================================================================== */

@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #e0e0e0 40px,
        #f0f0f0 80px
    );
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Print Styles - Disable animations for print
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        transition-duration: 0s !important;
    }
}

/* ==========================================================================
   Reduced Motion - Accessibility
   ========================================================================== */

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

    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-fade-in,
    .animate-scale-in,
    .animate-scale-in-up,
    .animate-bounce-in,
    .animate-count-up {
        opacity: 1;
        transform: none;
    }
}
