/* Базові стилі для анімацій */
.animate-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.animate-element.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анімації з лівого боку */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.animate-slide-left.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Анімації з правого боку */
.animate-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.animate-slide-right.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Анімація масштабування */
.animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

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

/* Анімація з затуханням */
.animate-fade {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.animate-fade.animate-visible {
    opacity: 1;
}

/* Спеціальні анімації для карток проектів */
.project-card {
    opacity: 0;
    transform: translateX(-80px) translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

.project-card.animate-visible {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
}

/* Послідовні затримки для карток проектів */
.project-card:nth-child(1) { transition-delay: 0.1s; }
.project-card:nth-child(2) { transition-delay: 0.2s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }
.project-card:nth-child(4) { transition-delay: 0.4s; }
.project-card:nth-child(5) { transition-delay: 0.5s; }
.project-card:nth-child(6) { transition-delay: 0.6s; }
.project-card:nth-child(7) { transition-delay: 0.7s; }
.project-card:nth-child(8) { transition-delay: 0.8s; }
.project-card:nth-child(9) { transition-delay: 0.9s; }
.project-card:nth-child(10) { transition-delay: 1.0s; }

/* Додаткові ефекти для карток */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::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.6s ease;
    z-index: 1;
    pointer-events: none;
}

.project-card.animate-visible::before {
    left: 100%;
}

/* Анімація hover для карток */
.project-card.animate-visible:hover {
    transform: translateX(0) translateY(-5px) scale(1.02);
    transition: all 0.3s ease;
}

/* Анімації для переваг комерційної нерухомості */
.commercial_realestate_advantage {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.commercial_realestate_advantage.animate-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Затримки для послідовної анімації */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }
.animate-delay-6 { transition-delay: 0.6s; }

/* Анімація для секцій */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.section-animate.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Респонсивні налаштування */
@media (max-width: 768px) {
    .animate-element,
    .animate-slide-left,
    .animate-slide-right,
    .animate-scale,
    .commercial_realestate_advantage,
    .section-animate {
        transition-duration: 0.6s;
    }

    .animate-slide-left {
        transform: translateX(-30px);
    }

    .animate-slide-right {
        transform: translateX(30px);
    }

    .animate-element,
    .section-animate {
        transform: translateY(20px);
    }
}

/* Респонсивні налаштування для карток проектів */
@media (max-width: 768px) {
    .project-card {
        transform: translateX(-50px) translateY(15px) scale(0.95);
        transition-duration: 0.6s;
    }

    /* Зменшуємо затримки на мобільних */
    .project-card:nth-child(1) { transition-delay: 0.05s; }
    .project-card:nth-child(2) { transition-delay: 0.1s; }
    .project-card:nth-child(3) { transition-delay: 0.15s; }
    .project-card:nth-child(4) { transition-delay: 0.2s; }
    .project-card:nth-child(5) { transition-delay: 0.25s; }
    .project-card:nth-child(6) { transition-delay: 0.3s; }
    .project-card:nth-child(7) { transition-delay: 0.35s; }
    .project-card:nth-child(8) { transition-delay: 0.4s; }
    .project-card:nth-child(9) { transition-delay: 0.45s; }
    .project-card:nth-child(10) { transition-delay: 0.5s; }
}

/* Налаштування для користувачів, які віддають перевагу зменшеній анімації */
@media (prefers-reduced-motion: reduce) {
    .animate-element,
    .animate-slide-left,
    .animate-slide-right,
    .animate-scale,
    .animate-fade,
    .project-card,
    .commercial_realestate_advantage,
    .section-animate {
        transition-duration: 0.2s;
        transform: none;
    }
}

/* Підтримка старих браузерів */
@supports not (will-change: transform) {
    .animate-element,
    .animate-slide-left,
    .animate-slide-right,
    .animate-scale,
    .project-card,
    .commercial_realestate_advantage,
    .section-animate {
        backface-visibility: hidden;
        transform: translateZ(0);
    }
}