/**
 * WhatsApp Float Button - Styles
 * Version: 1.0.0
 */

/* Reset e configurações base */
#wfa-button,
#wfa-modal * {
    box-sizing: border-box;
}

/* Botão flutuante principal */
.wfa-button {
    position: fixed;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 999999;
    animation: wfa-pulse 2s infinite;
    border: none;
    font-family: inherit;
}

/* Posicionamento do botão */
.wfa-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wfa-bottom-left {
    bottom: 20px;
    left: 20px;
}

.wfa-top-right {
    top: 20px;
    right: 20px;
}

.wfa-top-left {
    top: 20px;
    left: 20px;
}

/* Hover do botão */
.wfa-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Ícone do WhatsApp */
.wfa-button svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: transform 0.3s ease;
}

.wfa-button:hover svg {
    transform: scale(1.1);
}

/* Texto do botão (opcional) */
.wfa-button-text {
    position: absolute;
    right: 70px;
    background: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.wfa-button:hover .wfa-button-text {
    opacity: 1;
    transform: translateX(0);
}

/* Animação de pulso */
@keyframes wfa-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Modal overlay */
.wfa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    animation: wfa-fadeIn 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wfa-modal.wfa-active {
    display: flex;
}

/* Animação de entrada do modal */
@keyframes wfa-fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

/* Conteúdo do modal */
.wfa-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: wfa-slideUp 0.3s ease;
    margin: 20px;
}

/* Animação de slide up */
@keyframes wfa-slideUp {
    from { 
        transform: translateY(50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cabeçalho do modal */
.wfa-modal-header {
    background: #25D366;
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wfa-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botão de fechar */
.wfa-close {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    line-height: 1;
    padding: 0;
}

.wfa-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Corpo do modal */
.wfa-modal-body {
    padding: 30px;
}

/* Formulário */
.wfa-form {
    width: 100%;
}

.wfa-form-group {
    margin-bottom: 20px;
}

.wfa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wfa-form-group input,
.wfa-form-group textarea,
.wfa-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: white;
}

.wfa-form-group input:focus,
.wfa-form-group textarea:focus,
.wfa-form-group select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wfa-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Botão de envio */
.wfa-submit-btn {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.wfa-submit-btn:hover {
    background: #128C7E;
}

.wfa-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading animation */
.wfa-loading {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #25D366;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: wfa-spin 1s linear infinite;
}

@keyframes wfa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensagem de sucesso */
.wfa-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: 500;
}

/* Mensagem de erro */
.wfa-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
}

/* Integração com Elementor */
.wfa-modal-body .elementor-form {
    margin: 0;
}

.wfa-modal-body .elementor-form .elementor-field-group {
    margin-bottom: 20px;
}

.wfa-modal-body .elementor-form .elementor-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.wfa-modal-body .elementor-form .elementor-field:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wfa-modal-body .elementor-form .elementor-button {
    background: #25D366;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.wfa-modal-body .elementor-form .elementor-button:hover {
    background: #128C7E;
}

/* Responsivo */
@media (max-width: 768px) {
    .wfa-button {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    .wfa-bottom-right {
        bottom: 15px;
        right: 15px;
    }
    
    .wfa-bottom-left {
        bottom: 15px;
        left: 15px;
    }
    
    .wfa-top-right {
        top: 15px;
        right: 15px;
    }
    
    .wfa-top-left {
        top: 15px;
        left: 15px;
    }

    .wfa-button svg {
        width: 28px;
        height: 28px;
    }

    .wfa-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .wfa-modal-body {
        padding: 20px;
    }

    .wfa-modal-header {
        padding: 15px 20px;
    }

    .wfa-modal-header h3 {
        font-size: 20px;
    }
    
    .wfa-button-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .wfa-button {
        width: 50px;
        height: 50px;
    }
    
    .wfa-button svg {
        width: 24px;
        height: 24px;
    }
    
    .wfa-modal-body {
        padding: 15px;
    }
    
    .wfa-form-group input,
    .wfa-form-group textarea,
    .wfa-form-group select {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

/* Scroll customizado para o modal */
.wfa-modal-content::-webkit-scrollbar {
    width: 6px;
}

.wfa-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wfa-modal-content::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}

.wfa-modal-content::-webkit-scrollbar-thumb:hover {
    background: #128C7E;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .wfa-button,
    .wfa-modal,
    .wfa-modal-content,
    .wfa-close,
    .wfa-submit-btn {
        animation: none;
        transition: none;
    }
    
    .wfa-button {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wfa-modal {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .wfa-modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .wfa-form-group input,
    .wfa-form-group textarea,
    .wfa-form-group select {
        background: #2a2a2a;
        border-color: #404040;
        color: #ffffff;
    }
    
    .wfa-form-group label {
        color: #ffffff;
    }
}

/* Print styles */
@media print {
    .wfa-button,
    .wfa-modal {
        display: none !important;
    }
}