/**
 * Antigravity Effects CSS
 * 무중력 디자인 효과 스타일시트
 *
 * @version 2.0.0
 */

/* =====================================================
   Antigravity Particles
   ===================================================== */
.antigravity-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    will-change: transform, opacity;
    filter: blur(0.5px);
}

/* =====================================================
   Floating Elements
   ===================================================== */
.antigravity-ready {
    will-change: transform;
}

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

@keyframes antigravityFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-12px) rotate(0.5deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-12px) rotate(-0.5deg);
    }
}

/* 다양한 부유 변형 */
.antigravity-float-slow {
    animation: antigravityFloat 6s ease-in-out infinite;
}

.antigravity-float-fast {
    animation: antigravityFloat 2.5s ease-in-out infinite;
}

.antigravity-float-small {
    animation: antigravityFloatSmall 3s ease-in-out infinite;
}

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

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

.will-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 슬라이드 업 */
.animated.slideUp {
    animation: slideUpFade 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 슬라이드 인 왼쪽 */
.animated.slideInLeft {
    animation: slideInLeftFade 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 슬라이드 인 오른쪽 */
.animated.slideInRight {
    animation: slideInRightFade 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 줌 인 */
.animated.zoomIn {
    animation: zoomInFade 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes zoomInFade {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 페이드 인 */
.animated.fadeIn {
    animation: fadeInOnly 0.8s ease-out forwards;
}

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

/* =====================================================
   3D Tilt Effect
   ===================================================== */
.tilt-effect {
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.tilt-effect .tilt-inner {
    transform: translateZ(30px);
    transition: transform 0.3s ease-out;
}

/* =====================================================
   Glow Effects
   ===================================================== */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(244, 208, 63, 0.4),
                    0 0 30px rgba(244, 208, 63, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(244, 208, 63, 0.6),
                    0 0 50px rgba(244, 208, 63, 0.4);
    }
}

.glow-active {
    box-shadow: 0 0 20px rgba(26, 95, 122, 0.5),
                0 0 40px rgba(26, 95, 122, 0.3),
                0 5px 30px rgba(26, 95, 122, 0.4) !important;
}

/* 네온 글로우 */
.neon-glow {
    text-shadow:
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
    animation: neonFlicker 3s ease-in-out infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* =====================================================
   Character Animation (글자별 애니메이션)
   ===================================================== */
.char {
    display: inline-block;
    animation: charWave 2s ease-in-out infinite;
}

@keyframes charWave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

/* =====================================================
   Background Gradient Animation
   ===================================================== */
.gradient-animate {
    background: linear-gradient(-45deg, #1a5f7a, #2980b9, #0d3d52, #3498db);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

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

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmerSlide 3s ease-in-out infinite;
}

@keyframes shimmerSlide {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

/* =====================================================
   Magnetic Effect (마우스 따라가기)
   ===================================================== */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Road/Parking Line Animation
   ===================================================== */
.road-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.road-lines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 200%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.8) 0px,
        rgba(255, 255, 255, 0.8) 30px,
        transparent 30px,
        transparent 60px
    );
    animation: roadLineMove 2s linear infinite;
}

@keyframes roadLineMove {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

/* 주차 라인 패턴 */
.parking-lines-pattern {
    background-image:
        linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.1) 49%, rgba(255, 255, 255, 0.1) 51%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(244, 208, 63, 0.2) 49%, rgba(244, 208, 63, 0.2) 51%, transparent 51%);
    background-size: 100px 100px;
}

/* =====================================================
   Loading Animation
   ===================================================== */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(26, 95, 122, 0.1);
    border-top-color: var(--parking-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--parking-primary);
    border-radius: 50%;
    animation: loadingBounce 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 loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

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

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
}

/* =====================================================
   Hover Lift Effect
   ===================================================== */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(26, 95, 122, 0.2);
}

/* =====================================================
   Card Stack Effect
   ===================================================== */
.card-stack {
    position: relative;
}

.card-stack::before,
.card-stack::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: -10px;
    bottom: -10px;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.card-stack::after {
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    opacity: 0.3;
}

.card-stack:hover::before {
    transform: translate(-5px, -5px);
}

.card-stack:hover::after {
    transform: translate(-10px, -10px);
}

/* =====================================================
   Border Animation
   ===================================================== */
.border-animate {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, var(--parking-primary), var(--parking-secondary)) border-box;
}

.border-flow {
    position: relative;
    overflow: hidden;
}

.border-flow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--parking-primary), var(--parking-secondary), var(--parking-primary));
    background-size: 200% 200%;
    animation: borderFlow 3s linear infinite;
    z-index: -1;
    border-radius: inherit;
}

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

/* =====================================================
   Text Reveal Animation
   ===================================================== */
.text-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    animation: textReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes textReveal {
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* =====================================================
   Parallax Layers
   ===================================================== */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    will-change: transform;
}

.parallax-layer[data-parallax-speed="0.2"] {
    z-index: 1;
}

.parallax-layer[data-parallax-speed="0.5"] {
    z-index: 2;
}

.parallax-layer[data-parallax-speed="0.8"] {
    z-index: 3;
}

/* =====================================================
   Reduced Motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .antigravity-float,
    .antigravity-float-slow,
    .antigravity-float-fast,
    .antigravity-float-small,
    .glow-pulse,
    .char,
    .gradient-animate,
    .shimmer::before,
    .road-lines::before,
    .loading-spinner,
    .loading-dots span,
    .border-flow::before {
        animation: none !important;
    }

    .will-animate {
        opacity: 1;
        transform: none;
    }

    .hover-lift:hover {
        transform: none;
    }

    .antigravity-particles {
        display: none;
    }
}
