/* Enhanced Animations - Performance Optimized */

/* Core Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0) translateX(-50%);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0,-15px,0) translateX(-50%);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0,-8px,0) translateX(-50%);
    }
    90% {
        transform: translate3d(0,-2px,0) translateX(-50%);
    }
}

@keyframes pulse {
    0% {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translate3d(0, -100%, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translate3d(0, 100%, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale3d(0.8, 0.8, 0.8);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -10px, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Animation Classes - Performance Optimized */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out both;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.animate-slide-in-top {
    animation: slideInFromTop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-slide-in-bottom {
    animation: slideInFromBottom 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Staggered Animations with Performance */
.stagger-animate > * {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.stagger-animate > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animate > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animate > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animate > *:nth-child(6) { animation-delay: 0.6s; }

/* Scroll Animations - Optimized with Intersection Observer */
.fade-in-scroll {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Different scroll animation directions */
.fade-in-scroll-left {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.fade-in-scroll-left.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.fade-in-scroll-right {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.fade-in-scroll-right.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.hover-lift:hover {
    transform: translate3d(0, -8px, 0);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

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

.hover-glow {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

/* Enhanced Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translate3d(0, -2px, 0);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    will-change: transform;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading Animation */
.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
    background-size: 800px 104px;
    position: relative;
    overflow: hidden;
}

/* Text Animations */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shimmer {
    background: linear-gradient(90deg, var(--dark), var(--primary), var(--dark));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 3s infinite;
}

@keyframes textShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Hero Title Animation */
.hero-title .title-line {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
}

.hero-title .title-line:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-title .title-line:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-title .title-line:nth-child(3) {
    animation-delay: 0.6s;
}

/* Enhanced Feature Card Animations */
.feature-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.feature-card:hover {
    transform: translate3d(0, -10px, 0);
}

.feature-card:hover .feature-icon {
    animation: pulse 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-icon {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Enhanced Home Card Animations */
.home-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.home-card:hover {
    transform: translate3d(0, -8px, 0);
}

.home-image img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Process Step Animations */
.step {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step:hover {
    transform: translate3d(0, -5px, 0);
}

.step:hover .step-number {
    animation: pulse 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step-number {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Navigation Animations */
.nav-link {
    position: relative;
    transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Gallery Animations */
.thumbnail {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

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

.thumbnail.active {
    transform: scale(1.05);
}

.gallery-nav {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.gallery-nav:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Form Animations */
.form-group input,
.form-group select,
.form-group textarea {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
}

/* Value Card Animations */
.value-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.value-card:hover {
    transform: translate3d(0, -5px, 0);
}

.value-card:hover .value-icon {
    animation: pulse 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.value-icon {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Team Member Animations */
.team-member {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.team-member:hover {
    transform: translate3d(0, -5px, 0);
}

.team-member:hover .member-photo {
    transform: scale(1.1);
}

.member-photo {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Contact Method Animations */
.contact-method {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-method:hover {
    transform: translateX(10px);
}

.contact-method:hover .method-icon {
    animation: pulse 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.method-icon {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Sidebar Card Animations */
.sidebar-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.sidebar-card:hover {
    transform: translateY(-5px);
}

/* Performance Optimizations for Animations */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-pulse,
    .animate-bounce,
    .animate-slide-in-top,
    .animate-slide-in-bottom,
    .animate-scale-in,
    .animate-float,
    .stagger-animate > *,
    .fade-in-scroll,
    .hover-lift,
    .hover-scale,
    .btn::before,
    .loading,
    .hero-title .title-line,
    .feature-card,
    .feature-icon,
    .home-card,
    .home-image img,
    .step,
    .step-number,
    .nav-link::after,
    .thumbnail,
    .gallery-nav,
    .value-card,
    .value-icon,
    .team-member,
    .member-photo,
    .contact-method,
    .method-icon,
    .sidebar-card {
        animation: none !important;
        transition: none !important;
    }
    
    .fade-in-scroll,
    .fade-in-scroll-left,
    .fade-in-scroll-right {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hero-title .title-line {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
    
    .feature-card:hover,
    .home-card:hover,
    .value-card:hover,
    .team-member:hover,
    .sidebar-card:hover {
        transform: none !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover,
    .hover-scale:hover,
    .feature-card:hover,
    .home-card:hover,
    .step:hover,
    .value-card:hover,
    .team-member:hover,
    .sidebar-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .dropdown:hover .dropdown-content {
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    .thumbnail:hover {
        transform: none;
    }
    
    .gallery-nav:hover {
        transform: translateY(-50%);
    }
    
    .contact-method:hover {
        transform: none;
    }
}

/* Animation delays for staggered effects */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Animation durations */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }