/* ===================================
   ANIMAÇÕES CSS - ROCKETZONE
   =================================== */

/* ===================================
   ANIMAÇÕES DE ENTRADA
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

/* ===================================
   ANIMAÇÕES DO HERO
   =================================== */
@keyframes heroTextSlide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    75% {
        transform: translateY(10px) rotate(-2deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes rocketFly {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    25% {
        transform: translate(-45%, -55%) rotate(40deg);
    }
    50% {
        transform: translate(-50%, -60%) rotate(45deg);
    }
    75% {
        transform: translate(-55%, -55%) rotate(50deg);
    }
}

/* ===================================
   BACKGROUND ANIMADO
   =================================== */
@keyframes moveGrid {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

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

/* Formas flutuantes do background */
.floating-shapes .shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 15%;
    animation-delay: 4s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 25%;
    animation-delay: 6s;
}

/* Grid pattern animado */
.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveGrid 20s linear infinite;
}

/* ===================================
   ANIMAÇÕES DE HOVER
   =================================== */
/* Botões */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Cards */
.service-card,
.mvv-card,
.differential-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.service-card:hover::before {
    opacity: 1;
}

/* ===================================
   LOADING SPINNER
   =================================== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* ===================================
   ANIMAÇÕES DE TEXTO
   =================================== */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: 
        typewriter 3s steps(40) 1s 1 normal both,
        blink 1s step-end infinite;
}

/* ===================================
   SCROLL REVEAL ANIMATIONS
   =================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Variações de direção */
.scroll-reveal.from-left {
    transform: translateX(-30px);
}

.scroll-reveal.from-right {
    transform: translateX(30px);
}

.scroll-reveal.from-bottom {
    transform: translateY(50px);
}

/* Delays para criar efeito cascata */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

/* ===================================
   ANIMAÇÕES DE ÍCONES
   =================================== */
.service-icon i,
.differential-icon i,
.mvv-icon i {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon i {
    transform: scale(1.2) rotate(5deg);
}

.differential-item:hover .differential-icon i {
    animation: pulse 1s ease infinite;
}

.mvv-card:hover .mvv-icon {
    animation: pulse 1.5s ease infinite;
}

/* ===================================
   TECH STACK ANIMATIONS
   =================================== */
.tech-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tech-item:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
}

.tech-item::after {
    content: attr(data-tech);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.tech-item:hover::after {
    opacity: 1;
}

/* ===================================
   FORM ANIMATIONS
   =================================== */
.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.2);
}

.form-group label {
    transition: all 0.3s ease;
}

.form-control:focus + label {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===================================
   ALERT ANIMATIONS
   =================================== */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    animation: slideInUp 0.5s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===================================
   SOCIAL ICONS ANIMATIONS
   =================================== */
.social-links a {
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.social-links a:hover::before {
    width: 100%;
    height: 100%;
}

/* ===================================
   COUNTER ANIMATIONS
   =================================== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.5s ease;
}

/* ===================================
   PARALLAX EFFECTS
   =================================== */
.parallax {
    transform: translateY(0);
    transition: transform 0.5s ease-out;
}

/* ===================================
   MOBILE MENU ANIMATIONS
   =================================== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.navbar-nav.active {
    animation: slideInLeft 0.3s ease;
}

/* ===================================
   PERFORMANCE OTIMIZADA
   =================================== */
/* Desabilitar animações complexas em dispositivos móveis */
@media (max-width: 768px) {
    .floating-shapes,
    .grid-pattern {
        animation: none;
    }
    
    .tech-item {
        animation-duration: 5s;
    }
}

/* Respeitar preferências do usuário */
@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;
    }
}