/**
 * animations.css - 애니메이션 스타일
 * 짧은 영어 명언 - Cosmic Theme Animations
 * 선택된 Antigravity 효과: 천체의 춤, 네온 텍스트, 암흑 성운
 * 위치: /assets/css/animations.css
 */

/* ============================================
   Base Animation Utilities
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.animate-delay-100 { transition-delay: 100ms; }
.animate-delay-200 { transition-delay: 200ms; }
.animate-delay-300 { transition-delay: 300ms; }
.animate-delay-400 { transition-delay: 400ms; }
.animate-delay-500 { transition-delay: 500ms; }

/* ============================================
   Antigravity Effect 1: Celestial Dance (천체의 춤)
   - Orbital ballet animation for floating elements
   ============================================ */
.celestial-orbit {
    position: relative;
}

.celestial-orbit::before,
.celestial-orbit::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.celestial-orbit::before {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    top: -50px;
    right: -50px;
    animation: celestialDance1 15s ease-in-out infinite;
}

.celestial-orbit::after {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.2) 0%, transparent 70%);
    bottom: -30px;
    left: -30px;
    animation: celestialDance2 12s ease-in-out infinite;
}

@keyframes celestialDance1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.5;
    }
    25% {
        transform: translate(30px, -20px) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: translate(0, -40px) rotate(180deg);
        opacity: 0.5;
    }
    75% {
        transform: translate(-30px, -20px) rotate(270deg);
        opacity: 0.8;
    }
}

@keyframes celestialDance2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(-20px, 20px) rotate(120deg) scale(1.1);
    }
    66% {
        transform: translate(20px, -10px) rotate(240deg) scale(0.9);
    }
}

/* Celestial Particles */
.celestial-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.celestial-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite;
}

.celestial-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.celestial-particle:nth-child(2) { left: 30%; top: 60%; animation-delay: 1s; }
.celestial-particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 2s; }
.celestial-particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 3s; }
.celestial-particle:nth-child(5) { left: 90%; top: 40%; animation-delay: 4s; }

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) scale(1.5);
        opacity: 0.8;
    }
}

/* ============================================
   Antigravity Effect 2: Neon Text (네온 텍스트)
   - Glowing neon effect for text elements
   ============================================ */
.neon-text {
    position: relative;
    color: var(--color-text-primary);
    text-shadow:
        0 0 5px rgba(102, 126, 234, 0.5),
        0 0 10px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(102, 126, 234, 0.3),
        0 0 40px rgba(102, 126, 234, 0.2);
    animation: neonPulse 3s ease-in-out infinite;
}

.neon-text-green {
    text-shadow:
        0 0 5px rgba(29, 185, 84, 0.5),
        0 0 10px rgba(29, 185, 84, 0.4),
        0 0 20px rgba(29, 185, 84, 0.3),
        0 0 40px rgba(29, 185, 84, 0.2);
    animation: neonPulseGreen 3s ease-in-out infinite;
}

.neon-text-pink {
    text-shadow:
        0 0 5px rgba(233, 30, 99, 0.5),
        0 0 10px rgba(233, 30, 99, 0.4),
        0 0 20px rgba(233, 30, 99, 0.3),
        0 0 40px rgba(233, 30, 99, 0.2);
    animation: neonPulsePink 3s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(102, 126, 234, 0.5),
            0 0 10px rgba(102, 126, 234, 0.4),
            0 0 20px rgba(102, 126, 234, 0.3),
            0 0 40px rgba(102, 126, 234, 0.2);
    }
    50% {
        text-shadow:
            0 0 10px rgba(102, 126, 234, 0.8),
            0 0 20px rgba(102, 126, 234, 0.6),
            0 0 40px rgba(102, 126, 234, 0.4),
            0 0 80px rgba(102, 126, 234, 0.3);
    }
}

@keyframes neonPulseGreen {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(29, 185, 84, 0.5),
            0 0 10px rgba(29, 185, 84, 0.4),
            0 0 20px rgba(29, 185, 84, 0.3),
            0 0 40px rgba(29, 185, 84, 0.2);
    }
    50% {
        text-shadow:
            0 0 10px rgba(29, 185, 84, 0.8),
            0 0 20px rgba(29, 185, 84, 0.6),
            0 0 40px rgba(29, 185, 84, 0.4),
            0 0 80px rgba(29, 185, 84, 0.3);
    }
}

@keyframes neonPulsePink {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(233, 30, 99, 0.5),
            0 0 10px rgba(233, 30, 99, 0.4),
            0 0 20px rgba(233, 30, 99, 0.3),
            0 0 40px rgba(233, 30, 99, 0.2);
    }
    50% {
        text-shadow:
            0 0 10px rgba(233, 30, 99, 0.8),
            0 0 20px rgba(233, 30, 99, 0.6),
            0 0 40px rgba(233, 30, 99, 0.4),
            0 0 80px rgba(233, 30, 99, 0.3);
    }
}

/* Neon Box Glow */
.neon-box {
    position: relative;
    border: 1px solid var(--color-accent);
    box-shadow:
        0 0 5px var(--color-accent-glow),
        0 0 10px var(--color-accent-glow),
        inset 0 0 5px var(--color-accent-glow);
    animation: neonBoxPulse 4s ease-in-out infinite;
}

@keyframes neonBoxPulse {
    0%, 100% {
        box-shadow:
            0 0 5px var(--color-accent-glow),
            0 0 10px var(--color-accent-glow),
            inset 0 0 5px var(--color-accent-glow);
    }
    50% {
        box-shadow:
            0 0 10px var(--color-accent-glow),
            0 0 20px var(--color-accent-glow),
            0 0 40px var(--color-accent-glow),
            inset 0 0 10px var(--color-accent-glow);
    }
}

/* ============================================
   Antigravity Effect 3: Dark Nebula (암흑 성운)
   - Light-absorbing cloud effect
   ============================================ */
.dark-nebula {
    position: relative;
    overflow: hidden;
}

.dark-nebula::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    animation: nebulaShift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes nebulaShift {
    0%, 100% {
        transform: translate(-10%, -10%) scale(1);
    }
    25% {
        transform: translate(0%, -5%) scale(1.05);
    }
    50% {
        transform: translate(-5%, 0%) scale(1);
    }
    75% {
        transform: translate(-15%, -15%) scale(0.95);
    }
}

/* Dark Nebula Absorption Effect */
.nebula-absorb {
    position: relative;
}

.nebula-absorb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    pointer-events: none;
}

.nebula-absorb:hover::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   Hero Section Animations
   ============================================ */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Floating Orbs */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: floatingOrb 15s ease-in-out infinite;
}

.floating-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(102, 126, 234, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.floating-orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(118, 75, 162, 0.3);
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.floating-orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(233, 30, 99, 0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes floatingOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-30px, 50px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(30px, 30px) scale(1.05);
        opacity: 0.5;
    }
}

/* ============================================
   Quote Card Animations
   ============================================ */
.quote-card {
    animation: cardFadeIn 0.6s ease forwards;
}

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

.quote-card:hover .quote-english {
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: none;
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
}

/* ============================================
   Button Animations
   ============================================ */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   Slider Animations
   ============================================ */
.slide-enter {
    animation: slideEnter 0.5s ease forwards;
}

.slide-exit {
    animation: slideExit 0.5s ease forwards;
}

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

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

/* ============================================
   Like Heart Animation
   ============================================ */
.heart-burst {
    position: relative;
}

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

.heart-burst.active::after {
    animation: heartBurst 0.5s ease-out;
}

@keyframes heartBurst {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

/* ============================================
   Typewriter Effect
   ============================================ */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation:
        typewriter 3s steps(40) 1s forwards,
        blinkCursor 0.75s step-end infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-primary); }
}

/* ============================================
   Scroll Indicator Animation
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-indicator-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--color-text-secondary);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator-icon::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--color-text-secondary);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scrollDot {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(10px); }
}

/* ============================================
   Counter Animation
   ============================================ */
.counter {
    display: inline-block;
}

.counter-digit {
    display: inline-block;
    animation: counterPop 0.3s ease forwards;
}

@keyframes counterPop {
    0% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Page Transition Effects
   ============================================ */
.page-transition-enter {
    animation: pageEnter 0.5s ease forwards;
}

.page-transition-exit {
    animation: pageExit 0.5s ease forwards;
}

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

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

/* ============================================
   Skeleton Loading Animation
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Shimmer Effect
   ============================================ */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ============================================
   Pulse Animation for Important Elements
   ============================================ */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--color-primary-glow);
    }
    50% {
        box-shadow: 0 0 0 15px transparent;
    }
}

/* ============================================
   Float Animation
   ============================================ */
.float {
    animation: float 3s ease-in-out infinite;
}

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

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

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

/* ============================================
   Rotate Animation
   ============================================ */
.rotate {
    animation: rotate 10s linear infinite;
}

.rotate-slow {
    animation: rotate 20s linear infinite;
}

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

/* ============================================
   Shake Animation
   ============================================ */
.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); }
}

/* ============================================
   Bounce Animation
   ============================================ */
.bounce {
    animation: bounce 1s ease infinite;
}

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

/* ============================================
   Fade Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.5s ease forwards;
}

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

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

@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);
    }
}

/* ============================================
   Scale Animations
   ============================================ */
.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

.scale-out {
    animation: scaleOut 0.3s ease forwards;
}

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

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

/* ============================================
   Stagger Animation Helper
   ============================================ */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }
.stagger-item:nth-child(10) { animation-delay: 1s; }
