/* Animaciones básicas para todas las páginas */

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide in from top */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Stripe animation for themed boxes */
@keyframes stripeAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Classes to apply animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-top {
    animation: slideInFromTop 0.5s ease-out;
}

.bounce {
    animation: bounce 1s;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Button animations */
.btn-animated {
    transition: all 0.3s ease;
}

.btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Alert animations */
.alert-animated {
    animation: slideInFromTop 0.5s ease-out;
}

/* Smooth transitions for all interactive elements */
.smooth-transition {
    transition: all 0.3s ease;
}

/* Stripe animation for themed boxes */
.stripe-animated {
    background: linear-gradient(
        45deg,
        var(--primary-color) 25%,
        transparent 25%,
        transparent 50%,
        var(--primary-color) 50%,
        var(--primary-color) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: stripeAnimation 3s linear infinite;
    position: relative;
}

.stripe-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    pointer-events: none;
}

/* Apply stripe animation only to colored themed boxes */
.card-animated.colored {
    position: relative;
    overflow: hidden;
}

.card-animated.colored::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 6s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Header animated class */
.header-animated {
    position: relative;
    overflow: hidden;
}

.header-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: headerShimmer 5s infinite;
    pointer-events: none;
}

@keyframes headerShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Button primary animated only for colored buttons */
.btn-primary-animated.colored {
    position: relative;
    overflow: hidden;
}

.btn-primary-animated.colored::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: buttonShimmer 6s infinite;
    pointer-events: none;
}

@keyframes buttonShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Form control animated */
.form-control-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-control-animated:focus {
    animation: inputGlow 0.5s ease-out;
}

@keyframes inputGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(1, 51, 105, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(1, 51, 105, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(1, 51, 105, 0.7);
    }
}

/* Stats card animated */
.stats-card-animated {
    position: relative;
    overflow: hidden;
}

.stats-card-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: statsShimmer 2.5s infinite;
    pointer-events: none;
}

@keyframes statsShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Banner animated */
.banner-animated {
    position: relative;
    overflow: hidden;
}

.banner-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: bannerShimmer 6s infinite;
    pointer-events: none;
}

@keyframes bannerShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Animated box class for general use */
.animated-box {
    position: relative;
    overflow: hidden;
}

.animated-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: boxShimmer 6s infinite;
    pointer-events: none;
}

@keyframes boxShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Winner button animation when selected */
.winner-btn.active {
    position: relative;
    overflow: hidden;
}

.winner-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: winnerShimmer 6s infinite;
    pointer-events: none;
}

@keyframes winnerShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Stagger animation for multiple elements */
.stagger-animation {
    animation: fadeInUp 0.6s ease-out both;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
