/**
 * LOADING OVERLAY COMPONENT
 *
 * Fullscreen loading overlay for async operations
 * Prevents user interaction during processing
 *
 * Dependencies: None
 * Usage: window.BookingLoadingOverlay.show('Message')
 */

/* =============================================================================
   OVERLAY CONTAINER
   ============================================================================= */

.booking-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlay-fade-in 0.2s ease;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =============================================================================
   BACKDROP
   ============================================================================= */

.loading-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .loading-overlay-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

/* =============================================================================
   CONTENT CARD
   ============================================================================= */

.loading-overlay-content {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 320px;
    animation: content-scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .loading-overlay-content {
    background: #1f2937;
}

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

/* =============================================================================
   LOADING SPINNER
   ============================================================================= */

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spinner-rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #d4af37;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: rgba(212, 175, 55, 0.6);
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: rgba(212, 175, 55, 0.3);
}

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

/* =============================================================================
   LOADING MESSAGES
   ============================================================================= */

.loading-message {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin: 0;
}

[data-theme="dark"] .loading-message {
    color: #f9fafb;
}

.loading-submessage {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

[data-theme="dark"] .loading-submessage {
    color: #9ca3af;
}

/* =============================================================================
   MOBILE RESPONSIVENESS
   ============================================================================= */

@media (max-width: 576px) {
    .loading-overlay-content {
        min-width: 280px;
        padding: 30px 20px;
        margin: 0 20px;
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
    }

    .loading-message {
        font-size: 1rem;
    }

    .loading-submessage {
        font-size: 0.8125rem;
    }
}

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

.booking-loading-overlay[aria-hidden="true"] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .booking-loading-overlay,
    .loading-overlay-content {
        animation: none;
    }

    .spinner-ring {
        animation: spinner-rotate 2s linear infinite;
    }
}

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

@media print {
    .booking-loading-overlay {
        display: none !important;
    }
}
