/* ============================================
   DF DEV - Animations
   ============================================ */

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    animation: preloaderFade 2.8s ease-out forwards;
    pointer-events: none;
    overflow: hidden;
}

.preloader-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.preloader-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.4);
    animation: glitchShift 2s ease-in-out infinite;
    position: relative;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preloader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    animation: glitchText 2s ease-in-out infinite;
    position: relative;
    text-shadow: 2px 0 #e63946, -2px 0 #2563eb;
}

.preloader-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #e63946, #2563eb);
    border-radius: 2px;
    opacity: 0.8;
    animation: lineGlitch 2s ease-in-out infinite;
}

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes glitchShift {
    0%, 100% { 
        transform: translate(0, 0);
        box-shadow: 0 8px 32px rgba(230, 57, 70, 0.4);
    }
    25% { 
        transform: translate(2px, -2px);
        box-shadow: -2px 2px 16px rgba(230, 57, 70, 0.6), 2px -2px 16px rgba(37, 99, 235, 0.3);
    }
    50% { 
        transform: translate(-2px, 2px);
        box-shadow: 2px -2px 16px rgba(37, 99, 235, 0.6), -2px 2px 16px rgba(230, 57, 70, 0.3);
    }
    75% { 
        transform: translate(1px, -1px);
        box-shadow: -1px 1px 16px rgba(230, 57, 70, 0.5), 1px -1px 16px rgba(37, 99, 235, 0.4);
    }
}



@keyframes glitchText {
    0%, 100% { 
        transform: translate(0, 0);
        text-shadow: 2px 0 #e63946, -2px 0 #2563eb;
    }
    25% { 
        transform: translate(3px, -2px);
        text-shadow: -3px 2px #e63946, 3px -2px #2563eb;
    }
    50% { 
        transform: translate(-3px, 2px);
        text-shadow: 3px -2px #e63946, -3px 2px #2563eb;
    }
    75% { 
        transform: translate(2px, -1px);
        text-shadow: -2px 1px #e63946, 2px -1px #2563eb;
    }
}

@keyframes lineGlitch {
    0%, 100% { 
        transform: scaleX(1);
        opacity: 0.8;
        box-shadow: 0 0 10px rgba(230, 57, 70, 0.4);
    }
    25% { 
        transform: scaleX(0.9);
        opacity: 1;
        box-shadow: 2px 0 8px #e63946, -2px 0 8px #2563eb;
    }
    50% { 
        transform: scaleX(1.1);
        opacity: 0.7;
        box-shadow: -2px 0 8px #e63946, 2px 0 8px #2563eb;
    }
    75% { 
        transform: scaleX(0.95);
        opacity: 0.9;
        box-shadow: 1px 0 8px #e63946, -1px 0 8px #2563eb;
    }
}

@keyframes preloaderFade {
    0% { opacity: 1; }
    82% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes revealWord {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes blurIn {
    0% { backdrop-filter: blur(8px); }
    100% { backdrop-filter: blur(0px); }
}

@keyframes staggerFadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes drawStroke {
    0% { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
    100% { stroke-dasharray: 1000; stroke-dashoffset: 0; }
}

/* ===== GLOW ANIMATIONS ===== */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(230, 57, 70, 0.3), inset 0 0 10px rgba(230, 57, 70, 0.1); }
    50% { box-shadow: 0 0 30px rgba(230, 57, 70, 0.6), inset 0 0 20px rgba(230, 57, 70, 0.2); }
}

@keyframes glowBlue {
    0%, 100% { box-shadow: 0 0 10px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 30px rgba(37, 99, 235, 0.6); }
}

/* ===== SHIMMER ANIMATION ===== */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes shimmerBg {
    0% {
        background: linear-gradient(
            90deg,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.2) 50%,
            rgba(255,255,255,0) 100%
        );
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ===== BOUNCE ANIMATIONS ===== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { opacity: 1; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounceInUp {
    0% { opacity: 0; transform: translateY(50px); }
    60% { opacity: 1; transform: translateY(-10px); }
    80% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

/* ===== ROTATE ANIMATIONS ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotateY {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes rotateX {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(360deg); }
}

/* ===== FLIP ANIMATIONS ===== */
@keyframes flip {
    0% { transform: perspective(400px) rotateY(0deg); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

@keyframes flipX {
    0% { transform: perspective(400px) rotateX(0deg); }
    100% { transform: perspective(400px) rotateX(360deg); }
}

/* ===== SLIDE ANIMATIONS ===== */
@keyframes slideInLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideInDown {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ===== FADE ANIMATIONS ===== */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInBlur {
    0% { opacity: 0; filter: blur(10px); }
    100% { opacity: 1; filter: blur(0px); }
}

/* ===== WAVE ANIMATION ===== */
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(25deg); }
    75% { transform: rotate(-25deg); }
}

/* ===== SWING ANIMATION ===== */
@keyframes swing {
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* ===== PULSE ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulseBg {
    0%, 100% {
        background: rgba(230, 57, 70, 0.1);
        border-color: rgba(230, 57, 70, 0.2);
    }
    50% {
        background: rgba(230, 57, 70, 0.05);
        border-color: rgba(230, 57, 70, 0.1);
    }
}

/* ===== FLOAT ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

@keyframes floatFast {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ===== BLUR ENTER ===== */
body.blur-enter {
    animation: blurIn 1.2s ease-out forwards;
}

/* ===== TEXT REVEAL ===== */
.reveal-text {
    overflow: hidden;
}

.reveal-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em;
}

.reveal-word {
    display: inline-block;
    animation: revealWord 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.reveal-word:nth-child(1) { animation-delay: 0.1s; }
.reveal-word:nth-child(2) { animation-delay: 0.2s; }
.reveal-word:nth-child(3) { animation-delay: 0.3s; }
.reveal-word:nth-child(4) { animation-delay: 0.4s; }
.reveal-word:nth-child(5) { animation-delay: 0.5s; }
.reveal-word:nth-child(6) { animation-delay: 0.6s; }

/* ===== SVG STROKE ANIMATION ===== */
.svg-draw svg {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.svg-draw:hover svg {
    animation: drawStroke 1.5s ease-out forwards;
}

.servicio-card:hover .svg-draw svg {
    animation: drawStroke 1.5s ease-out forwards;
}

/* ===== STAGGER ANIMATIONS ===== */
.servicio-card {
    animation: staggerFadeUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.servicio-card:nth-child(1) { animation-delay: 0s; }
.servicio-card:nth-child(2) { animation-delay: 0.1s; }
.servicio-card:nth-child(3) { animation-delay: 0.2s; }
.servicio-card:nth-child(4) { animation-delay: 0.3s; }

/* ===== PORTFOLIO CARD ANIMATIONS ===== */
.portfolio-card {
    animation: slideInUp 0.6s ease-out;
}

.portfolio-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== BUTTON ANIMATIONS ===== */
.btn {
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover {
    animation: pulse 0.6s ease-in-out;
}

.btn-primary {
    animation: fadeInScale 0.8s ease-out;
}

.btn-primary:hover {
    animation: bounce 0.6s ease-in-out;
}

/* ===== NAVBAR ANIMATIONS ===== */
.navbar {
    animation: slideInDown 0.6s ease-out;
}

.nav-links a {
    animation: fadeIn 0.6s ease-out;
}

.nav-links a:nth-child(1) { animation-delay: 0.1s; }
.nav-links a:nth-child(2) { animation-delay: 0.2s; }
.nav-links a:nth-child(3) { animation-delay: 0.3s; }
.nav-links a:nth-child(4) { animation-delay: 0.4s; }

/* ===== HERO ANIMATIONS ===== */
.hero-badge {
    animation: fadeInScale 0.8s ease-out 0.1s both;
}

.hero-subtitle {
    animation: fadeInBlur 0.8s ease-out 0.3s both;
}

.hero-cta {
    animation: bounceInUp 0.8s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInScale 0.8s ease-out 0.5s both;
}

.stat {
    transition: transform 0.3s ease;
}

.stat:hover {
    animation: bounce 0.6s ease-in-out;
}

/* ===== FEATURE ANIMATIONS ===== */
.contacto-feature {
    animation: slideInLeft 0.6s ease-out backwards;
}

.contacto-feature:nth-child(1) { animation-delay: 0.1s; }
.contacto-feature:nth-child(2) { animation-delay: 0.2s; }
.contacto-feature:nth-child(3) { animation-delay: 0.3s; }

.feature-icon {
    animation: spin 20s linear infinite;
}

.feature-icon:hover {
    animation: glowBlue 0.6s ease-in-out;
}

/* ===== ICON ANIMATIONS ===== */
.wa-service-icon {
    animation: fadeInScale 0.6s ease-out;
}

.wa-service-btn:hover .wa-service-icon {
    animation: spin 1s ease-in-out forwards;
}

/* ===== SPECIAL ANIMATIONS ===== */
.section-tag {
    animation: fadeInScale 0.6s ease-out;
}

.section-header h2 {
    animation: slideInUp 0.8s ease-out;
}

.section-header p {
    animation: fadeInBlur 0.8s ease-out 0.1s both;
}

/* ===== PARALLAX ===== */
.shape {
    will-change: transform;
}

/* ===== 3D TILT ===== */
.portfolio-card-image {
    perspective: 1000px;
}

.portfolio-card-image img {
    will-change: transform;
    transition: transform 0.3s ease;
}

/* ===== SCROLL TRIGGERED ===== */
.servicios {
    --scroll-progress: 0;
}

/* ===== FILTER BUTTON ANIMATIONS ===== */
.filter-btn {
    animation: fadeIn 0.6s ease-out;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-btn:hover {
    animation: scale 0.3s ease-out forwards;
}

.filter-btn.active {
    animation: bounceIn 0.6s ease-out;
}

@keyframes scale {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* ===== ADMIN ANIMATIONS ===== */
.admin-panel {
    animation: slideInDown 0.4s ease-out;
}

.admin-form {
    animation: fadeInScale 0.6s ease-out;
}

.form-group {
    animation: slideInLeft 0.4s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

/* ===== LIGHTBOX ANIMATIONS ===== */
.lightbox {
    animation: fadeIn 0.3s ease-out;
}

.lightbox-img {
    animation: bounceIn 0.6s ease-out;
}

.lightbox-info {
    animation: slideInUp 0.5s ease-out 0.2s both;
}

/* ===== INFINITE ANIMATIONS ===== */
.shape-1 {
    animation: float 8s ease-in-out infinite;
}

.shape-2 {
    animation: floatSlow 10s ease-in-out infinite reverse;
}

.shape-3 {
    animation: floatFast 12s ease-in-out infinite;
}

/* ===== FOOTER ANIMATIONS ===== */
footer {
    animation: slideInUp 0.8s ease-out;
}

.footer-links a {
    animation: fadeIn 0.6s ease-out;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    animation: swing 0.6s ease-in-out;
}

.footer-links a:nth-child(1) { animation-delay: 0.1s; }
.footer-links a:nth-child(2) { animation-delay: 0.2s; }
.footer-links a:nth-child(3) { animation-delay: 0.3s; }
.footer-links a:nth-child(4) { animation-delay: 0.4s; }

