/* animations.css - Animations og loading states */

/* Loading and error states styling */
.flight-loading, .flight-error {
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.flight-error {
    color: #dc3545;
    background: #f8d7da;
}

.flight-sync-status {
    background: #cff4fc;
    color: #055160;
    padding: 12px;
    text-align: center;
    margin: 15px 0;
    border-radius: 5px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out;
}

.destination-progress {
    background: #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.flight-polling {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    text-align: center;
    margin: 15px 0;
    border-radius: 5px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

/* Date selector animations */
.date-selector.selected .date-label {
    animation: labelPulse 0.6s ease-out;
}

@keyframes labelPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Package selection animations */
.package-option {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

.package-option:hover {
    animation: packageHover 0.3s ease-out;
}

@keyframes packageHover {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(-3px); }
}

/* Traveler selection animations */
.traveler-option {
    transition: all 0.3s ease;
}

.traveler-option:hover {
    animation: travelerBounce 0.3s ease-out;
}

@keyframes travelerBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.1); }
}

/* Button animations */
.next-step{
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.next-step:hover:not(.disabled) {
    animation: buttonGlow 0.3s ease-out;
}

@keyframes buttonGlow {
    0% { box-shadow: 0 0 0 rgba(8, 96, 95, 0.4); }
    50% { box-shadow: 0 0 20px rgba(8, 96, 95, 0.6); }
    100% { box-shadow: 0 0 10px rgba(8, 96, 95, 0.4); }
}

/* Loading spinner animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #08605F;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ticket selection animations */
.ticket-option {
    transition: all 0.3s ease;
}




/* Checkbox animation */
.selection-checkbox .checkbox-visual {
    transition: all 0.2s ease;
}

.selection-checkbox .checkbox-visual.selection-confirmed {
    animation: confirmPulse 0.3s ease-out;
}

@keyframes confirmPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Flight selection animations */
.flight-option {
    transition: all 0.2s ease;
}

.flight-option:hover {
    animation: flightHover 0.3s ease-out;
}

@keyframes flightHover {
    0% { 
        transform: translateY(0);
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
    }
    100% { 
        transform: translateY(-2px);
        border-left: 4px solid #08605F;
        border-right: 4px solid #08605F;
    }
}

/* Sticky cart animations */
.booking-summary-card {
    transition: all 0.3s ease;
    animation: slideUpFromBottom 0.5s ease-out;
}

@keyframes slideUpFromBottom {
    0% { 
        transform: translateY(100%);
        opacity: 0;
    }
    100% { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Price update animation */
.price-amount {
    transition: all 0.3s ease;
}

.price-amount.updating {
    animation: priceFlash 0.5s ease-out;
}

@keyframes priceFlash {
    0% { color: #ffffff; }
    50% { color: #ffc107; }
    100% { color: #ffffff; }
}

/* Progress bar animation */
.progress-step {
    transition: all 0.3s ease;
}

.progress-step.active {
    animation: progressActive 0.5s ease-out;
}

@keyframes progressActive {
    0% { 
        background: #ffffff;
        color: #333333;
    }
    100% { 
        background: #08605F;
        color: #ffffff;
    }
}

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

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

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

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

/* Slide in animations */
.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    0% { 
        opacity: 0;
        transform: translateX(-20px);
    }
    100% { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for loading states */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}



@keyframes imageLoad {
    0% { 
        opacity: 0;
        transform: scale(0.95);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Error shake animation */
.error-shake {
    animation: shake 0.5s ease-out;
}

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

/* Success bounce animation */
.success-bounce {
    animation: bounce 0.6s ease-out;
}

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

/* Micro-interactions */
.micro-bounce {
    animation: microBounce 0.2s ease-out;
}

@keyframes microBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Form field focus animation */
.form-field input:focus,
.form-field select:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% { 
        border-color: #ddd;
        box-shadow: 0 0 0 rgba(8, 96, 95, 0);
    }
    100% { 
        border-color: #08605F;
        box-shadow: 0 0 8px rgba(8, 96, 95, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .booking-summary-card,
    .package-option,
    .traveler-option,
    .flight-option,
    .ticket-option {
        transition: none !important;
        animation: none !important;
    }
}