/**
 * HonlyCraft Network - Premium Effects
 * Mejoras visuales e interactivas
 */

/* ========== HOVER EFFECTS MEJORADOS ========== */

/* Efecto de brillo y elevación en productos */
.product-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(33, 150, 243, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(33, 150, 243, 0.4),
        0 0 60px rgba(33, 150, 243, 0.15),
        0 0 0 1px rgba(33, 150, 243, 0.3);
    border-color: rgba(33, 150, 243, 0.5);
}

/* Efecto de pulso en botones */
.btn-add-cart {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-cart::after {
    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-add-cart:hover::after {
    width: 300px;
    height: 300px;
}

.btn-add-cart:hover {
    transform: scale(1.05);
    box-shadow: 
        0 8px 25px rgba(33, 150, 243, 0.5),
        0 0 30px rgba(33, 150, 243, 0.3);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

/* Animación de pulso continuo en badges */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(33, 150, 243, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(33, 150, 243, 0.7);
        transform: scale(1.05);
    }
}

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

/* Hover en sidebar links */
.user-nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--p-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.user-nav-link:hover::before {
    width: 5px;
}

.user-nav-link:hover {
    padding-left: 2rem;
    background-color: rgba(33, 150, 243, 0.1);
}

.user-nav-link.active::before {
    width: 5px;
}

/* ========== MICRO-INTERACCIONES ========== */

/* Ripple effect en botones */
.ripple {
    position: relative;
    overflow: hidden;
}

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

.ripple:active::before {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

/* Bounce effect en contador del carrito */
@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.cart-badge.updated {
    animation: cart-bounce 0.5s ease;
}

/* Checkmark volador al agregar al carrito */
@keyframes fly-to-cart {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.cart-fly-icon {
    position: fixed;
    font-size: 2rem;
    color: var(--p-color);
    pointer-events: none;
    z-index: 10000;
    animation: fly-to-cart 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Shake effect para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s;
}

/* ========== LOADING STATES ========== */

/* Skeleton Screen */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 400px;
    margin-bottom: 1.5rem;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 30px;
    width: 70%;
    margin-bottom: 15px;
}

.skeleton-button {
    height: 45px;
    width: 120px;
}

/* Progress Bar */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10001;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--p-color),
        rgba(33, 150, 243, 0.5),
        var(--p-color)
    );
    background-size: 200% 100%;
    animation: progress-bar-animation 1.5s ease-in-out infinite;
    width: 0;
    transition: width 0.3s ease;
}

@keyframes progress-bar-animation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner mejorado */
.spinner-premium {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: var(--p-color);
    border-radius: 50%;
    animation: spin-premium 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    position: relative;
}

.spinner-premium::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 4px solid transparent;
    border-top-color: rgba(33, 150, 243, 0.5);
    border-radius: 50%;
    animation: spin-premium 2s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}

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

/* ========== TOAST NOTIFICATIONS ========== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border-left: 4px solid var(--p-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    pointer-events: all;
    animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--p-color);
    animation: toast-progress 3s linear;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast.removing {
    animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Toast types */
.toast.success {
    border-left-color: var(--success-color);
}

.toast.success::before {
    background: var(--success-color);
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error::before {
    background: var(--danger-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.warning::before {
    background: var(--warning-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast.info::before {
    background: var(--info-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

/* ========== CONFETTI EFFECT ========== */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--p-color);
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 3s linear forwards;
}

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

/* ========== SCROLL REVEAL ANIMATIONS ========== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .product-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
}
