/* PWA Styles */

/* Install Banner */
#pwa-install-banner {
    position: fixed;
    bottom: 70px;
    left: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff8d2f 0%, #ff6b2f 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(255, 141, 47, 0.3);
    display: none;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#pwa-install-banner.slide-in {
    display: block;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-banner-icon i {
    font-size: 24px;
    color: #ff8d2f;
}

.install-banner-text h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.install-banner-text p {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.install-banner-actions {
    display: flex;
    gap: 10px;
}

.install-banner-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-install-now {
    background: white;
    color: #ff8d2f;
}

.btn-install-later {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Install Button in Nav */
#pwa-install-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #28a745 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#pwa-install-btn i {
    font-size: 16px;
}

/* Update Notification */
#pwa-update-notification {
    position: fixed;
    top: 20px;
    left: 15px;
    right: 15px;
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.update-banner {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(23, 162, 184, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.update-content i {
    font-size: 20px;
}

.update-btn {
    background: white;
    color: #17a2b8;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-btn:active {
    transform: scale(0.95);
}

/* Toast Notifications */
.pwa-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #212529;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.pwa-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-toast-success {
    background: #28a745;
}

.pwa-toast-warning {
    background: #ffc107;
    color: #212529;
}

.pwa-toast-error {
    background: #dc3545;
}

.pwa-toast-info {
    background: #17a2b8;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    z-index: 10002;
    display: none;
}

.offline-indicator.show {
    display: block;
}

/* PWA Standalone Mode Adjustments */
@media all and (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Add safe area padding for notched devices */
    .pwa-safe-area {
        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);
    }
}

/* Loading Skeleton for PWA */
.pwa-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
