/* Advanced Animations for RifasPlus */

/* Floating particles */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #3aa6fb, transparent);
    border-radius: 50%;
    animation: float 15s infinite linear;
    opacity: 0.6;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Shine effect for titles */
.shine-text {
    background: linear-gradient(90deg, #333 25%, #3aa6fb 50%, #333 75%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Shine effect for main title - keeping original color */
.main-title-shine {
    background: linear-gradient(90deg, #0f48a2 25%, #ffffff 50%, #0f48a2 75%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: mainTitleShine 3s infinite;
}

@keyframes mainTitleShine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #3aa6fb;
    white-space: nowrap;
    animation: typing 3s steps(40) 1s forwards, blink 1s infinite;
    width: 0;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Animated gradient background - simplified */
.animated-gradient {
    color: #0f48a2;
    text-shadow: 0 2px 4px rgba(15, 72, 162, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
}



/* Image zoom effect */
.image-zoom {
    overflow: hidden;
    border-radius: 10px;
}

.image-zoom img {
    transition: transform 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Staggered entrance animation */
.staggered-entrance {
    opacity: 0;
    transform: translateY(30px);
    animation: staggeredFadeIn 0.6s ease forwards;
}

.staggered-entrance:nth-child(1) { animation-delay: 0.1s; }
.staggered-entrance:nth-child(2) { animation-delay: 0.2s; }
.staggered-entrance:nth-child(3) { animation-delay: 0.3s; }
.staggered-entrance:nth-child(4) { animation-delay: 0.4s; }
.staggered-entrance:nth-child(5) { animation-delay: 0.5s; }
.staggered-entrance:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggeredFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3D rotate effect for packages */
.rotate-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.rotate-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) scale(1.05);
}

/* Ripple effect for buttons */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::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;
    z-index: 0;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
}

.ripple-effect * {
    position: relative;
    z-index: 1;
}

/* Lightbox animations */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    color: #3aa6fb;
}

#lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(58, 166, 251, 0.8);
    border: none;
    color: white;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
    pointer-events: auto;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(58, 166, 251, 1);
}

.lightbox-prev {
    margin-left: -80px;
}

.lightbox-next {
    margin-right: -80px;
}

/* Package hover effects */
.package {
    transition: all 0.3s ease;
    position: relative;
}

.package::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(58, 166, 251, 0.1), transparent);
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.package:hover::before {
    opacity: 1;
}

.package:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Prize number animations */
.prize-number {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.prize-number::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(58, 166, 251, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.prize-number:hover::before {
    opacity: 1;
    animation: shimmer 1s ease;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Button loading states */
.btn-buy {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-buy:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-buy.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar pulse animation */
.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
}

/* Modal entrance animation */
.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal[style*="block"] .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Form input focus effects */
.form-group input:focus,
.form-group select:focus,
.email-input:focus,
.custom-input input:focus {
    box-shadow: 0 0 0 3px rgba(58, 166, 251, 0.2);
    border-color: #3aa6fb;
}

/* Success animation for form submission */
@keyframes successBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    80% {
        transform: translateY(-10px);
    }
}

.success-bounce {
    animation: successBounce 1s ease;
}

/* Efecto de carga para transiciones del carrusel */
.carousel-container.transitioning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(58, 166, 251, 0.2) 25%,
        rgba(58, 166, 251, 0.4) 50%,
        rgba(58, 166, 251, 0.2) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s ease-in-out;
    z-index: 4;
    pointer-events: none;
}

@keyframes loadingShimmer {
    0% {
        background-position: -200% 0%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 200% 0%;
        opacity: 0;
    }
}

/* Efectos de entrada mejorados para cada slide */
.carousel-slide.entering {
    animation: slideEnter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.carousel-slide.exiting {
    animation: slideExit 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideEnter {
    0% {
        opacity: 0.3;
        transform: scale(0.8) translateZ(0) rotateY(15deg);
        filter: blur(3px) brightness(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0) rotateY(0deg);
        filter: blur(0px) brightness(1);
    }
}

@keyframes slideExit {
    0% {
        opacity: 1;
        transform: scale(1) translateZ(0) rotateY(0deg);
        filter: blur(0px) brightness(1);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8) translateZ(0) rotateY(-15deg);
        filter: blur(3px) brightness(0.5);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .typewriter {
        font-size: 24px;
    }
    
    .animated-gradient {
        font-size: 20px;
        padding: 8px 15px;
        color: #0f48a2;
        text-shadow: 0 2px 4px rgba(15, 72, 162, 0.3);
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
        padding: 10px 15px;
        margin-left: -60px;
        margin-right: -60px;
    }
    
    .lightbox-prev {
        margin-left: -60px;
    }
    
    .lightbox-next {
        margin-right: -60px;
    }
    
    .particle {
        width: 2px;
        height: 2px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .shine-text,
    .animated-gradient {
        color: #0f48a2;
        text-shadow: 0 2px 4px rgba(15, 72, 162, 0.3);
    }
    
    .package::before,
    .prize-number::before {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-particles {
        display: none;
    }
}

/* Print styles */
@media print {
    .floating-particles,
    .lightbox,
    .modal {
        display: none !important;
    }
    
    .package,
    .prize-number {
        break-inside: avoid;
    }
}


