/**
 * animations.css - 애니메이션 및 트랜지션
 * 위치: /assets/css/animations.css
 */

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

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

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Bounce */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

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

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

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 111, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 111, 0, 0.6);
    }
}

/* Text Glow */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 111, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 111, 0, 0.8), 0 0 30px rgba(255, 111, 0, 0.5);
    }
}

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

/* Progress Bar */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: var(--progress, 100%);
    }
}

/* Typing Cursor */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

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

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

/* ==========================================
   ANTIGRAVITY EFFECTS - PARTICLE ORBIT
   ========================================== */

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

/* Orbit Around */
@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(var(--orbit-radius, 100px)) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(var(--orbit-radius, 100px)) rotate(-360deg);
    }
}

/* Orbit Reverse */
@keyframes orbitReverse {
    from {
        transform: rotate(360deg) translateX(var(--orbit-radius, 80px)) rotate(-360deg);
    }
    to {
        transform: rotate(0deg) translateX(var(--orbit-radius, 80px)) rotate(0deg);
    }
}

/* Orbit Ellipse */
@keyframes orbitEllipse {
    0% {
        transform: translate(calc(var(--orbit-x, 100px) * 1), 0);
    }
    25% {
        transform: translate(0, calc(var(--orbit-y, 50px) * 1));
    }
    50% {
        transform: translate(calc(var(--orbit-x, 100px) * -1), 0);
    }
    75% {
        transform: translate(0, calc(var(--orbit-y, 50px) * -1));
    }
    100% {
        transform: translate(calc(var(--orbit-x, 100px) * 1), 0);
    }
}

/* Particle Twinkle */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ==========================================
   ANTIGRAVITY EFFECTS - BLUESHIFT
   ========================================== */

/* Blue Shift Glow */
@keyframes blueShift {
    0% {
        filter: hue-rotate(0deg) brightness(1);
        box-shadow: 0 0 10px rgba(77, 171, 247, 0.3);
    }
    50% {
        filter: hue-rotate(-20deg) brightness(1.2);
        box-shadow: 0 0 30px rgba(77, 171, 247, 0.6), 0 0 60px rgba(100, 149, 237, 0.3);
    }
    100% {
        filter: hue-rotate(0deg) brightness(1);
        box-shadow: 0 0 10px rgba(77, 171, 247, 0.3);
    }
}

/* Cosmic Pulse */
@keyframes cosmicPulse {
    0%, 100% {
        background: radial-gradient(circle at center, rgba(77, 171, 247, 0.1) 0%, transparent 70%);
    }
    50% {
        background: radial-gradient(circle at center, rgba(77, 171, 247, 0.3) 0%, rgba(100, 149, 237, 0.1) 50%, transparent 70%);
    }
}

/* Doppler Wave */
@keyframes dopplerWave {
    0% {
        transform: scale(1);
        opacity: 0.8;
        border-color: rgba(77, 171, 247, 0.5);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-color: rgba(100, 149, 237, 0);
    }
}

/* Star Field */
@keyframes starField {
    0% {
        transform: translateZ(0) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateZ(200px) scale(1);
        opacity: 0;
    }
}

/* Nebula Drift */
@keyframes nebulaDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(20px, -10px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-10px, -20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(-20px, 10px) scale(1.05);
        opacity: 0.35;
    }
}

/* ==========================================
   VAK TYPE ANIMATIONS
   ========================================== */

/* Visual Type - Eye Animation */
@keyframes visualPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(77, 171, 247, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(77, 171, 247, 0.8), 0 0 60px rgba(77, 171, 247, 0.4);
    }
}

/* Auditory Type - Wave Animation */
@keyframes auditoryWave {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.5);
    }
}

@keyframes soundWave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Kinesthetic Type - Touch Animation */
@keyframes kinestheticBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================
   LOADING ANIMATIONS
   ========================================== */

/* Loading Dots */
@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Loading Spinner */
@keyframes loadingSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Bar */
@keyframes loadingBar {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Logo Pulse for Loading */
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ==========================================
   UTILITY ANIMATION CLASSES
   ========================================== */

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

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

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

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

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

/* Scale Animations */
.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

/* Bounce & Pulse */
.animate-bounce {
    animation: bounce 1s ease-in-out;
}

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Continuous Animations */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

.animate-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

.animate-text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

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

/* Blinking Cursor */
.animate-blink {
    animation: blink 1s step-end infinite;
}

/* ==========================================
   SCROLL REVEAL ANIMATIONS
   ========================================== */

/* Initial hidden state */
[data-animate] {
    opacity: 0;
}

[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-down"] {
    transform: translateY(-30px);
}

[data-animate="fade-left"] {
    transform: translateX(-30px);
}

[data-animate="fade-right"] {
    transform: translateX(30px);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="zoom"] {
    transform: scale(0.5);
}

/* Revealed state */
[data-animate].revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Stagger delays */
[data-animate-delay="100"] { transition-delay: 100ms; }
[data-animate-delay="200"] { transition-delay: 200ms; }
[data-animate-delay="300"] { transition-delay: 300ms; }
[data-animate-delay="400"] { transition-delay: 400ms; }
[data-animate-delay="500"] { transition-delay: 500ms; }
[data-animate-delay="600"] { transition-delay: 600ms; }
[data-animate-delay="700"] { transition-delay: 700ms; }
[data-animate-delay="800"] { transition-delay: 800ms; }

/* ==========================================
   HOVER ANIMATIONS
   ========================================== */

/* Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Scale Effect */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Glow Effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 111, 0, 0.5);
}

/* Border Glow */
.hover-border-glow {
    position: relative;
    overflow: hidden;
}

.hover-border-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-border-glow:hover::before {
    opacity: 1;
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */

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

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* ==========================================
   CARD ANIMATIONS
   ========================================== */

/* Card Tilt Effect */
.card-tilt {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-shine:hover::before {
    opacity: 1;
    animation: cardShine 0.6s ease-out;
}

@keyframes cardShine {
    from {
        transform: rotate(30deg) translateX(-100%);
    }
    to {
        transform: rotate(30deg) translateX(100%);
    }
}

/* ==========================================
   PROGRESS ANIMATIONS
   ========================================== */

/* Progress Fill */
.progress-animated .progress-fill {
    animation: progressBar 1s ease-out forwards;
}

/* Counter Animation Class */
.counter-animated {
    transition: all 0.3s ease;
}

/* ==========================================
   TOAST ANIMATIONS
   ========================================== */

.toast-enter {
    animation: slideInUp 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideOutDown 0.3s ease-in forwards;
}

/* ==========================================
   MODAL ANIMATIONS
   ========================================== */

.modal-enter {
    animation: scaleIn 0.3s ease-out forwards;
}

.modal-exit {
    animation: fadeIn 0.2s ease-in reverse forwards;
}

.modal-overlay-enter {
    animation: fadeIn 0.3s ease-out forwards;
}

.modal-overlay-exit {
    animation: fadeIn 0.2s ease-in reverse forwards;
}

/* ==========================================
   NAVIGATION ANIMATIONS
   ========================================== */

/* Mobile Nav Slide */
.mobile-nav-enter {
    animation: slideInRight 0.3s ease-out forwards;
}

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

.mobile-nav-exit {
    animation: slideOutRight 0.3s ease-in forwards;
}

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

/* ==========================================
   VAK TEST SPECIFIC ANIMATIONS
   ========================================== */

/* Question Transition */
.question-enter {
    animation: fadeInRight 0.4s ease-out forwards;
}

.question-exit {
    animation: fadeOutLeft 0.3s ease-in forwards;
}

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

/* Option Select */
.option-selected {
    animation: optionPulse 0.3s ease-out;
}

@keyframes optionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

/* Result Reveal */
.result-reveal {
    animation: resultReveal 0.8s ease-out forwards;
}

@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    60% {
        transform: scale(1.02) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Chart Bar Animation */
.chart-bar-animated {
    transform-origin: bottom;
    animation: chartBarGrow 0.8s ease-out forwards;
}

@keyframes chartBarGrow {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

/* ==========================================
   ROADMAP ANIMATIONS
   ========================================== */

/* Timeline Progress */
.timeline-progress {
    animation: timelineGrow 1s ease-out forwards;
}

@keyframes timelineGrow {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

/* Day Unlock Animation */
.day-unlock {
    animation: dayUnlock 0.5s ease-out forwards;
}

@keyframes dayUnlock {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    70% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* ==========================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================== */

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

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    .animate-spin,
    .animate-float,
    .animate-pulse,
    .animate-glow {
        animation: none;
    }
}
