/* Loading Screen Styles for PWA Native Experience */

/* Loading Overlay */
#pwa-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#pwa-loading-screen.show {
    opacity: 1;
    visibility: visible;
}

/* Loading Animation Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* App Logo/Icon */
.loading-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: logoFloat 2s ease-in-out infinite;
}

/* Floating animation for logo */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Loading Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading Text */
.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
    opacity: 0.9;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

/* Progress Bar */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    border-radius: 2px;
    animation: progressMove 2s ease-in-out infinite;
    width: 0%;
}

@keyframes progressMove {
    0% {
        width: 0%;
        transform: translateX(-100%);
    }
    50% {
        width: 100%;
        transform: translateX(0%);
    }
    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* Dots Animation */
.loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

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

/* Page Transition Effects */
.page-transition-fade {
    transition: opacity 0.3s ease;
}

.page-transition-fade.loading {
    opacity: 0.7;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .loading-logo {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-progress {
        width: 150px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #pwa-loading-screen {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .loading-logo,
    .loading-text,
    .dot {
        animation: none;
    }
    
    .spinner-circle {
        animation: spin 3s linear infinite;
    }
    
    .progress-bar {
        animation: progressMove 4s ease-in-out infinite;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #pwa-loading-screen {
        background: #000;
    }
    
    .loading-logo {
        background: #fff;
        color: #000;
        border: 2px solid #fff;
    }
    
    .spinner-circle {
        border-color: rgba(255, 255, 255, 0.3);
        border-top-color: #fff;
    }
}