/**
 * Tecnorep - Animations CSS
 * Keyframes y animaciones
 *
 * @package Tecnorep
 * @since 1.0.0
 */

/* ================================================================
   KEYFRAMES
   ================================================================ */

@keyframes trp-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes trp-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trp-fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trp-fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes trp-fade-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes trp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes trp-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes trp-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes trp-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes trp-slide-down {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes trp-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes trp-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes trp-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
   ANIMATION CLASSES
   ================================================================ */

.trp-animate-fade-in {
    animation: trp-fade-in 0.6s ease forwards;
}

.trp-animate-fade-in-up {
    animation: trp-fade-in-up 0.6s ease forwards;
}

.trp-animate-fade-in-down {
    animation: trp-fade-in-down 0.6s ease forwards;
}

.trp-animate-fade-in-left {
    animation: trp-fade-in-left 0.6s ease forwards;
}

.trp-animate-fade-in-right {
    animation: trp-fade-in-right 0.6s ease forwards;
}

.trp-animate-scale-in {
    animation: trp-scale-in 0.6s ease forwards;
}

.trp-animate-bounce {
    animation: trp-bounce 1s ease;
}

.trp-animate-pulse {
    animation: trp-pulse 1s ease infinite;
}

.trp-animate-shake {
    animation: trp-shake 0.5s ease;
}

.trp-animate-rotate {
    animation: trp-rotate 0.6s ease;
}

.trp-animate-float {
    animation: trp-float 3s ease-in-out infinite;
}

/* ================================================================
   DELAY CLASSES
   ================================================================ */

.trp-delay-100 {
    animation-delay: 0.1s;
}

.trp-delay-200 {
    animation-delay: 0.2s;
}

.trp-delay-300 {
    animation-delay: 0.3s;
}

.trp-delay-400 {
    animation-delay: 0.4s;
}

.trp-delay-500 {
    animation-delay: 0.5s;
}

.trp-delay-600 {
    animation-delay: 0.6s;
}

.trp-delay-700 {
    animation-delay: 0.7s;
}

.trp-delay-800 {
    animation-delay: 0.8s;
}

.trp-delay-900 {
    animation-delay: 0.9s;
}

.trp-delay-1000 {
    animation-delay: 1s;
}

/* ================================================================
   LOADING SPINNER
   ================================================================ */

.trp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--trp-border);
    border-radius: 50%;
    border-top-color: var(--trp-primary);
    animation: trp-spin 0.8s linear infinite;
}

.trp-spinner--sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.trp-spinner--lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* ================================================================
   SKELETON LOADING
   ================================================================ */

.trp-skeleton {
    background: linear-gradient(
        90deg,
        var(--trp-bg-surface) 25%,
        var(--trp-border-light) 50%,
        var(--trp-bg-surface) 75%
    );
    background-size: 200% 100%;
    animation: trp-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--trp-border-radius);
}

.trp-skeleton--text {
    height: 16px;
    margin-bottom: 8px;
}

.trp-skeleton--title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.trp-skeleton--image {
    height: 200px;
    width: 100%;
}

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

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

.trp-hover-lift {
    transition: transform var(--trp-transition), box-shadow var(--trp-transition);
}

.trp-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--trp-shadow-md);
}

.trp-hover-scale {
    transition: transform var(--trp-transition);
}

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

.trp-hover-glow {
    transition: box-shadow var(--trp-transition);
}

.trp-hover-glow:hover {
    box-shadow: 0 0 20px var(--trp-primary);
}

.trp-hover-rotate {
    transition: transform var(--trp-transition);
}

.trp-hover-rotate:hover {
    transform: rotate(5deg);
}

/* ================================================================
   TRANSITION UTILITIES
   ================================================================ */

.trp-transition-all {
    transition: all var(--trp-transition);
}

.trp-transition-fast {
    transition: all var(--trp-transition-fast);
}

.trp-transition-slow {
    transition: all var(--trp-transition-slow);
}

/* ================================================================
   SCROLL TO TOP
   ================================================================ */

.trp-scroll-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--trp-primary);
    color: var(--trp-blanco);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--trp-transition);
    z-index: 998;
    box-shadow: 0 4px 12px var(--trp-shadow-md);
}

.trp-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.trp-scroll-top:hover {
    background-color: var(--trp-primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--trp-shadow-md);
}

.trp-scroll-top .trp-icon {
    width: 24px;
    height: 24px;
}

/* ================================================================
   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) {
    .trp-scroll-top {
        bottom: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }
}
