/* ==========================================================================
   GBook Ultra-Modern PWA Install Banner & Modal Styles
   ========================================================================== */

.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: calc(100% - 32px);
    max-width: 400px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
    transform: translateY(140%) scale(0.95);
    pointer-events: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pwa-install-banner.pwa-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Dark theme support */
html[data-theme="dark"] .pwa-install-banner {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pwa-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.pwa-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
    display: block;
    background: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
}

.pwa-content {
    flex: 1;
    min-width: 0;
}

.pwa-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-theme="dark"] .pwa-title {
    color: #f8fafc;
}

.pwa-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 4px;
}

html[data-theme="dark"] .pwa-subtitle {
    color: #94a3b8;
}

.pwa-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    padding: 9px 15px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-close-btn {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    border: none;
    border-radius: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

html[data-theme="dark"] .pwa-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.pwa-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Mobile responsive bottom sheet */
@media (max-width: 640px) {
    .pwa-install-banner {
        left: 12px;
        right: 12px;
        bottom: 76px; /* Raised above bottom navigation bar */
        width: auto;
        max-width: none;
        padding: 14px 16px;
        border-radius: 18px;
    }
}
