/* Animations for Financial Audit Website */

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Button Hover Animation */
.btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(-1px);
}

/* Hero Wave Animation */
@keyframes wave {
    0% {
        transform: translateX(0) translateZ(0) scaleY(1);
    }
    50% {
        transform: translateX(-25%) translateZ(0) scaleY(0.8);
    }
    100% {
        transform: translateX(-50%) translateZ(0) scaleY(1);
    }
}

.hero::after {
    animation: wave 15s linear infinite;
}

/* Service Card Hover Animation */
.service-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Service Icon Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.service-item:hover .service-icon {
    animation: pulse 2s ease infinite;
}

/* Testimonial Rotation Animation */
@keyframes testimonialRotate {
    0%, 20% {
        opacity: 0;
        transform: translateX(-20px);
    }
    25%, 95% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

.testimonial-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: testimonialRotate 15s infinite;
}

.testimonial-item:nth-child(1) {
    animation-delay: 0s;
}

.testimonial-item:nth-child(2) {
    animation-delay: 5s;
}

.testimonial-item:nth-child(3) {
    animation-delay: 10s;
}

/* Form Label Animation */
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-select:focus + .form-label,
.form-select:not(:placeholder-shown) + .form-label,
.form-textarea:focus + .form-label,
.form-textarea:not(:placeholder-shown) + .form-label {
    transform: translateY(-25px) scale(0.8);
    color: var(--color-indigo);
}

/* Form Input Border Animation */
.form-input,
.form-select,
.form-textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-coral);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* Gradient Border Animation */
@keyframes gradientBorder {
    0% {
        border-image-source: linear-gradient(to right, var(--color-mint), var(--color-coral));
    }
    50% {
        border-image-source: linear-gradient(to right, var(--color-coral), var(--color-indigo));
    }
    100% {
        border-image-source: linear-gradient(to right, var(--color-indigo), var(--color-mint));
    }
}

.order-form:hover {
    border: 2px solid transparent;
    border-image: linear-gradient(to right, var(--color-mint), var(--color-coral));
    border-image-slice: 1;
    animation: gradientBorder 6s linear infinite;
}

/* Blog Card Hover Animation */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-image {
    transition: transform 0.5s ease;
}

/* Number Counter Animation */
@keyframes countUp {
    0% {
        content: "0";
    }
    20% {
        content: "20";
    }
    40% {
        content: "40";
    }
    60% {
        content: "60";
    }
    80% {
        content: "80";
    }
    100% {
        content: "100";
    }
}

.counter::after {
    content: "0";
    animation: countUp 2s forwards;
}

/* Menu Toggle Animation */
.menu-toggle span {
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* FAQ Accordion Animation */
.faq-question {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.faq-answer {
    transition: max-height 0.3s ease;
}

/* Submit Button Loading Animation */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.form-btn.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    animation: loading 1s infinite linear;
}
