/* PWA Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: logoFloat 2s ease-in-out infinite;
}

.splash-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.splash-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    animation: titleSlide 0.8s ease-out;
}

.splash-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 40px;
    text-align: center;
    animation: subtitleSlide 0.8s ease-out 0.2s both;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

.splash-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: center;
    animation: statusFade 0.5s ease-out 0.5s both;
}

/* Animations */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes titleSlide {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes subtitleSlide {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes statusFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PWA Install Prompt Styles */
.pwa-install-prompt {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    background: white !important;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    z-index: 99999 !important;
    opacity: 0;
    transition: all 0.3s ease-out;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
}

.pwa-install-prompt::before {
    content: '';
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: -1 !important;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    backdrop-filter: blur(4px);
}

.pwa-install-prompt.show::before {
    opacity: 1;
}

.pwa-install-prompt.show {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1;
}

.pwa-install-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1;
}

.pwa-install-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Ensure popup is always on top */
.pwa-install-prompt,
.pwa-install-prompt * {
    position: relative !important;
    z-index: 100000 !important;
}

/* Override any conflicting styles */
.pwa-install-prompt {
    display: block !important;
    visibility: visible !important;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: #1d4ed8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-install-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.pwa-install-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.pwa-install-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.pwa-install-btn.primary {
    background: #1d4ed8;
    color: white;
}

.pwa-install-btn.primary:hover {
    background: #1e40af;
}

.pwa-install-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.pwa-install-btn.secondary:hover {
    background: #e5e7eb;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .splash-logo {
        width: 100px;
        height: 100px;
        border-radius: 20px;
    }
    
    .splash-logo img {
        width: 70px;
        height: 70px;
    }
    
    .splash-title {
        font-size: 28px;
    }
    
    .splash-subtitle {
        font-size: 14px;
    }
    
    .pwa-install-prompt {
        width: 95%;
        max-width: 350px;
        padding: 20px;
        border-radius: 12px;
    }
    
    .pwa-install-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .pwa-install-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .pwa-install-btn {
        width: 100%;
        padding: 12px 16px;
    }
}
