/**
 * animations.css - 애니메이션 및 트랜지션
 * Antigravity Effects: Energy Charge, Light Ambient, Ripple Distort
 */

/* ==========================================
   Keyframe Animations
   ========================================== */

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(88, 204, 2, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(88, 204, 2, 0.6);
    }
}

@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==========================================
   ANTIGRAVITY EFFECT 1: Energy Charge
   - Building power effect
   - Used for CTA buttons and important elements
   ========================================== */
@keyframes energyCharge {
    0% {
        box-shadow:
            0 0 5px rgba(88, 204, 2, 0.2),
            0 0 10px rgba(88, 204, 2, 0.1);
    }
    25% {
        box-shadow:
            0 0 15px rgba(88, 204, 2, 0.4),
            0 0 30px rgba(88, 204, 2, 0.2),
            0 0 45px rgba(88, 204, 2, 0.1);
    }
    50% {
        box-shadow:
            0 0 25px rgba(88, 204, 2, 0.6),
            0 0 50px rgba(88, 204, 2, 0.4),
            0 0 75px rgba(88, 204, 2, 0.2),
            inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    75% {
        box-shadow:
            0 0 20px rgba(88, 204, 2, 0.5),
            0 0 40px rgba(88, 204, 2, 0.3),
            0 0 60px rgba(88, 204, 2, 0.15);
    }
    100% {
        box-shadow:
            0 0 5px rgba(88, 204, 2, 0.2),
            0 0 10px rgba(88, 204, 2, 0.1);
    }
}

@keyframes energyChargeCosmic {
    0% {
        box-shadow:
            0 0 5px rgba(0, 35, 102, 0.2),
            0 0 10px rgba(0, 35, 102, 0.1);
    }
    25% {
        box-shadow:
            0 0 15px rgba(0, 35, 102, 0.4),
            0 0 30px rgba(59, 130, 246, 0.2),
            0 0 45px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow:
            0 0 25px rgba(0, 35, 102, 0.6),
            0 0 50px rgba(59, 130, 246, 0.4),
            0 0 75px rgba(139, 92, 246, 0.2),
            inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    75% {
        box-shadow:
            0 0 20px rgba(0, 35, 102, 0.5),
            0 0 40px rgba(59, 130, 246, 0.3),
            0 0 60px rgba(139, 92, 246, 0.15);
    }
    100% {
        box-shadow:
            0 0 5px rgba(0, 35, 102, 0.2),
            0 0 10px rgba(0, 35, 102, 0.1);
    }
}

.energy-charge {
    animation: energyCharge 3s ease-in-out infinite;
}

.energy-charge-cosmic {
    animation: energyChargeCosmic 3s ease-in-out infinite;
}

/* Energy Burst on Hover */
@keyframes energyBurst {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.energy-burst:hover {
    animation: energyBurst 0.3s ease-out;
}

/* ==========================================
   ANTIGRAVITY EFFECT 2: Light Ambient
   - Soft ambient glow
   - Used for background elements and cards
   ========================================== */
@keyframes ambientGlow {
    0%, 100% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(15deg);
    }
}

@keyframes ambientPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.ambient-glow {
    position: relative;
    overflow: hidden;
}

.ambient-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(88, 204, 2, 0.15) 0%,
        rgba(59, 130, 246, 0.1) 25%,
        rgba(139, 92, 246, 0.05) 50%,
        transparent 70%
    );
    animation: ambientPulse 4s ease-in-out infinite;
    pointer-events: none;
}

.ambient-glow-cosmic::before {
    background: radial-gradient(
        circle at center,
        rgba(0, 35, 102, 0.2) 0%,
        rgba(59, 130, 246, 0.15) 25%,
        rgba(139, 92, 246, 0.1) 50%,
        transparent 70%
    );
}

/* Soft Floating Light Orbs */
@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.6;
    }
    25% {
        transform: translate(20px, -20px);
        opacity: 0.8;
    }
    50% {
        transform: translate(40px, 10px);
        opacity: 0.5;
    }
    75% {
        transform: translate(10px, 30px);
        opacity: 0.7;
    }
}

.light-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    animation: floatOrb 15s ease-in-out infinite;
}

.light-orb-1 {
    background: rgba(88, 204, 2, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.light-orb-2 {
    background: rgba(0, 35, 102, 0.3);
    top: 50%;
    right: -100px;
    animation-delay: -5s;
}

.light-orb-3 {
    background: rgba(139, 92, 246, 0.3);
    bottom: -100px;
    left: 50%;
    animation-delay: -10s;
}

/* ==========================================
   ANTIGRAVITY EFFECT 3: Ripple Distort
   - Ripple distortion effect
   - Used for interactive elements
   ========================================== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes rippleMultiple {
    0% {
        box-shadow:
            0 0 0 0 rgba(88, 204, 2, 0.4),
            0 0 0 0 rgba(88, 204, 2, 0.3),
            0 0 0 0 rgba(88, 204, 2, 0.2);
    }
    100% {
        box-shadow:
            0 0 0 10px rgba(88, 204, 2, 0),
            0 0 0 20px rgba(88, 204, 2, 0),
            0 0 0 30px rgba(88, 204, 2, 0);
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

.ripple-continuous {
    animation: rippleMultiple 2s infinite;
}

/* Water Wave Effect */
@keyframes waterWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.water-wave {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    background-size: 200% 100%;
    animation: waterWave 3s ease-in-out infinite;
}

/* ==========================================
   Animation Utility Classes
   ========================================== */
.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 10s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Animation Durations */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 0.8s; }
.duration-slower { animation-duration: 1.2s; }

/* ==========================================
   Scroll-Triggered Animations
   ========================================== */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation for Children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 100ms; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 200ms; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 300ms; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 500ms; opacity: 1; transform: translateY(0); }

/* ==========================================
   Hover Animations
   ========================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

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

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(88, 204, 2, 0.5);
}

.hover-glow-cosmic:hover {
    box-shadow: 0 0 30px rgba(0, 35, 102, 0.5);
}

/* ==========================================
   Loading States
   ========================================== */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: rotate 1s linear infinite;
}

.loading-spinner-dark {
    border-color: rgba(0, 35, 102, 0.2);
    border-top-color: var(--primary-deep);
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

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

.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; }

/* Skeleton Loading */
@keyframes skeleton {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* ==========================================
   Page Transitions
   ========================================== */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ==========================================
   Hero Section Specific Animations
   ========================================== */
@keyframes heroTextReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.hero-text-reveal {
    animation: heroTextReveal 0.8s ease-out forwards;
}

@keyframes heroGradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-gradient-animate {
    background-size: 200% 200%;
    animation: heroGradientShift 8s ease infinite;
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

/* ==========================================
   Counter Animation
   ========================================== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-animate {
    animation: countUp 0.6s ease-out forwards;
}

/* ==========================================
   Success/Error State Animations
   ========================================== */
@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-animation {
    animation: successPop 0.5s ease-out forwards;
}

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

.error-shake {
    animation: shake 0.6s ease-out;
}

/* ==========================================
   Confetti Animation (for success states)
   ========================================== */
@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}
