﻿/* Base animation styles */
* {
    transition: all 0.3s ease;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Base animation trigger for intersection observer */
section,
.service-card,
.project-card {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

section.animate-in,
.service-card.animate-in,
.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for service cards */
.service-card:nth-child(1) {
    transition-delay: 0.1s;
}

.service-card:nth-child(2) {
    transition-delay: 0.2s;
}

.service-card:nth-child(3) {
    transition-delay: 0.3s;
}

.service-card:nth-child(4) {
    transition-delay: 0.4s;
}

.service-card:nth-child(5) {
    transition-delay: 0.5s;
}

.service-card:nth-child(6) {
    transition-delay: 0.6s;
}

.service-card:nth-child(7) {
    transition-delay: 0.7s;
}

/* Hero animations */
.hero-content>* {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

.hero-title {
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation-delay: 0.4s;
}

.cta-button {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header animations */
.header {
    opacity: 0;
    transform: translateY(-100%);
    animation: slideInDown 0.8s ease forwards;
    animation-delay: 0.1s;
}

@keyframes slideInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Company logos animation */
.company-logo {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.companies-section.animate-in .company-logo {
    opacity: 1;
    transform: scale(1);
}

.company-logo:nth-child(1) {
    transition-delay: 0.1s;
}

.company-logo:nth-child(2) {
    transition-delay: 0.2s;
}

.company-logo:nth-child(3) {
    transition-delay: 0.3s;
}

/* Button hover animations */
.cta-button,
.contact-btn,
.service-btn,
.filter-btn {
    transition: all 0.3s ease;
}

.cta-button:hover,
.contact-btn:hover,
.service-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
    transform: translateY(-2px);
}

/* Service card hover animations */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Project card hover animations */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Icon animations */
.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Text animations */
.hero-title,
.companies-title,
.about-title,
.section-title,
.contact-title {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero.animate-in .hero-title,
.companies-section.animate-in .companies-title,
.about-section.animate-in .about-title,
.services-section.animate-in .section-title,
.projects-section.animate-in .section-title,
.contact-section.animate-in .contact-title {
    opacity: 1;
    transform: translateY(0);
}

/* About section image animation */
.about-image {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-section.animate-in .about-image {
    opacity: 1;
    transform: translateX(0);
}

.about-text {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-section.animate-in .about-text {
    opacity: 1;
    transform: translateX(0);
}

/* Contact form animation */
.contact-form {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contact-section.animate-in .contact-form {
    opacity: 1;
    transform: scale(1);
}

/* Footer animation */
.footer {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.footer.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Link hover animations */
a {
    transition: color 0.3s ease;
}

.nav-list a:hover {
    color: var(--primary-start);
}

.footer-section a:hover {
    color: var(--primary-start);
    transform: translateX(5px);
}

/* Loading animation for buttons */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Smooth transitions for mobile menu */
.mobile-sidebar {
    transition: right 0.3s ease;
}

.mobile-sidebar.open {
    right: 0;
}

/* Gradient text animation */
.gradient-text,
.logo-text {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating animation for hero elements */
.hero-bg-image {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Reveal animation for sections */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typing animation for hero title */
.typing-animation {
    overflow: hidden;
    border-right: 3px solid var(--primary-start);
    white-space: nowrap;
    animation: typing 3s 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: var(--primary-start);
    }
}

/* Responsive animations */
@media (max-width: 768px) {

    section,
    .service-card,
    .project-card {
        transform: translateY(30px);
    }

    .hero-title,
    .companies-title,
    .about-title,
    .section-title,
    .contact-title {
        transform: translateY(15px);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}