/* 
 * Animations CSS File for mediniainamukai.lt
 * Author: Mediniai Nameliai
 * Version: 1.0.0
 * Copyright 2025
 */

/* ==================== ANIMATION UTILITIES ==================== */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.8s;
    transition-timing-function: ease;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
}

[data-aos="fade-down"] {
    transform: translateY(-50px);
}

[data-aos="fade-left"] {
    transform: translateX(50px);
}

[data-aos="fade-right"] {
    transform: translateX(-50px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-out"] {
    transform: scale(1.1);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ==================== COUNTER ANIMATION ==================== */
.counter-animation {
    display: inline-block;
    position: relative;
}

.counter-animation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease;
}

.counter-animation.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ==================== HOVER EFFECTS ==================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ==================== 3D HOUSE VIEWER ANIMATIONS ==================== */
.house-3d-wrapper {
    perspective: 1000px;
}

.house-3d-model {
    transform-style: preserve-3d;
    transition: transform 1s ease;
}

.house-3d-model.rotate {
    animation: rotate3D 15s infinite linear;
}

@keyframes rotate3D {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* ==================== TEXT ANIMATIONS ==================== */
.text-reveal {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.text-reveal.active span {
    transform: translateY(0);
    opacity: 1;
}

.typing-animation {
    position: relative;
    display: inline-block;
}

.typing-animation::after {
    content: '|';
    position: absolute;
    right: -10px;
    top: 0;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* ==================== ANIMATED BACKGROUND ==================== */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.animated-shape {
    position: absolute;
    background-color: rgba(122, 174, 58, 0.1);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

.animated-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.animated-shape:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 20%;
    right: -100px;
    animation-delay: 3s;
}

.animated-shape:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 10%;
    animation-delay: 6s;
}

.animated-shape:nth-child(4) {
    width: 80px;
    height: 80px;
    bottom: -40px;
    right: 20%;
    animation-delay: 9s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, 50px) rotate(45deg);
    }
    50% {
        transform: translate(0, 100px) rotate(90deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(45deg);
    }
}

/* ==================== TESTIMONIAL SLIDER ANIMATIONS ==================== */
.testimonial-slider {
    position: relative;
}

.testimonial-slide {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.testimonial-slide.active {
    opacity: 1;
    transform: scale(1);
}

/* ==================== GALLERY ANIMATIONS ==================== */
.gallery-view-animation {
    overflow: hidden;
    position: relative;
}

.gallery-view-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    z-index: 1;
}

.gallery-view-animation.active::before {
    transform: translateX(0);
}

.gallery-view-animation.exit::before {
    transform: translateX(100%);
}

/* ==================== PAGE TRANSITION ANIMATIONS ==================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.page-transition.active {
    transform: translateY(0);
}

.page-transition.exit {
    transform: translateY(-100%);
}

/* ==================== SCROLL ANIMATIONS ==================== */
.scroll-animate-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate-item.show {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for items */
.scroll-animate-group .scroll-animate-item:nth-child(1) { transition-delay: 0.1s; }
.scroll-animate-group .scroll-animate-item:nth-child(2) { transition-delay: 0.2s; }
.scroll-animate-group .scroll-animate-item:nth-child(3) { transition-delay: 0.3s; }
.scroll-animate-group .scroll-animate-item:nth-child(4) { transition-delay: 0.4s; }
.scroll-animate-group .scroll-animate-item:nth-child(5) { transition-delay: 0.5s; }
.scroll-animate-group .scroll-animate-item:nth-child(6) { transition-delay: 0.6s; }
.scroll-animate-group .scroll-animate-item:nth-child(7) { transition-delay: 0.7s; }
.scroll-animate-group .scroll-animate-item:nth-child(8) { transition-delay: 0.8s; }
.scroll-animate-group .scroll-animate-item:nth-child(9) { transition-delay: 0.9s; }
.scroll-animate-group .scroll-animate-item:nth-child(10) { transition-delay: 1s; }

/* ==================== LOADING ANIMATIONS ==================== */
.loading-dots {
    display: inline-flex;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(122, 174, 58, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== MODAL ANIMATIONS ==================== */
.modal-slide-in {
    transform: translateY(50px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.modal-slide-in.active {
    transform: translateY(0);
    opacity: 1;
}

/* ==================== BUTTON ANIMATIONS ==================== */
.btn-pulse {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(122, 174, 58, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(122, 174, 58, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(122, 174, 58, 0);
    }
}

.btn-shake {
    animation: btnShake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes btnShake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}