/**
 * 본투어 인터내셔날 - 2026 트렌디 애니메이션
 */

/* ============================================
   기본 전환 효과
============================================ */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   페이지 전환 애니메이션
============================================ */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.page-enter {
    animation: pageEnter 0.4s ease-out forwards;
}

.page-fade-in {
    animation: pageFadeIn 0.3s ease-out forwards;
}

.page-slide-up {
    animation: pageSlideUp 0.5s ease-out forwards;
}

/* ============================================
   사이드바 애니메이션
============================================ */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

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

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

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

.slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

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

/* ============================================
   아코디언 애니메이션
============================================ */
@keyframes expandDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

@keyframes collapseUp {
    from {
        max-height: 1000px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

.accordion-content {
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
}

.accordion-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.accordion-content.expanded {
    max-height: 1000px;
    opacity: 1;
}

/* 아코디언 화살표 회전 */
.accordion-arrow {
    transition: transform 0.3s ease;
}

.accordion-arrow.rotated {
    transform: rotate(180deg);
}

/* ============================================
   버튼 애니메이션
============================================ */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 버튼 리플 효과 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-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%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   카드 애니메이션
============================================ */
.card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(26, 35, 126, 0.15);
}

.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* ============================================
   로딩 애니메이션
============================================ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

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

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

@keyframes dots {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    80%, 100% {
        opacity: 0;
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

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

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* 로딩 스피너 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 35, 126, 0.1);
    border-top-color: var(--primary-700, #303f9f);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 로딩 점 */
.loading-dots {
    display: flex;
    gap: 6px;
}

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

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ============================================
   스켈레톤 로딩
============================================ */
@keyframes shimmer {
    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: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-circle {
    border-radius: 50%;
}

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

/* ============================================
   토스트 애니메이션
============================================ */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

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

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

/* ============================================
   모달 애니메이션
============================================ */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes modalSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-backdrop {
    animation: modalFadeIn 0.2s ease-out forwards;
}

.modal-content {
    animation: modalScaleIn 0.3s ease-out forwards;
}

.modal-bottom-sheet {
    animation: modalSlideUp 0.3s ease-out forwards;
}

/* ============================================
   폼 인터랙션
============================================ */
/* 플로팅 라벨 */
.floating-label-group {
    position: relative;
}

.floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
    pointer-events: none;
    transition: all 0.2s ease;
    font-size: 16px;
}

.floating-label-group input:focus + .floating-label,
.floating-label-group input:not(:placeholder-shown) + .floating-label,
.floating-label-group textarea:focus + .floating-label,
.floating-label-group textarea:not(:placeholder-shown) + .floating-label {
    top: 8px;
    font-size: 12px;
    color: var(--primary-600, #3949ab);
}

/* 입력 필드 포커스 */
.input-focus-effect {
    position: relative;
}

.input-focus-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-600, #3949ab);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.input-focus-effect:focus-within::after {
    width: 100%;
}

/* 체크박스 애니메이션 */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 20;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkbox-animated:checked + label::after {
    animation: checkmark 0.3s ease-out forwards;
}

/* ============================================
   숫자 카운트 애니메이션
============================================ */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.5s ease-out forwards;
}

/* ============================================
   물결 효과 (터치 피드백)
============================================ */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

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

/* ============================================
   D-Day 카운터 애니메이션
============================================ */
@keyframes ddayPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.dday-counter {
    animation: ddayPulse 3s ease-in-out infinite;
}

/* ============================================
   메뉴 아이템 스태거 애니메이션
============================================ */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stagger-item {
    opacity: 0;
    animation: staggerFadeIn 0.3s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   프로그레스 바 애니메이션
============================================ */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-bar-animated {
    animation: progressFill 1s ease-out forwards;
}

/* ============================================
   알림 배지 펄스
============================================ */
@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

.badge-pulse {
    animation: badgePulse 2s infinite;
}

/* ============================================
   유틸리티 클래스
============================================ */
.transition-none {
    transition: none !important;
}

.transition-fast {
    transition-duration: 0.15s !important;
}

.transition-normal {
    transition-duration: 0.3s !important;
}

.transition-slow {
    transition-duration: 0.5s !important;
}

/* 부드러운 스크롤 */
html {
    scroll-behavior: smooth;
}

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