/* 
 * Enhanced Animations CSS
 * Provides smooth, professional animations for the TurbineWorks website
 * These animations are designed to be subtle and enhance the user experience
 */

/* Smooth reveal keyframes */
@keyframes smoothReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Subtle scale up */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pop-up animation */
@keyframes popUp {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Section animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Title animations */
.animate-title {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out 0.1s, transform 0.5s ease-out 0.1s;
}

.animate-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Subtitle animations */
.animate-subtitle {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease-out 0.2s, transform 0.5s ease-out 0.2s;
}

.animate-subtitle.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Card animations - with bounce effect */
.animate-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Process step animations - slide from left */
.animate-step {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-step.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Metric box animations - clean look without wave pattern */
.animate-metric {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff; /* Clean solid background */
}

.animate-metric.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Material item animations - fade in from right */
.animate-material {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-material.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* FAQ item animations - subtle fade in */
.animate-faq {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-faq.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Form field focus animation */
.input-focused {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

/* Button hover animations */
.btn {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
}

/* Accessibility consideration */
@media (prefers-reduced-motion) {
    *:not(.engine-fan) {
        animation-duration: 0.001s !important;
        animation-delay: 0s !important;
        transition-duration: 0.001s !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Main service items - smooth animation */
.service-item {
    animation: smoothReveal 0.7s ease-out forwards;
    transform-origin: center center;
    opacity: 0;
    will-change: opacity, transform;
}

/* Staggered animation delays - very short to avoid jarring effect */
.service-item:nth-child(1) {
    animation-delay: 0.05s;
}
.service-item:nth-child(2) {
    animation-delay: 0.1s;
}
.service-item:nth-child(3) {
    animation-delay: 0.15s;
}
.service-item:nth-child(4) {
    animation-delay: 0.2s;
}
.service-item:nth-child(5) {
    animation-delay: 0.25s;
}
.service-item:nth-child(6) {
    animation-delay: 0.3s;
}
.service-item:nth-child(7) {
    animation-delay: 0.35s;
}
.service-item:nth-child(8) {
    animation-delay: 0.4s;
}
.service-item:nth-child(9) {
    animation-delay: 0.45s;
}

/* Why Choose Us items - gentle reveal */
.why-choose-item {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
}

.why-choose-item:nth-child(1) {
    animation-delay: 0.05s;
}
.why-choose-item:nth-child(2) {
    animation-delay: 0.1s;
}
.why-choose-item:nth-child(3) {
    animation-delay: 0.15s;
}
.why-choose-item:nth-child(4) {
    animation-delay: 0.2s;
}

/* Standard fade-in elements */
.fade-in {
    animation: smoothReveal 0.8s ease-out forwards;
    opacity: 0;
}

/* Section titles animation */
.section-heading {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
}

/* Testimonial animations */
.testimonial-card {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
}

.testimonial-card:nth-child(1) {
    animation-delay: 0.05s;
}
.testimonial-card:nth-child(2) {
    animation-delay: 0.15s;
}

/* Leasing page specific animations */
.asset-type-card {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
}

.asset-type-card:nth-child(1) {
    animation-delay: 0.05s;
}
.asset-type-card:nth-child(2) {
    animation-delay: 0.15s;
}
.asset-type-card:nth-child(3) {
    animation-delay: 0.25s;
}

/* Enhanced hover effect for leasing cards */
.asset-type-card::before {
    transition: transform 0.4s ease-out !important;
}
.asset-type-card:hover::before {
    transform: scaleX(1) !important;
}

/* Process steps animations */
.process-step {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
}

.process-step:nth-child(1) {
    animation-delay: 0.05s;
}
.process-step:nth-child(2) {
    animation-delay: 0.1s;
}
.process-step:nth-child(3) {
    animation-delay: 0.15s;
}
.process-step:nth-child(4) {
    animation-delay: 0.2s;
}
.process-step:nth-child(5) {
    animation-delay: 0.25s;
}
.process-step:nth-child(6) {
    animation-delay: 0.3s;
}

/* Card animations */
.card:not(.testimonial-card):not(.service-item) {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
}

/* Highlight box animations */
.highlight-box, .border-warning, .border-success, .alert {
    animation: smoothReveal 0.7s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
    animation-delay: 0.15s;
}

/* Animation trigger on scroll - using Intersection Observer */
.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.revealed {
    animation: smoothReveal 0.8s ease-out forwards;
} 

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient text animation */
@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

/* Floating animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

/* New animations for consulting page */

/* Fade in up animation for elements */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for cards */
.consulting-card, .expertise-card {
    transition-delay: calc(var(--animation-order, 0) * 0.1s);
}

/* Shimmer effect for buttons */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
}

.btn-primary:hover::after {
    animation: shimmer 1.5s infinite;
}

/* Floating animation for icons */
.consulting-icon i, .expertise-icon i {
    animation: float 4s ease-in-out infinite;
}

/* Gradient border animation */
.gradient-border {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #f8b332, #0c2340, #f8b332, #0c2340);
    background-size: 400% 400%;
    z-index: -1;
    animation: gradientBorder 3s ease infinite;
    border-radius: 18px;
}

@keyframes gradientBorder {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Pulse animation for CTA */
.floating-cta .btn {
    animation: pulse 2s infinite;
}

/* Reveal text animation */
.reveal-text {
    position: relative;
    color: transparent;
    animation: revealText 1.5s ease forwards;
}

@keyframes revealText {
    0% {
        color: transparent;
    }
    50% {
        color: transparent;
    }
    100% {
        color: inherit;
    }
}

.reveal-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #f8b332;
    animation: revealTextAfter 1.5s ease forwards;
}

@keyframes revealTextAfter {
    0% {
        width: 0%;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 100%;
        left: 100%;
    }
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(90deg, #0c2340, #f8b332, #0c2340);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s linear infinite;
}

/* Parallax scroll effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: background-position 0.5s ease-out;
}

/* 3D card tilt effect */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.5s ease;
}

.tilt-card:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

.tilt-card-content {
    transform: translateZ(20px);
    transition: transform 0.5s ease;
}

/* Typewriter text effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid #f8b332;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #f8b332 }
}