/* =============================================
   ANIMACIONES Y MASCOTA
   ============================================= */

/* Animaciones de entrada */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Delays para animaciones en cascada */
.delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.delay-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

.delay-5 {
    animation-delay: 0.5s;
    opacity: 0;
}

.delay-6 {
    animation-delay: 0.6s;
    opacity: 0;
}

.delay-7 {
    animation-delay: 0.7s;
    opacity: 0;
}

.delay-8 {
    animation-delay: 0.8s;
    opacity: 0;
}

.delay-9 {
    animation-delay: 0.9s;
    opacity: 0;
}

.delay-10 {
    animation-delay: 1s;
    opacity: 0;
}

.delay-11 {
    animation-delay: 1.1s;
    opacity: 0;
}

.delay-12 {
    animation-delay: 1.2s;
    opacity: 0;
}

/* Animaciones de hover */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Animaciones continuas */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* =============================================
   MASCOTA ROBOT
   ============================================= */

.mascot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    cursor: pointer;
}

.mascot {
    width: 100px;
    height: 100px;
    transition: transform 0.3s ease;
}

.mascot:hover {
    transform: scale(1.1);
}

/* Animaciones del robot */
.mascot-idle {
    animation: mascotIdle 3s ease-in-out infinite;
}

@keyframes mascotIdle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.mascot-wave {
    animation: mascotWave 0.5s ease-in-out 3;
}

@keyframes mascotWave {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.mascot-jump {
    animation: mascotJump 0.6s ease;
}

@keyframes mascotJump {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-30px) scale(1.1);
    }

    50% {
        transform: translateY(-25px) scale(1.05);
    }
}

.mascot-celebrate {
    animation: mascotCelebrate 1s ease-in-out;
}

@keyframes mascotCelebrate {
    0% {
        transform: scale(1) rotate(0);
    }

    25% {
        transform: scale(1.2) rotate(-15deg);
    }

    50% {
        transform: scale(1.2) rotate(15deg);
    }

    75% {
        transform: scale(1.1) rotate(-10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.mascot-sad {
    animation: mascotSad 0.5s ease;
}

@keyframes mascotSad {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

/* Partículas de celebración para mascota */
.mascot-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleFloat 1s ease forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Brillo alrededor de la mascota */
.mascot-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.3) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* =============================================
   ANIMACIONES DE QUIZ Y ACTIVIDADES
   ============================================= */

.correct-answer {
    animation: correctPulse 0.5s ease;
    background-color: rgba(46, 196, 182, 0.2) !important;
    border-color: var(--color-success) !important;
}

@keyframes correctPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.wrong-answer {
    animation: wrongShake 0.5s ease;
    background-color: rgba(230, 57, 70, 0.1) !important;
    border-color: var(--color-error) !important;
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

/* Transición de página */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Contador animado */
.counter {
    display: inline-block;
    transition: transform 0.3s ease;
}

.counter.updating {
    animation: counterBump 0.3s ease;
}

@keyframes counterBump {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Arrastre de elementos */
.dragging {
    opacity: 0.8;
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.drag-over {
    border-color: var(--color-primary) !important;
    background-color: rgba(255, 107, 53, 0.1) !important;
}

.drop-success {
    animation: dropSuccess 0.4s ease;
}

@keyframes dropSuccess {
    0% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mascot-container {
        bottom: 15px;
        right: 15px;
    }

    .mascot {
        width: 70px;
        height: 70px;
    }

    .mascot-glow {
        width: 90px;
        height: 90px;
    }
}