/* Guess animation styles */

/* Loading state for guess slot */
.guess-slot.submitting {
    background: #e9ecef;
    border: 2px solid #dee2e6;
    animation: pulse-submitting 1.5s ease-in-out infinite;
}

@keyframes pulse-submitting {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Slide in animation for new guess */
.guess-slot.entering {
    animation: slideInGuess 0.4s ease-out forwards;
    transform: translateX(-100%);
    opacity: 0;
}

@keyframes slideInGuess {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scale and reveal animation */
.guess-slot.revealing {
    animation: scaleReveal 0.5s ease-out forwards;
}

@keyframes scaleReveal {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Color reveal animation with smooth transition */
.guess-slot.revealing-color {
    transition: background-color 0.4s ease-out, border-color 0.4s ease-out, color 0.4s ease-out;
}

/* Bounce effect when guess is correct */
.guess-slot.correct.revealed {
    animation: bounceSuccess 0.6s ease-out;
}

@keyframes bounceSuccess {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(0.98);
    }
    75% {
        transform: scale(1.02);
    }
}

/* Shake effect for incorrect guesses */
.guess-slot.too-high.revealed,
.guess-slot.too-low.revealed {
    animation: shakeIncorrect 0.5s ease-out;
}

@keyframes shakeIncorrect {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Staggered reveal for guess value and feedback */
.guess-slot .guess-value,
.guess-slot .guess-feedback {
    opacity: 0;
    animation: fadeInContent 0.3s ease-out forwards;
}

.guess-slot .guess-value {
    animation-delay: 0.2s;
}

.guess-slot .guess-feedback {
    animation-delay: 0.4s;
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

/* Disable animations for empty slots */
.guess-slot.empty .guess-value,
.guess-slot.empty .guess-feedback {
    opacity: 1;
    animation: none;
}

/* Smooth transition for color changes */
.guess-slot {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Button loading state */
#submit-guess.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

#submit-guess.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
