/**
 * PWA Styles
 * Styles for Progressive Web App features
 */

/* PWA Install Banner */
#pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    max-width: 500px;
    width: 90%;
}

#pwa-install-banner .pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

#pwa-install-banner .pwa-icon {
    font-size: 40px;
}

#pwa-install-banner .pwa-text {
    flex: 1;
}

#pwa-install-banner h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

#pwa-install-banner p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

#pwa-install-banner .pwa-buttons {
    display: flex;
    gap: 10px;
}

#pwa-install-button,
.pwa-install-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#pwa-install-button:hover,
.pwa-install-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.pwa-dismiss {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-dismiss:hover {
    background: #f5f5f5;
}

/* PWA Installed State */
body.pwa-installed .pwa-only-browser {
    display: none !important;
}

body:not(.pwa-installed) .pwa-only-installed {
    display: none !important;
}

/* Notification Permission Banner */
.pwa-notify-banner {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.pwa-notify-banner h4 {
    margin: 0 0 10px 0;
    color: #333;
}

#pwa-notify-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    z-index: 10000;
    display: none;
}

body.is-offline .offline-indicator {
    display: block;
}

/* Loading Skeleton (for offline mode) */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* PWA Splash Screen Styles */
@media (display-mode: standalone) {
    /* Hide browser chrome elements when in PWA mode */
    .browser-only {
        display: none !important;
    }
    
    /* Add safe area for notched devices */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* iOS PWA Status Bar */
@supports (-webkit-touch-callout: none) {
    body.pwa-installed {
        padding-top: 20px; /* iOS status bar */
    }
}
