/* WhatsApp Form Button - Estilos
 * Força estilos do plugin para não sofrer com CSS global do tema
 */

/* Container principal do botão flutuante */
.wfb-floating-container {
    position: fixed !important;
    z-index: 9999 !important;
    transition: all 0.3s ease !important;
}

/* Posições do botão */
.wfb-floating-container.bottom-right {
    bottom: 24px !important;
    right: 24px !important;
}

.wfb-floating-container.bottom-left {
    bottom: 24px !important;
    left: 24px !important;
}

.wfb-floating-container.top-right {
    top: 24px !important;
    right: 24px !important;
}

.wfb-floating-container.top-left {
    top: 24px !important;
    left: 24px !important;
}

/* Formulário popup */
.wfb-form-popup {
    position: absolute !important;
    width: 90vw !important;
    max-width: 350px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    padding: 24px !important;
    margin-bottom: 8px !important;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.wfb-form-popup.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Posicionamento do popup baseado na posição do botão */
.wfb-floating-container.bottom-right .wfb-form-popup,
.wfb-floating-container.bottom-left .wfb-form-popup {
    bottom: 40px !important;
    /* Mantém espaço visível do topo e do rodapé */
    max-height: calc(100vh - 180px) !important;
    overflow-y: auto !important;
}

.wfb-floating-container.top-right .wfb-form-popup,
.wfb-floating-container.top-left .wfb-form-popup {
    top: 80px !important;
    max-height: calc(100vh - 180px) !important;
    overflow-y: auto !important;
}

.wfb-floating-container.bottom-right .wfb-form-popup,
.wfb-floating-container.top-right .wfb-form-popup {
    right: 0 !important;
}

.wfb-floating-container.bottom-left .wfb-form-popup,
.wfb-floating-container.top-left .wfb-form-popup {
    left: 0 !important;
}

/* Header do formulário */
.wfb-form-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 16px !important;
}

.wfb-form-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 0 !important;
}

.wfb-close-btn {
    background: none !important;
    border: none !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s !important;
}

.wfb-close-btn:hover {
    color: #4b5563 !important;
}

.wfb-close-btn svg {
    width: 20px !important;
    height: 20px !important;
}

/* Campos do formulário */
.wfb-form-group {
    margin-bottom: 16px !important;
}

.wfb-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
}

.wfb-input {
    width: 100% !important;
    height: 40px !important;
    padding: 8px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.wfb-input:focus {
    outline: none !important;
    border-color: transparent !important;
    box-shadow: 0 0 0 2px hsl(222.2, 84%, 4.9%),
        0 0 0 4px hsl(0, 0%, 100%) !important;
}

/* Grid de categorias */
.wfb-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.wfb-category-btn {
    padding: 12px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: center !important;
    color: #111827 !important;
}

.wfb-category-btn:hover {
    border-color: #86efac !important;
    transform: scale(1.05) !important;
}

.wfb-category-btn.active {
    border-color: #22c55e !important;
    background: #f0fdf4 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}

.wfb-category-emoji {
    font-size: 32px !important;
    margin-bottom: 4px !important;
}

.wfb-category-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

/* Botão de enviar */
.wfb-submit-btn {
    width: 100% !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
    background: #16a34a !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wfb-submit-btn:hover:not(:disabled) {
    background: #15803d !important;
}

.wfb-submit-btn:disabled {
    background: #16a34a !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
}

.wfb-submit-btn svg {
    width: 20px !important;
    height: 20px !important;
}

/* Botão flutuante do WhatsApp */
.wfb-whatsapp-btn {
    position: relative !important;
    width: 64px !important;
    height: 64px !important;
    background: #25d366 !important;
    border: none !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wfb-whatsapp-btn:hover {
    background: #20ba5a !important;
    transform: scale(1.1) !important;
}

.wfb-whatsapp-btn:active {
    transform: scale(0.95) !important;
}

.wfb-whatsapp-btn svg {
    width: 36px !important;
    height: 36px !important;
    color: #ffffff !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Efeito de pulse ring */
.wfb-pulse-ring {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 50% !important;
    background: #25d366 !important;
    opacity: 0.75 !important;
    animation: wfb-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite !important;
}

/* Animação de shake */
.wfb-whatsapp-btn.shake {
    animation: wfb-shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
    animation-iteration-count: 3 !important;
}

/* Animações */
@keyframes wfb-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

@keyframes wfb-ping {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Overlay (não usado no momento, mas mantido para compatibilidade) */
.wfb-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.3) !important;
    z-index: 9998 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wfb-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Responsividade */
@media (max-width: 768px) {
    .wfb-form-popup {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        bottom: 90px !important;
        top: auto !important;
        max-height: calc(100vh - 130px) !important;
    }

    .wfb-floating-container.bottom-right,
    .wfb-floating-container.bottom-left {
        bottom: 16px !important;
    }

    .wfb-floating-container.bottom-right {
        right: 16px !important;
    }

    .wfb-floating-container.bottom-left {
        left: 16px !important;
    }
}

/* Desabilitar animações se o usuário preferir movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .wfb-whatsapp-btn.shake,
    .wfb-pulse-ring {
        animation: none !important;
    }
}
