/* Animations and Effects */

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Page Load Animations */
.animate-on-load {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.hero__title {
    animation: fadeInLeft 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero__description {
    animation: fadeInLeft 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero__image {
    animation: fadeInRight 1s ease-out 0.3s forwards;
    opacity: 0;
}

.hero__contact-card {
    animation: fadeInUp 1s ease-out 0.6s forwards;
    opacity: 0;
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animations */
.service-card {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Accordion Animations - Smooth transitions */
.accordion__content {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .accordion__content--expanded styles are handled in components.css */

.accordion__icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion__icon--expanded {
    transform: rotate(180deg);
}

/* Hover Effects */
.card {
    transition: all var(--transition-normal) ease-out;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.chip {
    transition: all var(--transition-normal) ease-out;
}

.chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal) ease-out;
}

.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 var(--transition-slow) ease-out;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.1);
}

/* Hero CTA Button Effect */
.hero__cta-button {
    animation: float 3s ease-in-out infinite;
    transition: all var(--transition-normal) ease-out;
}

.hero__cta-button:hover {
    animation-play-state: paused;
    transform: scale(1.1) translateY(-5px);
}

/* Navigation Link Effects */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-text-primary);
    transition: width var(--transition-normal) ease-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* Social Links Hover */
.social-link {
    position: relative;
    transition: all var(--transition-normal) ease-out;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-normal) ease-out;
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover {
    transform: scale(1.15) rotate(5deg);
}

/* References Gallery Effects */
.references__item {
    overflow: hidden;
    transition: all var(--transition-normal) ease-out;
}

.references__item img {
    transition: transform var(--transition-slow) ease-out;
}

.references__item:hover img {
    transform: scale(1.1);
}

.references__item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal) ease-out;
}

.references__item:hover::after {
    opacity: 1;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Focus States for Accessibility */
.btn:focus-visible,
.nav-link:focus-visible,
.social-link:focus-visible,
.accordion__header:focus-visible {
    outline: 2px solid var(--color-text-primary);
    outline-offset: 2px;
}

/* Mobile Menu Animation */
.header__menu-toggle span {
    transition: all var(--transition-normal) ease-out;
}

.header__nav--mobile {
    transition: all var(--transition-normal) ease-out;
}

/* Parallax Effect for Hero Background */
.hero__background {
    transition: transform 0.1s ease-out;
}

/* Smooth scrolling enhancement */
html {
    scroll-behavior: smooth;
}

/* Performance optimizations */
.card,
.chip,
.btn,
.references__item {
    will-change: transform;
}

.accordion__content {
    will-change: max-height, opacity;
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero__cta-button {
        animation: none !important;
    }
}