/* ========================================
   PWA INSTALL BUTTON - Botón flotante
   ======================================== */

/* Botón de instalación flotante */
.pwa-install-button {
    position: fixed;
    bottom: 90px; /* Por encima de la navegación inferior */
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9998;
    display: none; /* Oculto por defecto */
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: pwa-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pwa-install-button.visible {
    display: flex;
}

.pwa-install-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5),
                0 6px 16px rgba(0, 0, 0, 0.3);
}

.pwa-install-button:active {
    transform: translateY(-2px) scale(1.02);
}

.pwa-install-button-icon {
    font-size: 20px;
    animation: pwa-icon-pulse 2s ease-in-out infinite;
}

@keyframes pwa-icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.pwa-install-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.pwa-install-button-title {
    font-size: 15px;
    font-weight: 700;
}

.pwa-install-button-subtitle {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
}

@keyframes pwa-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.5);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Botón compacto en móvil pequeño */
@media (max-width: 480px) {
    .pwa-install-button {
        bottom: 80px;
        right: 16px;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .pwa-install-button-icon {
        font-size: 18px;
    }
    
    .pwa-install-button-title {
        font-size: 14px;
    }
    
    .pwa-install-button-subtitle {
        font-size: 10px;
    }
}

/* Versión compacta (solo icono) */
.pwa-install-button.compact {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.pwa-install-button.compact .pwa-install-button-text {
    display: none;
}

.pwa-install-button.compact .pwa-install-button-icon {
    font-size: 24px;
}

/* Banner alternativo (opcional) */
.pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: pwa-slide-down 0.4s ease-out;
}

.pwa-install-banner.visible {
    display: flex;
}

@keyframes pwa-slide-down {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.pwa-install-banner-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-banner-icon {
    font-size: 28px;
}

.pwa-install-banner-text {
    flex: 1;
}

.pwa-install-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.pwa-install-banner-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.pwa-install-banner-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-banner-btn {
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 8px;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-banner-btn:hover {
    background: white;
    color: #667eea;
}

.pwa-install-banner-btn.primary {
    background: white;
    color: #667eea;
}

.pwa-install-banner-btn.primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Responsive banner */
@media (max-width: 600px) {
    .pwa-install-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 12px 16px;
    }
    
    .pwa-install-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-install-banner-actions {
        width: 100%;
    }
    
    .pwa-install-banner-btn {
        flex: 1;
    }
}

/* Indicador de instalación exitosa */
.pwa-install-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-install-success.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.pwa-install-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pwa-success-bounce 0.6s ease-out;
}

@keyframes pwa-success-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.pwa-install-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.pwa-install-success-message {
    font-size: 15px;
    color: #666;
}

/* Animación de spin para loading */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
