/*
 * animations.css - 안티그래비티 게임만들기 애니메이션 스타일시트
 * ANTIGRAVITY 효과: Cosmic Void, Energy Core, Light Speed In
 * 위치: /assets/css/animations.css
 */

/* ========== COSMIC VOID EFFECT (우주 공동) ========== */
.cosmic-void-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cosmic-void-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
}

.cosmic-void-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(102, 126, 234, 0.1);
    animation: void-expand 8s ease-out infinite;
}

.cosmic-void-ring:nth-child(1) {
    animation-delay: 0s;
}

.cosmic-void-ring:nth-child(2) {
    animation-delay: 2s;
}

.cosmic-void-ring:nth-child(3) {
    animation-delay: 4s;
}

.cosmic-void-ring:nth-child(4) {
    animation-delay: 6s;
}

@keyframes void-expand {
    0% {
        width: 0;
        height: 0;
        margin-left: 0;
        margin-top: 0;
        opacity: 0.8;
        border-color: rgba(240, 147, 251, 0.4);
    }
    50% {
        opacity: 0.4;
        border-color: rgba(102, 126, 234, 0.3);
    }
    100% {
        width: 800px;
        height: 800px;
        margin-left: -400px;
        margin-top: -400px;
        opacity: 0;
        border-color: rgba(102, 126, 234, 0);
    }
}

.cosmic-void-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse at center,
        rgba(102, 126, 234, 0.2) 0%,
        rgba(118, 75, 162, 0.1) 30%,
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(40px);
    animation: void-glow-pulse 6s ease-in-out infinite;
}

@keyframes void-glow-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

/* ========== ENERGY CORE EFFECT (에너지 코어) ========== */
.energy-core-container {
    position: relative;
    display: inline-block;
}

.energy-core-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.energy-core-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(240, 147, 251, 0.8) 30%,
        rgba(102, 126, 234, 0.4) 60%,
        transparent 80%
    );
    border-radius: 50%;
    animation: core-pulse 2s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: blur(2px);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        filter: blur(4px);
    }
}

.energy-core-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: ring-rotate 4s linear infinite;
}

.energy-core-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    margin-left: -40px;
    margin-top: -40px;
    animation-direction: normal;
}

.energy-core-ring:nth-child(2) {
    width: 120px;
    height: 120px;
    margin-left: -60px;
    margin-top: -60px;
    animation-direction: reverse;
    animation-duration: 6s;
    border-color: rgba(240, 147, 251, 0.4);
}

.energy-core-ring:nth-child(3) {
    width: 160px;
    height: 160px;
    margin-left: -80px;
    margin-top: -80px;
    animation-duration: 8s;
    border-color: rgba(118, 75, 162, 0.3);
}

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

.energy-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-left: -100px;
    margin-top: -100px;
}

.energy-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(240, 147, 251, 0.8);
    border-radius: 50%;
    animation: particle-orbit 3s linear infinite;
}

.energy-particle:nth-child(1) {
    top: 50%;
    left: 0;
    animation-delay: 0s;
}

.energy-particle:nth-child(2) {
    top: 0;
    left: 50%;
    animation-delay: 0.75s;
}

.energy-particle:nth-child(3) {
    top: 50%;
    right: 0;
    animation-delay: 1.5s;
}

.energy-particle:nth-child(4) {
    bottom: 0;
    left: 50%;
    animation-delay: 2.25s;
}

@keyframes particle-orbit {
    0% {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
        opacity: 1;
    }
}

/* ========== LIGHT SPEED IN EFFECT (광속 인) ========== */
.lightspeed-container {
    overflow: hidden;
}

.lightspeed-in {
    animation: lightspeed-enter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes lightspeed-enter {
    0% {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
        filter: blur(20px);
    }
    60% {
        transform: translateX(-5%) skewX(10deg);
        opacity: 1;
        filter: blur(0);
    }
    80% {
        transform: translateX(2%) skewX(-3deg);
    }
    100% {
        transform: translateX(0) skewX(0);
    }
}

.lightspeed-out {
    animation: lightspeed-exit 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes lightspeed-exit {
    0% {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%) skewX(30deg);
        opacity: 0;
        filter: blur(20px);
    }
}

/* Light Streak Effect */
.light-streak {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.streak-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(102, 126, 234, 0.8),
        rgba(240, 147, 251, 0.6),
        transparent
    );
    animation: streak-fly 0.5s linear forwards;
}

@keyframes streak-fly {
    0% {
        transform: translateX(-100%) scaleX(0.5);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) scaleX(2);
        opacity: 0;
    }
}

/* ========== FLOATING ANIMATION ========== */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* ========== GLOW PULSE ANIMATION ========== */
.glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.8),
                    0 0 60px rgba(240, 147, 251, 0.4);
    }
}

/* ========== NEON FLICKER ========== */
.neon-flicker {
    animation: neon-flicker 2s ease-in-out infinite;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 7px rgba(102, 126, 234, 0.8),
            0 0 10px rgba(102, 126, 234, 0.8),
            0 0 21px rgba(102, 126, 234, 0.8),
            0 0 42px rgba(102, 126, 234, 0.6),
            0 0 82px rgba(102, 126, 234, 0.4);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ========== PARALLAX STARS ========== */
.stars-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stars-layer-1 {
    animation: stars-move 100s linear infinite;
}

.stars-layer-2 {
    animation: stars-move 150s linear infinite;
}

.stars-layer-3 {
    animation: stars-move 200s linear infinite;
}

@keyframes stars-move {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

/* ========== METEOR SHOWER ========== */
.meteor {
    position: fixed;
    width: 2px;
    height: 80px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(102, 126, 234, 1) 100%
    );
    animation: meteor-fall 2s linear forwards;
    pointer-events: none;
    z-index: 9998;
}

@keyframes meteor-fall {
    0% {
        transform: translateY(-100vh) translateX(0) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(-100px) rotate(45deg);
        opacity: 0;
    }
}

/* ========== AURORA EFFECT ========== */
.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-wave {
    position: absolute;
    width: 200%;
    height: 50%;
    top: 0;
    left: -50%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(102, 126, 234, 0.1) 30%,
        rgba(118, 75, 162, 0.15) 50%,
        rgba(240, 147, 251, 0.1) 70%,
        transparent 100%
    );
    animation: aurora-flow 15s ease-in-out infinite;
    filter: blur(50px);
}

.aurora-wave:nth-child(2) {
    animation-delay: -5s;
    animation-duration: 20s;
}

.aurora-wave:nth-child(3) {
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes aurora-flow {
    0%, 100% {
        transform: translateX(-20%) skewX(-5deg);
    }
    50% {
        transform: translateX(20%) skewX(5deg);
    }
}

/* ========== NEBULA CLOUD ========== */
.nebula-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.nebula-cloud {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: nebula-drift 30s ease-in-out infinite;
}

.nebula-cloud:nth-child(1) {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle,
        rgba(102, 126, 234, 0.4) 0%,
        transparent 70%
    );
    animation-delay: 0s;
}

.nebula-cloud:nth-child(2) {
    width: 500px;
    height: 500px;
    top: 50%;
    right: -150px;
    background: radial-gradient(circle,
        rgba(118, 75, 162, 0.4) 0%,
        transparent 70%
    );
    animation-delay: -10s;
}

.nebula-cloud:nth-child(3) {
    width: 700px;
    height: 700px;
    bottom: -250px;
    left: 30%;
    background: radial-gradient(circle,
        rgba(240, 147, 251, 0.3) 0%,
        transparent 70%
    );
    animation-delay: -20s;
}

@keyframes nebula-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 50px) scale(0.9);
    }
    75% {
        transform: translate(-50px, -20px) scale(1.05);
    }
}

/* ========== WARP SPEED LINES ========== */
.warp-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 500px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.warp-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 100px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    animation: warp-fly 3s linear infinite;
}

@keyframes warp-fly {
    0% {
        transform: translate(-50%, -50%) translateZ(-500px) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translateZ(500px) scale(5);
        opacity: 0;
    }
}

/* ========== HOLOGRAPHIC GLITCH ========== */
.holo-glitch {
    position: relative;
}

.holo-glitch::before,
.holo-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.holo-glitch::before {
    left: 2px;
    text-shadow: -2px 0 rgba(255, 0, 255, 0.7);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.holo-glitch::after {
    left: -2px;
    text-shadow: -2px 0 rgba(0, 255, 255, 0.7);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }
    5% {
        clip: rect(70px, 9999px, 71px, 0);
    }
    10% {
        clip: rect(29px, 9999px, 24px, 0);
    }
    15% {
        clip: rect(89px, 9999px, 4px, 0);
    }
    20% {
        clip: rect(49px, 9999px, 62px, 0);
    }
    25% {
        clip: rect(87px, 9999px, 59px, 0);
    }
    30% {
        clip: rect(26px, 9999px, 91px, 0);
    }
    35% {
        clip: rect(16px, 9999px, 57px, 0);
    }
    40% {
        clip: rect(98px, 9999px, 35px, 0);
    }
    45% {
        clip: rect(71px, 9999px, 98px, 0);
    }
    50% {
        clip: rect(22px, 9999px, 45px, 0);
    }
    55% {
        clip: rect(52px, 9999px, 11px, 0);
    }
    60% {
        clip: rect(11px, 9999px, 67px, 0);
    }
    65% {
        clip: rect(91px, 9999px, 20px, 0);
    }
    70% {
        clip: rect(53px, 9999px, 84px, 0);
    }
    75% {
        clip: rect(40px, 9999px, 29px, 0);
    }
    80% {
        clip: rect(72px, 9999px, 55px, 0);
    }
    85% {
        clip: rect(8px, 9999px, 42px, 0);
    }
    90% {
        clip: rect(35px, 9999px, 78px, 0);
    }
    95% {
        clip: rect(64px, 9999px, 14px, 0);
    }
    100% {
        clip: rect(47px, 9999px, 93px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }
    5% {
        clip: rect(37px, 9999px, 18px, 0);
    }
    10% {
        clip: rect(78px, 9999px, 63px, 0);
    }
    15% {
        clip: rect(12px, 9999px, 88px, 0);
    }
    20% {
        clip: rect(93px, 9999px, 31px, 0);
    }
    25% {
        clip: rect(24px, 9999px, 76px, 0);
    }
    30% {
        clip: rect(56px, 9999px, 42px, 0);
    }
    35% {
        clip: rect(81px, 9999px, 9px, 0);
    }
    40% {
        clip: rect(43px, 9999px, 67px, 0);
    }
    45% {
        clip: rect(15px, 9999px, 95px, 0);
    }
    50% {
        clip: rect(68px, 9999px, 28px, 0);
    }
    55% {
        clip: rect(32px, 9999px, 81px, 0);
    }
    60% {
        clip: rect(97px, 9999px, 16px, 0);
    }
    65% {
        clip: rect(5px, 9999px, 54px, 0);
    }
    70% {
        clip: rect(49px, 9999px, 72px, 0);
    }
    75% {
        clip: rect(86px, 9999px, 38px, 0);
    }
    80% {
        clip: rect(21px, 9999px, 89px, 0);
    }
    85% {
        clip: rect(59px, 9999px, 7px, 0);
    }
    90% {
        clip: rect(74px, 9999px, 46px, 0);
    }
    95% {
        clip: rect(3px, 9999px, 61px, 0);
    }
    100% {
        clip: rect(39px, 9999px, 83px, 0);
    }
}

/* ========== PARTICLE BURST ========== */
.particle-burst {
    position: relative;
}

.particle-burst::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.particle-burst:hover::after {
    animation: burst 0.6s ease-out forwards;
}

@keyframes burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

/* ========== ORBIT ANIMATION ========== */
.orbit-container {
    position: relative;
    display: inline-block;
}

.orbit-element {
    position: absolute;
    animation: orbit 10s linear infinite;
}

.orbit-element:nth-child(1) { animation-delay: 0s; }
.orbit-element:nth-child(2) { animation-delay: -2.5s; }
.orbit-element:nth-child(3) { animation-delay: -5s; }
.orbit-element:nth-child(4) { animation-delay: -7.5s; }

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(100px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(100px) rotate(-360deg);
    }
}

/* ========== SCANNER LINE ========== */
.scanner {
    position: relative;
    overflow: hidden;
}

.scanner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
        transparent,
        rgba(102, 126, 234, 0.8),
        transparent
    );
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        top: 100%;
        opacity: 1;
    }
}

/* ========== TYPING CURSOR ========== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--primary);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ========== SCROLL REVEAL ANIMATIONS ========== */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered delays for reveal animations */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ========== INTERACTIVE HOVER EFFECTS ========== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6),
                0 0 60px rgba(240, 147, 251, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ========== LOADING ANIMATION ========== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ========== WAVE ANIMATION ========== */
.wave-container {
    position: relative;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23667eea' fill-opacity='0.3' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    animation: wave-move 10s linear infinite;
}

@keyframes wave-move {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cosmic-void-ring,
    .energy-core-ring,
    .nebula-cloud,
    .aurora-wave,
    .warp-line,
    .meteor {
        animation: none;
    }
}
