/* ====================================== */
/* 🚀 PWA INSTALL BUTTON                  */
/* ====================================== */

.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    background: linear-gradient(135deg, #8B00FF, #FF0064);
    color: white;
    
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    
    box-shadow: 
        0 10px 30px rgba(139, 0, 255, 0.4),
        0 0 20px rgba(255, 0, 100, 0.3);
    
    cursor: pointer;
    
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-btn.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-install-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(139, 0, 255, 0.5),
        0 0 30px rgba(255, 0, 100, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.pwa-install-btn svg {
    width: 20px;
    height: 20px;
}

/* Animação de pulso */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.pwa-install-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50px;
    background: linear-gradient(135deg, #8B00FF, #FF0064);
    opacity: 0.5;
    z-index: -1;
    animation: pulse-ring 2s infinite;
}

/* ====================================== */
/* 📱 STANDALONE MODE ADJUSTMENTS         */
/* ====================================== */

body.pwa-standalone .pwa-install-btn {
    display: none; /* Esconder botão de instalação se já está instalado */
}

/* Safe area para notch/island em dispositivos iOS */
body.pwa-standalone {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ====================================== */
/* 🔔 TOAST COM BOTÕES (UPDATE)           */
/* ====================================== */

.toast-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.toast-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.toast-btn-primary {
    background: linear-gradient(135deg, #8B00FF, #FF0064);
    color: white;
}

.toast-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(139, 0, 255, 0.4);
}

.toast-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ====================================== */
/* 📵 OFFLINE INDICATOR                   */
/* ====================================== */

.offline-indicator {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.95), rgba(255, 0, 0, 0.95));
    color: white;
    
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    
    font-size: 0.875rem;
    font-weight: 600;
    
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
    
    display: none;
    align-items: center;
    gap: 0.5rem;
    
    animation: slideDown 0.4s ease-out;
}

body.offline .offline-indicator {
    display: flex;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ====================================== */
/* 🎯 RESPONSIVE                          */
/* ====================================== */

@media (max-width: 768px) {
    .pwa-install-btn {
        bottom: 80px; /* Acima da navegação mobile */
        right: 15px;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .pwa-install-btn span {
        display: none; /* Mostrar apenas ícone em mobile */
    }
    
    .pwa-install-btn svg {
        margin: 0;
    }
    
    .offline-indicator {
        top: 10px;
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

/* ====================================== */
/* 🌙 DARK MODE SUPPORT                   */
/* ====================================== */

@media (prefers-color-scheme: dark) {
    .toast-btn-secondary {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .toast-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}
