/**
 * Price Refresh Styles
 * 
 * Styles for real-time price updates, highlighting, and indicators
 */

/* Price display base styling */
.price, .fare, .total-price, [data-price], 
.flight-price, .total-amount, [data-booking-price],
.order-total, .payment-amount, [data-payment-price] {
    transition: all 0.3s ease-in-out;
}

/* Price increase indicator (red) */
.price-increased, 
.fare-increased,
.total-price-increased {
    color: #d32f2f !important;
    font-weight: 600;
    animation: pulse-red 0.5s ease-out;
}

/* Price decrease indicator (green) */
.price-decreased,
.fare-decreased, 
.total-price-decreased {
    color: #388e3c !important;
    font-weight: 600;
    animation: pulse-green 0.5s ease-out;
}

/* Price updating indicator */
.price-updating,
.fare-updating {
    opacity: 0.7;
    animation: updating-blink 0.8s infinite;
}

/* Pulse animation for price increase */
@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(211, 47, 47, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

/* Pulse animation for price decrease */
@keyframes pulse-green {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(56, 142, 60, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(56, 142, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(56, 142, 60, 0);
    }
}

/* Blink animation for updating state */
@keyframes updating-blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0.5;
    }
}

/* Updating indicator badge */
.price-updating-indicator {
    display: inline-block;
    font-size: 0.75em;
    color: #ff9800;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: #fff3e0;
    margin-left: 5px;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Price container with highlight border */
.price-updated {
    border-left: 3px solid #2196f3;
    padding-left: 8px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .price-updating-indicator {
        display: none; /* Hide on mobile for cleaner UI */
    }

    .price-increased, .price-decreased {
        animation: none; /* Simplify animations on mobile */
    }
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .price-increased, 
    .price-decreased,
    .price-updating,
    .price-updating-indicator {
        animation: none !important;
    }

    .price,
    .fare,
    .total-price {
        transition: none !important;
    }
}

/* Loading spinner for price refresh (optional) */
.price-refresh-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
