/* ===================================
   GIDE Paisagismo - Animations
   =================================== */

/* Keyframe Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-15px) translateX(-50%);
    }
    60% {
        transform: translateY(-8px) translateX(-50%);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

/* Page Load Animation */
body {
    animation: fadeIn 0.6s ease-in-out;
}

/* Hero Animations */
.hero-title {
    animation: fadeIn 0.8s ease-in-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.hero-subtitle {
    animation: fadeIn 1s ease-in-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.hero .btn-primary {
    animation: fadeIn 1s ease-in-out;
    animation-delay: 0.6s;
    animation-fill-mode: both;
}

/* Scroll Reveal Animations */
.fade-in-up {
    animation: fadeIn 0.8s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-in-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-in-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-in-out;
}

/* Hover Animations */
.service-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.service-card:hover {
    animation: float 3s ease-in-out infinite;
}


.portfolio-item {
    transition: transform 0.3s ease-in-out;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

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

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

/* Image Lazy Load Animation */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Counter Animation */
.stat-number {
    transition: none;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Navigation Scroll Animation */
.navbar {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* Button Ripple Effect */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Card Flip Animation */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Gradient Animation */
.gradient-animation {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary), var(--color-terra));
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Shimmer Effect */
.shimmer-text {
    background: linear-gradient(90deg, #333 0%, #666 50%, #333 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

/* Fade In On Scroll */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Custom AOS Animations */
[data-aos="fade-in"] {
    opacity: 0;
    transition-property: opacity;
}

[data-aos="fade-in"].aos-animate {
    opacity: 1;
}

[data-aos="slide-up"] {
    transform: translateY(50px);
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

/* Mobile Menu Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Portfolio Filter Animation */
.portfolio-item {
    transition: all 0.5s ease-in-out;
}

.portfolio-item.hide {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Form Focus Animation */
.form-control:focus {
    animation: inputFocus 0.3s ease-in-out;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 95, 63, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(45, 95, 63, 0);
    }
}

/* Success Message Animation */
.form-success-message {
    animation: slideInDown 0.5s ease-in-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service Card Stagger Animation */
.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; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Tooltip Animation */
.tooltip {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Animation */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.7);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progress 1s ease-in-out;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s forwards,
               blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* Fix de compositing para iOS Safari — força criação de layer dedicada no primeiro frame */
@keyframes hamburger-init {
    from { opacity: 0.999; }
    to   { opacity: 1; }
}
