/* ============================================
   SHOP AI - ANIMATIONS
   Advanced animations and effects
   ============================================ */

/* ===== ENTRANCE ANIMATIONS ===== */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fadeInLeft"] {
    transform: translateX(-30px);
}

[data-animate="fadeInLeft"].animated {
    transform: translateX(0);
}

[data-animate="fadeInRight"] {
    transform: translateX(30px);
}

[data-animate="fadeInRight"].animated {
    transform: translateX(0);
}

[data-animate="scaleIn"] {
    transform: scale(0.9);
}

[data-animate="scaleIn"].animated {
    transform: scale(1);
}

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 191, 255, 0.2);
}

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.4);
}

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

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

/* ===== TEXT EFFECTS ===== */
.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--text) 0%,
        var(--primary) 50%,
        var(--text) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.text-typing {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 3.5s 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: var(--primary); }
}

/* ===== BACKGROUND EFFECTS ===== */
.bg-particles {
    position: relative;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 191, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(155, 89, 182, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    animation: bg-float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bg-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

.bg-grid {
    background-image: 
        linear-gradient(rgba(0, 191, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 191, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ===== BUTTON ANIMATIONS ===== */
.button-ripple {
    position: relative;
    overflow: hidden;
}

.button-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.button-ripple:hover::after {
    width: 300px;
    height: 300px;
}

.button-magnetic {
    transition: transform 0.2s ease;
}

/* ===== CARD EFFECTS ===== */
.card-tilt {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-tilt:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

.card-flip {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

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

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

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

/* ===== LOADING ANIMATIONS ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== SCROLL EFFECTS ===== */
.sticky-header {
    animation: slideDown 0.3s ease;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ===== NOTIFICATION ANIMATIONS ===== */
.notification-enter {
    animation: slideInRight 0.4s ease;
}

.notification-exit {
    animation: slideOutRight 0.4s ease;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== MODAL ANIMATIONS ===== */
.modal-enter {
    animation: modalFadeIn 0.3s ease;
}

.modal-exit {
    animation: modalFadeOut 0.3s ease;
}

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

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

/* ===== CONFETTI EFFECT ===== */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 3s ease-in-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 4px;
    background: var(--border-dark);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0;
    transition: width 0.5s ease;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border-dark);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

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

.floating-slow {
    animation: floating 5s ease-in-out infinite;
}

.floating-fast {
    animation: floating 2s ease-in-out infinite;
}

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

/* ===== GLOW EFFECTS ===== */
.glow-blue {
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
}

.glow-green {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

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

/* ===== NEON EFFECTS ===== */
.neon-text {
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
}

.neon-border {
    border: 2px solid var(--primary);
    box-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        inset 0 0 5px rgba(0, 191, 255, 0.1);
}

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

@media (max-width: 768px) {
    [data-animate] {
        transform: translateY(20px);
    }
    
    .floating,
    .floating-slow,
    .floating-fast {
        animation: none;
    }
}
