/* ========================================
   WEBIMPULSER ADVANCED ANIMATIONS & INTERACTIONS v7.0
   Micro-interactions and smooth transitions
   ======================================== */

/* ==== SMOOTH SCROLL ==== */
/* Disabled for performance */
html {
    scroll-behavior: auto;
}

/* ==== PAGE LOAD ANIMATION ==== */
/* Removed due to layout jumps */
.elite-text-content,
.elite-visual {
    opacity: 1;
}

/* ==== PHONE SCREEN GLOW EFFECT ==== */
.monolith-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.3), transparent 70%);
    pointer-events: none;
    animation: screenGlow 4s ease-in-out infinite;
}

@keyframes screenGlow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* ==== BUTTON RIPPLE EFFECT ==== */
.btn-elite {
    position: relative;
    overflow: hidden;
}

.btn-elite::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-elite:active::before {
    width: 300px;
    height: 300px;
}

/* ==== CARD HOVER EFFECTS ==== */
.store-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.store-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ==== GLOWING BORDERS ==== */
.new-tag {
    position: relative;
}

.new-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ==== FLOATING ANIMATION FOR PHONE ==== */
@keyframes phoneFloat {

    0%,
    100% {
        transform: perspective(1000px) rotateY(-12deg) rotateX(5deg) translateY(0);
    }

    50% {
        transform: perspective(1000px) rotateY(-12deg) rotateX(5deg) translateY(-15px);
    }
}

.monolith-phone {
    animation: phoneFloat 6s ease-in-out infinite;
}

/* ==== MAGNETIC HOVER FOR NAVIGATION ==== */
.nav-links a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    transform: translateY(-2px);
}

/* ==== SHIMMER EFFECT FOR HEADLINES ==== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.elite-headline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.elite-headline {
    position: relative;
    display: inline-block;
}

/* ==== PARALLAX SCROLL EFFECT ==== */
@media (prefers-reduced-motion: no-preference) {
    .elite-visual {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Removed global transition as it causes performance issues and layout shifts */

/* Override for specific animated elements */
.text-gradient-anim,
.monolith-phone,
.elite-visual,
.btn-elite {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ==== FOCUS STATES FOR ACCESSIBILITY ==== */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 4px;
}

/* ==== STATS CARD ENTRANCE ==== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stats-card-float {
    opacity: 1;
}

/* ==== PRODUCT CARDS STAGGER ANIMATION ==== */
.store-item {
    opacity: 1;
}

/* ==== LOADING SKELETON SHIMMER ==== */
.item-title,
.item-price {
    position: relative;
    overflow: hidden;
}

.item-title::after,
.item-price::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ==== CURSOR EFFECTS ==== */
@media (pointer: fine) {

    .btn-elite,
    .store-item,
    .nav-links a {
        cursor: pointer;
    }

    .btn-elite:hover,
    .store-item:hover {
        will-change: transform;
    }
}

/* ==== SECTION REVEAL ON SCROLL ==== */
.templates-section {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==== MOBILE OPTIMIZATIONS ==== */
@media (max-width: 768px) {

    /* Reduce motion on mobile for performance */
    .monolith-phone {
        animation: none;
    }

    .stats-card-float {
        animation: none;
        opacity: 1;
    }

    /* Simplify hover effects on touch devices */
    .store-item:hover {
        transform: none;
    }
}

/* ==== PREMIUM SYNC PROGRESS BAR (Liquid Style) ==== */
.header-sync-indicator.premium {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1000;
}

.sync-progress-bar-flow {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 100%;
    animation: liquid-flow 2s infinite linear, progress-fake 3s forwards cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

@keyframes progress-fake {
    0% {
        width: 0%;
    }

    20% {
        width: 30%;
    }

    50% {
        width: 60%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 99%;
    }
}

@keyframes liquid-flow {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 0%;
    }
}

/* Global Syncing Overlay for Editor */
body.is-syncing-store .sync-step-box:has(.btn-sync) {
    position: relative;
    overflow: hidden;
}

body.is-syncing-store .sync-step-box:has(.btn-sync)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    z-index: 10;
    border-radius: inherit;
    /* animation: fadeIn 0.3s ease-out; -- Removed */
}

body.is-syncing-store .sync-step-box:has(.btn-sync)::after {
    content: 'SINCRO-MÁGICA EN CURSO...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    color: #6366f1;
    font-size: 0.75rem;
    letter-spacing: 2px;
    z-index: 11;
    animation: pulseSync 1.5s infinite;
}

@keyframes pulseSync {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* Top Global Bar for the Dashboard */
.global-sync-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9999;
    display: none;
    background: linear-gradient(90deg, #6366f1, #a855f7, #6366f1);
    background-size: 200% 100%;
    animation: liquid-flow 1s infinite linear;
}

body.is-syncing-store .global-sync-bar {
    display: block;
}