/* PWA Install Button and Popup Styles */
.pwa-install-widget {
    position: fixed;
    bottom: 80px; /* Above accessibility widget */
    right: 20px;
    z-index: 2147483645;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.pwa-install-button {
    width: 46px;
    height: 46px;
    background: #5865f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    border: none;
    color: white;
    position: relative;
}

.pwa-install-button:hover {
    background: #4752c4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pwa-install-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Install Popup */
.pwa-install-popup {
    position: fixed;
    bottom: 140px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    width: 380px;
    max-height: 600px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.pwa-install-popup.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup Header */
.pwa-install-header {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pwa-install-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.pwa-install-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.pwa-install-close:hover {
    transform: scale(1.1);
}

/* Popup Content */
.pwa-install-content {
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
}

.pwa-app-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fb;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pwa-app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #fa9200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-app-icon img {
    width: 40px;
    height: 40px;
}

.pwa-app-details {
    flex: 1;
}

.pwa-app-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.pwa-app-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* Features Section */
.pwa-features {
    margin-bottom: 20px;
}

.pwa-features-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pwa-feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fb;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.pwa-feature-item:hover {
    background: #e9ecef;
}

.pwa-feature-icon {
    width: 32px;
    height: 32px;
    background: #5865f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 16px;
}

.pwa-feature-text {
    flex: 1;
}

.pwa-feature-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.pwa-feature-desc {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Install Instructions */
.pwa-instructions {
    padding: 16px;
    background: #e3f2fd;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pwa-instructions-title {
    font-size: 13px;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 8px;
}

.pwa-instructions-text {
    font-size: 12px;
    color: #1565c0;
    line-height: 1.5;
}

/* Install Button */
.pwa-install-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.pwa-install-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Platform-specific styles */
.pwa-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f0f3f7;
    border-radius: 6px;
    font-size: 11px;
    color: #4a5568;
    margin-top: 8px;
}

/* Hide on desktop if not installable */
.pwa-install-widget.hide-desktop {
    display: none;
}

@media (display-mode: standalone) {
    .pwa-install-widget {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-install-widget {
        bottom: 70px;
        right: 10px;
    }
    
    .pwa-install-button {
        width: 40px;
        height: 40px;
    }
    
    .pwa-install-button svg {
        width: 20px;
        height: 20px;
    }
    
    .pwa-install-popup {
        bottom: 120px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 380px;
    }
}

/* Animation for pulse effect */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(88, 101, 242, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0);
    }
}

.pwa-install-button.pulse {
    animation: pulse 2s infinite;
}