/* ===== SCROLL ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

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

/* ===== STAGGERED ANIMATIONS ===== */
.stagger-animation {
    animation-delay: var(--animation-delay, 0s);
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ===== PORTFOLIO ANIMATIONS ===== */
.portfolio-item {
    animation: portfolioSlideIn 0.8s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes portfolioSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CLIENT LOGO ANIMATIONS ===== */
.client-logo {
    animation: logoFadeIn 0.6s ease forwards;
    opacity: 0;
    transform: scale(0.8);
}

.client-logo:nth-child(1) { animation-delay: 0.1s; }
.client-logo:nth-child(2) { animation-delay: 0.15s; }
.client-logo:nth-child(3) { animation-delay: 0.2s; }
.client-logo:nth-child(4) { animation-delay: 0.25s; }
.client-logo:nth-child(5) { animation-delay: 0.3s; }
.client-logo:nth-child(6) { animation-delay: 0.35s; }
.client-logo:nth-child(7) { animation-delay: 0.4s; }
.client-logo:nth-child(8) { animation-delay: 0.45s; }
.client-logo:nth-child(9) { animation-delay: 0.5s; }
.client-logo:nth-child(10) { animation-delay: 0.55s; }
.client-logo:nth-child(11) { animation-delay: 0.6s; }
.client-logo:nth-child(12) { animation-delay: 0.65s; }
.client-logo:nth-child(13) { animation-delay: 0.7s; }
.client-logo:nth-child(14) { animation-delay: 0.75s; }
.client-logo:nth-child(15) { animation-delay: 0.8s; }
.client-logo:nth-child(16) { animation-delay: 0.85s; }
.client-logo:nth-child(17) { animation-delay: 0.9s; }
.client-logo:nth-child(18) { animation-delay: 0.95s; }
.client-logo:nth-child(19) { animation-delay: 1s; }

@keyframes logoFadeIn {
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* ===== SERVICE ANIMATIONS ===== */
.service-item {
    animation: serviceSlideUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(40px);
}

.service-item:nth-child(1) { animation-delay: 0.2s; }
.service-item:nth-child(2) { animation-delay: 0.4s; }
.service-item:nth-child(3) { animation-delay: 0.6s; }
.service-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes serviceSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SECTION HEADER ANIMATIONS ===== */
.section-header {
    animation: headerFadeIn 1s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes headerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BUTTON ANIMATIONS ===== */
.btn {
    position: relative;
    overflow: hidden;
}

.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 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* ===== HERO TEXT ANIMATION ===== */
.hero-title {
    opacity: 0;
    animation: heroTextReveal 2s ease forwards;
}

@keyframes heroTextReveal {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    50% {
        opacity: 0.5;
        transform: translateY(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-logo {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== PARALLAX EFFECT ===== */
.parallax-element {
    transform: translateY(var(--parallax-offset, 0));
    transition: transform 0.1s ease-out;
}

/* ===== GLITCH EFFECT (Para elementos especiais) ===== */
.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(1px, -1px); }
    40% { transform: translate(1px, 1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(-1px, 1px); }
}

/* ===== TYPEWRITER EFFECT ===== */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #ffffff;
    white-space: nowrap;
    animation: typing 4s 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: #ffffff; }
}

/* ===== MORPHING BACKGROUND ===== */
.morphing-bg {
    background: linear-gradient(-45deg, #070707, #0a0a0a, #0d0d0d, #111111);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* ===== FLOATING ANIMATION ===== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* ===== REVEAL ANIMATION ON SCROLL ===== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(100px);
    transition: all 1s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ROTATE ANIMATION ===== */
.rotate-on-hover {
    transition: transform 0.3s ease;
}

.rotate-on-hover:hover {
    transform: rotate(360deg);
}

/* ===== SLIDE ANIMATIONS ===== */
.slide-in-bottom {
    transform: translateY(100px);
    opacity: 0;
    animation: slideInBottom 0.8s ease forwards;
}

@keyframes slideInBottom {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-top {
    transform: translateY(-100px);
    opacity: 0;
    animation: slideInTop 0.8s ease forwards;
}

@keyframes slideInTop {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Reduzir animações em dispositivos móveis para melhor performance */
    .portfolio-item,
    .client-logo,
    .service-item {
        animation-duration: 0.4s;
    }

    /* Simplificar efeitos hover em mobile */
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
}

/* ===== REDUCE MOTION FOR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
