/* 
 * Animations CSS
 * City Discovery - Animation utilities and effects
 */

/* ==========================================
 * LOADING ANIMATIONS
 * ========================================== */
.spin-animation {
    animation: spin 1s linear infinite;
}

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

/* ==========================================
 * FADE ANIMATIONS
 * ========================================== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================
 * SLIDE ANIMATIONS
 * ========================================== */
.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================
 * SCALE ANIMATIONS
 * ========================================== */
.scale-in {
    animation: scaleIn 0.2s ease-out;
}

.scale-out {
    animation: scaleOut 0.2s ease-in;
}

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

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* ==========================================
 * PULSE ANIMATIONS
 * ========================================== */
.pulse {
    animation: pulse 2s infinite;
}

.pulse-once {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================
 * BOUNCE ANIMATIONS
 * ========================================== */
.bounce-in {
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
 * SHAKE ANIMATIONS
 * ========================================== */
.shake {
    animation: shake 0.5s ease-in-out;
}

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

/* ==========================================
 * HOVER ANIMATIONS
 * ========================================== */
.hover-lift {
    transition: transform 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-scale {
    transition: transform 0.2s ease-in-out;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ==========================================
 * LOADING SPINNER VARIATIONS
 * ========================================== */
.spinner-dots {
    display: inline-flex;
    gap: 2px;
}

.spinner-dots::before,
.spinner-dots::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: spinnerDots 1.4s infinite ease-in-out both;
}

.spinner-dots::before {
    animation-delay: -0.32s;
}

@keyframes spinnerDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
 * GAME-SPECIFIC ANIMATIONS
 * ========================================== */
.tower-capture-success {
    animation: towerCaptureSuccess 0.6s ease-out;
}

@keyframes towerCaptureSuccess {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.tower-discovery-animation {
    animation: towerDiscovery 1s ease-out;
}

@keyframes towerDiscovery {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* ==========================================
 * TRANSITION UTILITIES
 * ========================================== */
.transition-fast {
    transition: all 0.1s ease-in-out;
}

.transition-normal {
    transition: all 0.2s ease-in-out;
}

.transition-slow {
    transition: all 0.3s ease-in-out;
}

.transition-transform {
    transition: transform 0.2s ease-in-out;
}

.transition-opacity {
    transition: opacity 0.2s ease-in-out;
}

.transition-colors {
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}