/* ===================================
   ANIMACIONES
   =================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    }
}

/* ===================================
   CLASES DE ANIMACIÓN
   =================================== */

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease;
}

.animate-slideInRight {
    animation: slideInRight 0.3s ease;
}

.animate-slideInLeft {
    animation: slideInLeft 0.3s ease;
}

.animate-bounce {
    animation: bounce 0.5s ease;
}

.animate-pulse {
    animation: pulse 0.5s ease infinite;
}

.animate-shake {
    animation: shake 0.3s ease;
}

.animate-glow {
    animation: glow 1.5s ease infinite;
}

/* ===================================
   EFECTOS DE HOVER ANIMADOS
   =================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

/* ===================================
   LOADING SPINNER
   =================================== */

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
    margin: 20px auto;
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    animation: pulse 1s ease infinite;
}

/* ===================================
   RIPPLE EFFECT (Touch Feedback)
   =================================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    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::after {
    width: 300px;
    height: 300px;
}

/* ===================================
   TOAST NOTIFICATION
   =================================== */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: white;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* ===================================
   SKELETON LOADING
   =================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   CARD FLIP
   =================================== */

.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ===================================
   SMOOTH SCROLL
   =================================== */

html {
    scroll-behavior: smooth;
}

/* ===================================
   TRANSITIONS SUAVES
   =================================== */

* {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                opacity 0.3s ease;
}

/* Excluir animaciones de transformación de transición global */
*:not(.no-transition) {
    transition-property: background-color, color, border-color, opacity;
}
