/**
 * Animations for domain.com
 * Financial Audit Services Website
 */

/* Fade In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.fade-in.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}

.fade-in.delay-2 {
    animation-delay: 0.4s;
    opacity: 0;
}

.fade-in.delay-3 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* Slide Up Animation */
@keyframes slideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 1s ease forwards;
}

.slide-up.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}

.slide-up.delay-2 {
    animation-delay: 0.4s;
    opacity: 0;
}

.slide-up.delay-3 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* Scale Animation */
@keyframes scaleIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.8s ease forwards;
}

/* Number Counter Animation */
@keyframes countUp {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        content: "20%";
    }
    30% {
        content: "30%";
    }
    40% {
        content: "40%";
    }
    50% {
        content: "50%";
    }
    60% {
        content: "60%";
    }
    70% {
        content: "70%";
    }
    80% {
        content: "80%";
    }
    90% {
        content: "90%";
    }
    100% {
        content: "100%";
    }
}

/* PHP-Based Counter Animation (No JavaScript) */
.statistics-section .statistic-item {
    position: relative;
}

.statistic-number {
    position: relative;
    overflow: hidden;
}

.statistic-number.animated::before {
    animation: countUp 2s forwards;
}

/* Pulsate Animation for CTA */
@keyframes pulsate {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.btn-primary.animate-pulse {
    animation: pulsate 2s infinite;
}

/* Rotate Animation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* Underline Animation (for links) */
.animate-underline {
    position: relative;
}

.animate-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-color-2);
    transition: width 0.3s ease;
}

.animate-underline:hover::after {
    width: 100%;
}

/* Form Submit Button Animation */
@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}

.btn-primary:active {
    animation: shake 0.5s ease;
}

/* Card Hover Animation (Combined) */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Service Icon Animation */
.service-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Statistic Number CSS-only Animation */
.statistic-number {
    display: inline-block;
    position: relative;
}

.animate-number {
    position: relative;
    opacity: 0;
}

.animate-number.visible {
    animation: fadeNumber 2s forwards;
    opacity: 1;
}

@keyframes fadeNumber {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Animations for Mobile Menu using PHP Toggle */
.mobile-toggle span.bar {
    transition: all 0.3s ease;
}

.mobile-toggle.close .bar1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-toggle.close .bar2 {
    opacity: 0;
}

.mobile-toggle.close .bar3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Button Hover Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: 0;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* Image Hover Effect */
.img-hover {
    overflow: hidden;
}

.img-hover img {
    transition: transform 0.5s ease;
}

.img-hover:hover img {
    transform: scale(1.1);
}

/* Testimonial Card Hover Effect */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.testimonial-card:hover .testimonial-text {
    color: var(--primary-color);
}

/* Page Transition (Simple Fade In) */
body {
    animation: pageTransition 0.5s ease;
}

@keyframes pageTransition {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
