/* PWA Global Loading Indicator */
.pwa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media all and (display-mode: standalone) {
    .pwa-loading-overlay {
        display: flex;
        opacity: 1;
    }
}

.pwa-loading-overlay.active {
    display: flex;
    opacity: 1;
}

.pwa-loading-overlay.pwa-hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none;
}

.pwa-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.pwa-loading-logo {
    width: 80px;
    height: auto;
    animation: pulse 2s ease-in-out infinite;
}

.pwa-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E5E7EB;
    border-top: 4px solid #2397E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pwa-loading-text {
    color: #2397E5;
    font-size: 16px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pwa-loading-dots {
    display: inline-flex;
    gap: 4px;
}

.pwa-loading-dots span {
    width: 6px;
    height: 6px;
    background: #2397E5;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.pwa-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.pwa-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-loading-overlay {
        background: rgba(17, 24, 39, 0.95);
    }

    .pwa-loading-text {
        color: #3DADEA;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pwa-loading-logo {
        width: 60px;
    }

    .pwa-loading-spinner {
        width: 40px;
        height: 40px;
    }

    .pwa-loading-text {
        font-size: 14px;
    }
}