/* ===================================
   GAMEVERSE - ANIMATIONS CSS
   Custom Animations & Effects
   ================================== */

/* AOS (Animate On Scroll) Custom Animations */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* Preloader Animations */
@keyframes loaderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050810;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid transparent;
    animation: loaderRotate 1.5s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top-color: #00f0ff;
    animation-duration: 2s;
}

.loader-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    border-right-color: #ff00ff;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    border-bottom-color: #ffff00;
    animation-duration: 1s;
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: #00f0ff;
    animation: pulse 2s infinite;
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #00f0ff;
    letter-spacing: 5px;
    margin-bottom: 1rem;
    animation: glitchText 3s infinite;
}

@keyframes glitchText {
    0%, 90%, 100% {
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    }
    91%, 93%, 95%, 97% {
        text-shadow: 
            2px 0 #ff00ff,
            -2px 0 #ffff00,
            0 0 20px rgba(0, 240, 255, 0.8);
    }
}

.loading-subtext {
    color: #b8c5d6;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading-bar {
    width: 300px;
    height: 4px;
    background-color: #1e2a3f;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background-color: #00f0ff;
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
    box-shadow: 0 0 10px #00f0ff;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitchBefore 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ff00;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitchAfter 2.5s infinite linear alternate-reverse;
}

@keyframes glitchBefore {
    0% {
        clip: rect(61px, 9999px, 52px, 0);
    }
    5% {
        clip: rect(33px, 9999px, 144px, 0);
    }
    10% {
        clip: rect(121px, 9999px, 115px, 0);
    }
    /* More keyframes... */
    100% {
        clip: rect(82px, 9999px, 61px, 0);
    }
}

@keyframes glitchAfter {
    0% {
        clip: rect(26px, 9999px, 39px, 0);
    }
    5% {
        clip: rect(140px, 9999px, 107px, 0);
    }
    10% {
        clip: rect(79px, 9999px, 136px, 0);
    }
    /* More keyframes... */
    100% {
        clip: rect(25px, 9999px, 129px, 0);
    }
}

/* Particle Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 1;
    }
    75% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.7;
    }
}

/* Neon Glow Animation */
@keyframes neonGlow {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(0, 240, 255, 0.5),
            0 0 10px rgba(0, 240, 255, 0.4),
            0 0 20px rgba(0, 240, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(0, 240, 255, 0.8),
            0 0 20px rgba(0, 240, 255, 0.6),
            0 0 30px rgba(0, 240, 255, 0.4),
            0 0 40px rgba(0, 240, 255, 0.2);
    }
}

.neon-glow {
    animation: neonGlow 2s ease-in-out infinite;
}

/* Scan Line Effect */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(transparent, #00f0ff, transparent);
    opacity: 0.1;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 9998;
}

/* Text Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00f0ff; }
}

.typing-text {
    overflow: hidden;
    border-right: 2px solid #00f0ff;
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Hover Lift Animation */
@keyframes hoverLift {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hover-lift:hover {
    animation: hoverLift 0.6s ease-in-out;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 2s linear infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-top {
    animation: slideInTop 0.6s ease-out;
}

.slide-in-bottom {
    animation: slideInBottom 0.6s ease-out;
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

.scale-out {
    animation: scaleOut 0.4s ease-out;
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Flip Animation */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease-out;
}

/* Blur In Animation */
@keyframes blurIn {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 0.8s ease-out;
}

/* Utility Classes */
.animate-delay-100 {
    animation-delay: 100ms;
}

.animate-delay-200 {
    animation-delay: 200ms;
}

.animate-delay-300 {
    animation-delay: 300ms;
}

.animate-delay-400 {
    animation-delay: 400ms;
}

.animate-delay-500 {
    animation-delay: 500ms;
}

.animate-duration-fast {
    animation-duration: 0.3s;
}

.animate-duration-normal {
    animation-duration: 0.5s;
}

.animate-duration-slow {
    animation-duration: 1s;
}

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s ease;
}

.smooth-transition-slow {
    transition: all 0.6s ease;
}

/* Hover Effects */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-translate-up:hover {
    transform: translateY(-5px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

/* Loading Spinner */
@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 4px solid rgba(0, 240, 255, 0.1);
    border-top: 4px solid #00f0ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spinner 1s linear infinite;
}

/* Data Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.count-up {
    animation: countUp 0.5s ease-out;
}

/* Pulsating Border */
@keyframes pulseBorder {
    0%, 100% {
        border-color: rgba(0, 240, 255, 0.3);
    }
    50% {
        border-color: rgba(0, 240, 255, 1);
    }
}

.pulse-border {
    animation: pulseBorder 2s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 240, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
