/* ===============================================
   ANIMACIONES PARA INICIO.PHP
   Agregar al final de style.css
   =============================================== */

/* Animaciones del Carrusel */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpDelay {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    50% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.carousel-item {
    transition: opacity 0.6s ease-in-out;
}

.carousel-item.active .animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.carousel-item.active .animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

.carousel-item.active .animate-slide-up-delay {
    animation: slideUp 1s ease-out 0.2s backwards;
}

.carousel-item.active .animate-fade-in-delay {
    animation: fadeIn 1s ease-out 0.4s backwards;
}

.carousel-item.active .animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Mejoras al Carrusel */
.carousel {
    height: calc(100vh - 64px);
    min-height: 500px;
    max-height: 800px;
}

@media (max-width: 768px) {
    .carousel {
        height: calc(100vh - 64px);
        min-height: 450px;
        max-height: 600px;
    }
}

.carousel-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
}

.carousel-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.carousel-arrow {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
    .carousel-arrow {
        width: 40px;
        height: 40px;
    }
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    width: 32px;
    background: white;
}

/* Animación de Hover para Cards */
@keyframes cardHover {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        transform: translateY(-8px) scale(1.02);
    }
}

.group:hover {
    animation: cardHover 0.3s ease forwards;
}

/* Gradientes Animados */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.bg-gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

/* Transiciones Suaves */
* {
    scroll-behavior: smooth;
}

.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse Animation para Badges */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* Efectos de Blur y Glassmorphism */
.backdrop-blur-custom {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Shadow Animations */
@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.2);
    }
}

.shadow-pulse {
    animation: shadowPulse 3s ease-in-out infinite;
}

/* Loading States */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1, .text-5xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2, .text-4xl {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
}

/* Optimización para Móviles */
@media (max-width: 768px) {
    .mobile-optimized * {
        animation-duration: 0.5s !important;
        transition-duration: 0.3s !important;
    }
    
    .mobile-optimized .animate-float {
        animation: none !important;
    }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible para Accesibilidad */
*:focus-visible {
    outline: 2px solid var(--rsg-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mejoras de Performance */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Smooth Scrolling con Snap */
.scroll-snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

.scroll-snap-item {
    scroll-snap-align: start;
}

/* Print Styles */
@media print {
    .carousel-controls,
    .carousel-indicators,
    .no-print {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support (opcional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        color-scheme: dark;
    }
}