/* Visual Effects and Animations */

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.02);
    }
}

/* Glow Effect */
.glow {
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(0, 172, 230, 0.5),
            0 0 10px rgba(0, 172, 230, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 172, 230, 0.8),
            0 0 30px rgba(0, 172, 230, 0.5);
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translate(-2px, 2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translate(2px, -2px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Flash Effect */
@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.flash {
    animation: flash 0.1s ease-in-out 3;
}

/* Slide In Animations */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-top {
    animation: slideInFromTop 0.5s ease-out;
}

.slide-in-bottom {
    animation: slideInFromBottom 0.5s ease-out;
}

.slide-in-left {
    animation: slideInFromLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInFromRight 0.5s ease-out;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 172, 230, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 18px;
    color: var(--primary-color);
    letter-spacing: 2px;
}

/* Hit Effect (Red Flash) */
@keyframes hitFlash {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(255, 0, 0, 0.3);
    }
}

.hit-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    animation: hitFlash 0.3s ease-out;
}

/* Speed Lines Effect (Future Enhancement) */
@keyframes speedLines {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.speed-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.5) 50%,
            transparent 100%);
    animation: speedLines 0.5s linear infinite;
}

/* Boost Effect */
@keyframes boost {
    0% {
        filter: brightness(1) saturate(1);
    }

    50% {
        filter: brightness(1.3) saturate(1.5);
    }

    100% {
        filter: brightness(1) saturate(1);
    }
}

.boosting {
    animation: boost 0.3s ease-in-out infinite;
}

/* Warning Blink */
@keyframes warningBlink {

    0%,
    100% {
        opacity: 1;
        color: var(--danger-color);
    }

    50% {
        opacity: 0.5;
        color: var(--warning-color);
    }
}

.warning {
    animation: warningBlink 0.5s ease-in-out infinite;
}

/* Float Up Animation for Score Notifications */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

.score-notification {
    animation: floatUp 1.5s ease-out forwards;
}
