/* PWA install banner */
#pwa-install-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: auto;
    z-index: 9999;
    display: none;
    width: 430px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    color: #172026;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
    animation: pwaBentoIn 0.28s ease-out;
}

@keyframes pwaBentoIn {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#pwa-install-banner .pwa-banner-content {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 10px;
}

#pwa-install-banner .pwa-banner-icon-box {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #f8fafc;
}

#pwa-install-banner .pwa-banner-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

#pwa-install-banner .pwa-banner-text {
    min-width: 0;
}

#pwa-install-banner .pwa-banner-text h4 {
    margin: 0 0 3px 0;
    color: #101828;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

#pwa-install-banner .pwa-banner-text p {
    margin: 0;
    color: #667085;
    font-size: 12.5px;
    line-height: 1.35;
}

#pwa-install-banner .pwa-banner-mini {
    display: grid;
    align-content: center;
    min-height: 52px;
    padding: 8px;
    border: 1px solid rgba(246, 178, 31, 0.28);
    border-radius: 12px;
    background: #fff7e6;
    text-align: center;
}

#pwa-install-banner .pwa-banner-mini span {
    color: #946200;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

#pwa-install-banner .pwa-banner-mini strong {
    margin-top: 4px;
    color: #172026;
    font-size: 12px;
    line-height: 1;
}

#pwa-install-banner .pwa-banner-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#pwa-install-banner .pwa-banner-btn {
    min-height: 38px;
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#pwa-install-banner .pwa-banner-btn-primary {
    flex: 1.2;
    color: #ffffff;
    background: #172026;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

#pwa-install-banner .pwa-banner-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
}

#pwa-install-banner .pwa-banner-btn-secondary {
    flex: 1;
    color: #344054;
    background: #f2f4f7;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

#pwa-install-banner .pwa-banner-btn-secondary:hover {
    background: #e4e7ec;
}

#pwa-install-banner .pwa-banner-close {
    position: absolute;
    top: -10px;
    right: -10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #475467;
    background: #ffffff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
    cursor: pointer;
    opacity: 1;
    line-height: 1;
}

#pwa-install-banner .pwa-banner-close:hover {
    color: #101828;
}

/* Floating install button */
#pwa-install-btn {
    position: fixed;
    right: 18px;
    bottom: 92px;
    z-index: 9998;
    display: none;
    width: 54px;
    height: 54px;
    padding: 0;
    color: #172026;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

#pwa-install-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

#pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
}

@media (max-width: 768px) {
    #pwa-install-banner {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
        max-width: none;
        padding: 10px;
    }

    #pwa-install-banner .pwa-banner-content {
        grid-template-columns: 48px minmax(0, 1fr);
        text-align: left;
    }

    #pwa-install-banner .pwa-banner-icon-box {
        width: 48px;
        height: 48px;
    }

    #pwa-install-banner .pwa-banner-mini {
        display: none;
    }

    #pwa-install-banner .pwa-banner-text h4 {
        font-size: 14px;
    }

    #pwa-install-banner .pwa-banner-text p {
        font-size: 12px;
    }

    #pwa-install-banner .pwa-banner-btn {
        flex: 1;
        padding: 8px 10px;
        font-size: 12px;
    }

    #pwa-install-btn {
        right: 14px;
        bottom: 76px;
        width: 50px;
        height: 50px;
    }
}

/* PWA settings page */
.pwa-settings-page {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
}

.pwa-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.pwa-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 24px;
}

.pwa-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.pwa-feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.pwa-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pwa-feature-list li:last-child {
    border-bottom: none;
}

.pwa-feature-icon {
    font-size: 24px;
}

.pwa-btn {
    padding: 15px 40px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pwa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.pwa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pwa-status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
}

.pwa-status-badge.active {
    background: #4caf50;
    color: white;
}

.pwa-status-badge.inactive {
    background: #f44336;
    color: white;
}

.pwa-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.pwa-toggle-switch input {
    width: 0;
    height: 0;
    opacity: 0;
}

.pwa-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 34px;
    cursor: pointer;
    transition: 0.4s;
}

.pwa-toggle-slider:before {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    content: "";
    transition: 0.4s;
}

input:checked + .pwa-toggle-slider {
    background-color: #667eea;
}

input:checked + .pwa-toggle-slider:before {
    transform: translateX(26px);
}
