/**
 * BOOKING ANIMATIONS SYSTEM
 * 
 * Modern animation patterns and micro-interactions
 * Depends on: booking-base.css
 * 
 * Version: 1.0
 * Last Updated: 2025-01-06
 */

/* ==========================================================================
   ENTRANCE ANIMATIONS
   ========================================================================== */

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

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

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

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

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

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   EXIT ANIMATIONS
   ========================================================================== */

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

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

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

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

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

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

/* ==========================================================================
   ATTENTION ANIMATIONS
   ========================================================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

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

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

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

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

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

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

@keyframes dots {
    0%, 20% {
        color: var(--booking-primary);
        transform: scale(1);
    }
    50% {
        color: var(--booking-text-muted);
        transform: scale(1.2);
    }
    100% {
        color: var(--booking-primary);
        transform: scale(1);
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

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

/* Entrance animations */
.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.6s ease-out; }
.animate-fade-in-left { animation: fadeInLeft 0.6s ease-out; }
.animate-fade-in-right { animation: fadeInRight 0.6s ease-out; }
.animate-slide-in-up { animation: slideInUp 0.4s ease-out; }
.animate-slide-in-down { animation: slideInDown 0.4s ease-out; }
.animate-scale-in { animation: scaleIn 0.3s ease-out; }
.animate-bounce-in { animation: bounceIn 0.6s ease-out; }

/* Exit animations */
.animate-fade-out { animation: fadeOut 0.3s ease-in; }
.animate-fade-out-up { animation: fadeOutUp 0.3s ease-in; }
.animate-fade-out-down { animation: fadeOutDown 0.3s ease-in; }
.animate-slide-out-up { animation: slideOutUp 0.3s ease-in; }
.animate-slide-out-down { animation: slideOutDown 0.3s ease-in; }
.animate-scale-out { animation: scaleOut 0.3s ease-in; }

/* Attention animations */
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-bounce { animation: bounce 1s ease-in-out infinite; }
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* Loading animations */
.animate-spin { animation: spin 1s linear infinite; }
.animate-shimmer { animation: shimmer 2s linear infinite; }

/* Animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-700 { animation-delay: 0.7s; }
.animate-delay-1000 { animation-delay: 1s; }

/* Animation durations */
.animate-fast { animation-duration: 0.15s; }
.animate-normal { animation-duration: 0.3s; }
.animate-slow { animation-duration: 0.5s; }
.animate-slower { animation-duration: 1s; }

/* ==========================================================================
   COMPONENT-SPECIFIC ANIMATIONS
   ========================================================================== */

/* Progress bar animations */
.progress-fill-animated {
    animation: progress 1.5s ease-out;
}

/* Button interactions */
.booking-btn-animated {
    transition: all var(--booking-transition-base);
    position: relative;
    overflow: hidden;
}

.booking-btn-animated::before {
    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-out, height 0.6s ease-out;
}

.booking-btn-animated:active::before {
    width: 300px;
    height: 300px;
}

/* Card hover animations */
.booking-card-hover {
    transition: all var(--booking-transition-base);
}

.booking-card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--booking-elevation-4);
}

/* Gallery image animations */
.gallery-image-hover {
    transition: all var(--booking-transition-base);
    position: relative;
    overflow: hidden;
}

.gallery-image-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s ease-out;
}

.gallery-image-hover:hover::after {
    left: 100%;
}

/* Step circle animations */
.step-circle-animated {
    transition: all var(--booking-transition-spring);
    position: relative;
}

.step-circle-animated.active {
    animation: bounceIn 0.6s ease-out;
}

.step-circle-animated.completed {
    animation: scaleIn 0.4s ease-out;
}

/* Form field animations */
.booking-input-animated {
    transition: all var(--booking-transition-base);
}

.booking-input-animated:focus {
    transform: scale(1.01);
    animation: fadeIn 0.3s ease-out;
}

.booking-input-error {
    animation: shake 0.5s ease-in-out;
}

/* ==========================================================================
   STAGGER ANIMATIONS
   ========================================================================== */

.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================================================
   SCROLL-TRIGGERED ANIMATIONS
   ========================================================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Will-change optimizations */
.will-animate {
    will-change: transform, opacity;
}

.will-animate-complete {
    will-change: auto;
}

/* ==========================================================================
   ACCESSIBILITY CONSIDERATIONS
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    /* Override all animations for users who prefer reduced motion */
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-slide-in-down,
    .animate-scale-in,
    .animate-bounce-in,
    .animate-fade-out,
    .animate-fade-out-up,
    .animate-fade-out-down,
    .animate-slide-out-up,
    .animate-slide-out-down,
    .animate-scale-out,
    .animate-pulse,
    .animate-shake,
    .animate-bounce,
    .animate-heartbeat,
    .animate-shimmer {
        animation: none;
    }
    
    /* Keep essential loading indicators */
    .animate-spin {
        animation: spin 1s linear infinite;
    }
    
    /* Reduce transitions */
    .booking-btn-animated,
    .booking-card-hover,
    .gallery-image-hover,
    .step-circle-animated,
    .booking-input-animated {
        transition: none;
    }
    
    /* Keep focus transitions for accessibility */
    .booking-input-animated:focus,
    .booking-focus-ring:focus-visible {
        transition: box-shadow 0.15s ease-out;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    /* Disable all animations for print */
    * {
        animation: none !important;
        transition: none !important;
    }
}