/* PWA Loader Styles */
.pwa-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-loader.hide {
    opacity: 0;
    visibility: hidden;
}

.pwa-loader-content {
    text-align: center;
}

.pwa-loader-content p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

/* Spinner Loader */
.pwa-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Dots Loader */
.pwa-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.pwa-dots div {
    width: 15px;
    height: 15px;
    background-color: #000;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.pwa-dots div:nth-child(1) {
    animation-delay: -0.32s;
}

.pwa-dots div:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress Bar Loader */
.pwa-progress {
    width: 200px;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.pwa-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #000;
    animation: progress 2s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 75%;
        margin-left: 0%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Pulse Loader */
.pwa-pulse {
    width: 60px;
    height: 60px;
    background-color: #000;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    margin: 0 auto;
}

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

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .pwa-loader {
        background: rgba(30, 30, 30, 0.98);
    }
    
    .pwa-loader-content p {
        color: #ffffff;
    }
    
    .pwa-spinner {
        border-color: #333;
    }
    
    .pwa-progress {
        background: #333;
    }
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
    .pwa-spinner,
    .pwa-pulse {
        width: 50px;
        height: 50px;
    }
    
    .pwa-progress {
        width: 150px;
    }
    
    .pwa-loader-content p {
        font-size: 14px;
    }
}