/* ===================================
   Softrong Website - Animations
   =================================== */

/* Keyframe Animations */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Fade */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pop In */
@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Water Fall */
@keyframes waterFall {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 184, 212, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(0, 184, 212, 0);
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

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

/* Water Drops */
.water-drop {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(0, 184, 212, 0.8) 0%, rgba(0, 184, 212, 0) 70%);
    border-radius: 50%;
    animation: waterFall 3s ease-in infinite;
}

.water-drop:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.water-drop:nth-child(2) {
    left: 25%;
    animation-delay: 0.5s;
}

.water-drop:nth-child(3) {
    left: 45%;
    animation-delay: 1s;
}

.water-drop:nth-child(4) {
    left: 65%;
    animation-delay: 1.5s;
}

.water-drop:nth-child(5) {
    left: 85%;
    animation-delay: 2s;
}

/* Hero Animations */
.hero-title {
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-keyword {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.hero-keyword:nth-child(1) {
    animation-delay: 0.6s;
}

.hero-keyword:nth-child(2) {
    animation-delay: 0.75s;
}

.hero-keyword:nth-child(3) {
    animation-delay: 0.9s;
}

.hero-keyword:nth-child(4) {
    animation-delay: 1.05s;
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
    opacity: 0;
}

.scroll-indicator .mouse {
    animation: pulse 2s ease-in-out infinite;
}

/* Section Animations */
.section {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.animate-in {
    animation: slideUpFade 0.8s ease forwards;
}

/* Stat Card Animation */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Product Card Hover Animation */
.product-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image {
    animation: rotate 0.6s ease;
}

/* Store Section Animations */
.store-icon {
    animation: pulse 2s ease-in-out infinite;
}

.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    animation: popIn 0.3s ease;
}

.popular-item {
    transition: all 0.3s ease;
}

.popular-item:hover {
    animation: slideRight 0.3s ease;
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(5px);
    }
}

/* Button Animations */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-store {
    animation: pulse 2s ease-in-out infinite;
}

/* Carousel Animations */
.review-card {
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    transform: translateX(100px);
}

.review-card.active {
    opacity: 1;
    transform: translateX(0);
}

/* Star Animation */
.star-rating .star {
    display: inline-block;
    animation: starPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
}

.star:nth-child(1) {
    animation-delay: 0s;
}

.star:nth-child(2) {
    animation-delay: 0.1s;
}

.star:nth-child(3) {
    animation-delay: 0.2s;
}

.star:nth-child(4) {
    animation-delay: 0.3s;
}

.star:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes starPop {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Modal Animation */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    animation: popIn 0.3s ease;
}

.modal-icon {
    font-size: 60px;
    color: var(--brand-green);
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out;
}

/* FAB Animations */
.fab-btn {
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

#backToTop {
    opacity: 0;
    pointer-events: none;
}

/* Loading Text Animation */
.loader-text {
    animation: textPulse 1s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Particle Canvas Animation */
#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Dark Mode Specific Animations */
[data-theme="dark"] .hero-icon {
    animation: glowPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.5));
}

[data-theme="dark"] .brand-title {
    text-shadow: 
        0 0 10px rgba(0, 229, 255, 0.5),
        0 0 20px rgba(0, 229, 255, 0.3),
        0 0 30px rgba(0, 229, 255, 0.2);
}

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