/* assets/css/pwa.css - Estilos para PWA e Botões de Instalação */

/* Botão Flutuante de Instalação */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    background: #1f2937;
    color: #ffffff;
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 102, 0.15);
    max-width: 380px;
    width: calc(100vw - 40px);
    animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.pwa-install-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install-desc {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.3;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-btn-install {
    background: #00ff66;
    color: #111827;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pwa-btn-install:hover {
    background: #00dd55;
    transform: scale(1.02);
}

.pwa-btn-close {
    background: transparent;
    color: #9ca3af;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.pwa-btn-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal de Instruções do iOS (iPhone / iPad) */
.pwa-ios-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.pwa-ios-modal.ativo {
    display: flex;
}

.pwa-ios-content {
    background: #1f2937;
    color: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    animation: pwaModalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes pwaModalSlide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.pwa-ios-header img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.pwa-ios-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.pwa-ios-header p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #9ca3af;
}

.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 22px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #d1d5db;
}

.pwa-step-num {
    background: #00ff66;
    color: #111827;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step-icon {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    font-weight: 600;
    color: #ffffff;
}

.pwa-ios-btn-close {
    width: 100%;
    background: #00ff66;
    color: #111827;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
}

/* Ajuste Mobile */
@media (max-width: 600px) {
    .pwa-install-banner {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* ==================== PWA NATIVE SPLASH SCREEN & UPDATE SYSTEM ==================== */
.pwa-splash-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #0f172a;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pwa-splash-overlay.pwa-splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pwa-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 24px;
    max-width: 360px;
    width: 90%;
}

.pwa-splash-icon-box {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: #1e293b;
    border: 2px solid rgba(0, 255, 102, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 255, 102, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 18px;
    animation: pwaPulseIcon 2s ease-in-out infinite;
}

.pwa-splash-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes pwaPulseIcon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0, 255, 102, 0.15);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 14px 35px rgba(0,0,0,0.6), 0 0 35px rgba(0, 255, 102, 0.35);
    }
}

.pwa-splash-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.pwa-splash-progress-track {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 10px auto;
    position: relative;
}

.pwa-splash-progress-bar {
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, #00ff66, #10b981);
    border-radius: 999px;
    position: absolute;
    animation: pwaLoadingIndeterminate 1.4s ease-in-out infinite;
}

@keyframes pwaLoadingIndeterminate {
    0% {
        left: -45%;
    }
    100% {
        left: 100%;
    }
}

.pwa-splash-status {
    color: #94a3b8;
    font-size: 0.82rem;
    margin: 0;
}

/* Caixa de Atualização na Splash */
.pwa-splash-update-title {
    color: #00ff66;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.pwa-splash-update-desc {
    color: #cbd5e1;
    font-size: 0.85rem;
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.pwa-splash-update-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-splash-update {
    background: #00ff66;
    color: #0f172a;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(0, 255, 102, 0.3);
}

.btn-splash-update:hover {
    background: #00dd55;
    transform: scale(1.02);
}

.btn-splash-dismiss {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-splash-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Toast Flutuante de Atualização em Background (Para quem já está navegando) */
.pwa-update-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    opacity: 0;
    background: #1e293b;
    border: 1px solid #10b981;
    color: #ffffff;
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(16, 185, 129, 0.2);
    z-index: 99999;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.pwa-update-toast.ativo {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-update-toast-btn {
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.pwa-update-toast-btn:hover {
    background: #059669;
}

.pwa-update-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

