/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Top */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 20, 147, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 20, 147, 0.8);
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Flip */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }
    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Swing */
@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Wobble */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-5px) rotate(-5deg);
    }
    30% {
        transform: translateX(5px) rotate(3deg);
    }
    45% {
        transform: translateX(-5px) rotate(-3deg);
    }
    60% {
        transform: translateX(3px) rotate(2deg);
    }
    75% {
        transform: translateX(-2px) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Rainbow Text */
@keyframes rainbow {
    0% {
        color: #FF1493;
    }
    25% {
        color: #9B59B6;
    }
    50% {
        color: #4A90E2;
    }
    75% {
        color: #9B59B6;
    }
    100% {
        color: #FF1493;
    }
}

/* Gradient Background Animation */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Apply Animations to Elements */

/* Hero Section */
.hero-title {
    animation: slideInDown 0.8s ease-out;
}

.hero-subtitle {
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    animation: slideInUp 0.8s ease-out 0.4s both;
}

.hero .btn-large {
    animation: slideInUp 0.8s ease-out 0.6s both;
}

.hero-img {
    animation: slideInRight 0.8s ease-out 0.3s both;
}

/* Section Titles */
.section-title {
    animation: slideInDown 0.6s ease-out;
}

.section-subtitle {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

/* Cards */
.valor-card {
    animation: slideInUp 0.6s ease-out;
}

.valor-card:nth-child(2) {
    animation-delay: 0.2s;
}

.valor-card:nth-child(3) {
    animation-delay: 0.4s;
}

.feature-card {
    animation: slideInUp 0.6s ease-out;
}

.feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.3s;
}

.step-card {
    animation: slideInUp 0.6s ease-out;
}

.step-card:nth-child(2) {
    animation-delay: 0.1s;
}

.step-card:nth-child(3) {
    animation-delay: 0.2s;
}

.step-card:nth-child(4) {
    animation-delay: 0.3s;
}

.testimonio-card {
    animation: slideInUp 0.6s ease-out;
}

.testimonio-card:nth-child(2) {
    animation-delay: 0.1s;
}

.testimonio-card:nth-child(3) {
    animation-delay: 0.2s;
}

.precio-card {
    animation: slideInUp 0.6s ease-out;
}

.precio-card:nth-child(2) {
    animation-delay: 0.1s;
}

.precio-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Hover Effects */
.valor-card:hover,
.feature-card:hover,
.step-card:hover,
.testimonio-card:hover,
.precio-card:hover {
    animation: pulse 0.6s ease-in-out;
}

.logo:hover {
    animation: swing 0.6s ease-in-out;
}

.nav-link:hover {
    animation: pulse 0.4s ease-in-out;
}

/* Icon Animations */
.valor-icon svg,
.feature-icon svg {
    transition: all 0.3s ease;
}

.valor-card:hover .valor-icon svg,
.feature-card:hover .feature-icon svg {
    animation: rotate 0.6s ease-in-out;
}

/* Scroll Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* Loading Animation */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Spinner Animation */
.spinner {
    animation: rotate 1s linear infinite;
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Gradient Animation */
.gradient-animated {
    background-size: 200% 200%;
    animation: gradientAnimation 3s ease infinite;
}

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Float Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

/* Heartbeat Animation */
.heartbeat {
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* Rainbow Text */
.rainbow-text {
    animation: rainbow 3s ease-in-out infinite;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance Optimization */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .valor-card:nth-child(2),
    .valor-card:nth-child(3),
    .feature-card:nth-child(2),
    .feature-card:nth-child(3),
    .feature-card:nth-child(4),
    .step-card:nth-child(2),
    .step-card:nth-child(3),
    .step-card:nth-child(4),
    .testimonio-card:nth-child(2),
    .testimonio-card:nth-child(3),
    .precio-card:nth-child(2),
    .precio-card:nth-child(3) {
        animation-delay: 0s !important;
    }
}
