/* PWA Install Banner - Always Visible Until Installed */
#pwaInstallBanner {
    position: fixed;
    bottom: -120px;
    left: 0;
    right: 0;
    z-index: 10002;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-top: 2px solid rgba(59,130,246,0.4);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#pwaInstallBanner.visible {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 700px;
    margin: 0 auto;
}

.pwa-install-icon {
    flex-shrink: 0;
}
.pwa-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.pwa-install-text strong {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.pwa-install-text span {
    color: #94a3b8;
    font-size: 12px;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.5);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-dismiss-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pwa-dismiss-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    border-color: rgba(255,255,255,0.2);
}

/* Instructions Modal */
.pwa-instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.pwa-instructions-overlay.visible {
    opacity: 1;
}
.pwa-instructions-modal {
    background: #1e293b;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pwa-instructions-overlay.visible .pwa-instructions-modal {
    transform: scale(1);
}

.pwa-instructions-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pwa-instructions-header h3 {
    flex: 1;
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}
.pwa-instructions-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.pwa-instructions-close:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.pwa-instructions-body {
    padding: 20px 24px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
}
.pwa-instructions-body ol {
    margin: 12px 0 0 0;
    padding-left: 20px;
}
.pwa-instructions-body li {
    margin-bottom: 10px;
}
.pwa-instructions-body strong {
    color: #fff;
}

.pwa-instructions-footer {
    padding: 16px 24px 20px;
    text-align: center;
}
.pwa-instructions-footer .pwa-install-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

/* Update Toast */
.pwa-update-toast {
    position: fixed;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10003;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    padding: 12px 24px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}
.pwa-update-toast.visible {
    top: 20px;
}
.pwa-update-toast button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 6px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}
.pwa-update-toast button:hover {
    background: rgba(255,255,255,0.3);
}

/* Standalone mode adjustments */
.pwa-standalone .header {
    padding-top: env(safe-area-inset-top, 0px);
}
.pwa-standalone .sidebar {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #pwaInstallBanner {
        padding: 12px 16px;
    }
    .pwa-install-content {
        gap: 10px;
    }
    .pwa-app-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    .pwa-install-text strong {
        font-size: 13px;
    }
    .pwa-install-text span {
        font-size: 11px;
    }
    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Desktop - extra padding for banner on main content */
@media (min-width: 769px) {
    .pwa-install-content {
        padding: 0 20px;
    }
}
