/* ==============================================================================
   SMART PWA BANNER - FRONTEND STYLES
   ============================================================================== */

/* Container Principal do Banner */
#smart-pwa-banner {
    display: none; /* Começa oculto até o JavaScript ativar */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 60px;
    z-index: 9999999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: spb-slide-down 0.3s ease-out;
}

/* Animação de entrada */
@keyframes spb-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animação de saída */
@keyframes spb-slide-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

#smart-pwa-banner.spb-hiding {
    animation: spb-slide-up 0.3s ease-in forwards;
}

/* Lado Esquerdo (Ícone + Texto) */
.spb-info {
    display: flex;
    align-items: center;
    flex: 1;
    padding-right: 10px;
    min-width: 0; /* Permite que o texto seja truncado */
}

.spb-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-right: 10px;
    background-color: #fff;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.spb-text {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Botão de Instalar */
#spb-install-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#spb-install-btn:hover,
#spb-install-btn:focus {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    outline: none;
}

#spb-install-btn:active {
    transform: scale(0.95);
}

/* Botão Fechar (X) */
#spb-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 5px;
    line-height: 1;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

#spb-close-btn:hover,
#spb-close-btn:focus {
    opacity: 1;
    outline: none;
}

/* Ajuste para quando a barra de administração do WordPress estiver visível */
body.admin-bar #smart-pwa-banner {
    top: 32px;
}

/* Responsividade */
@media screen and (max-width: 782px) {
    body.admin-bar #smart-pwa-banner {
        top: 46px;
    }
}

@media screen and (max-width: 480px) {
    #smart-pwa-banner {
        padding: 8px 10px;
    }
    
    .spb-icon {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    .spb-text {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    #spb-install-btn {
        padding: 5px 12px;
        font-size: 10px;
    }
    
    #spb-close-btn {
        font-size: 20px;
        margin-left: 5px;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    #smart-pwa-banner {
        animation: none;
    }
    
    #spb-install-btn:hover {
        transform: none;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    #smart-pwa-banner {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #spb-install-btn {
        border-width: 2px;
    }
}
