/* ========================================
   WA LEAD TRACKER - FRONTEND STYLES
   Versão 1.5.4 - Campos simples
   ======================================== */

/* ========== RESET E VARIÁVEIS ========== */
:root {
    --walt-primary: #25D366;
    --walt-primary-dark: #128C7E;
    --walt-bg-chat: #E5DDD5;
    --walt-bubble-received: #FFFFFF;
    --walt-bubble-sent: #DCF8C6;
    --walt-text-dark: #303030;
    --walt-text-light: #667781;
    --walt-border: #D1D7DB;
    --walt-shadow: rgba(0, 0, 0, 0.1);
}

/* ========== BOTÃO FLUTUANTE ========== */
#walt-floating-button {
    position: fixed;
    z-index: 999998;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    padding: 0;
    animation: waltSlideUp 0.5s ease 0.8s backwards;
}

#walt-floating-button svg {
    width: 60%;
    height: 60%;
    pointer-events: none;
}

#walt-floating-button:hover {
    transform: scale(1.1);
}

#walt-floating-button:active {
    transform: scale(0.95);
}

/* ========== TOOLTIP DO BOTÃO ========== */
.walt-button-tooltip {
    position: absolute;
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: #303030;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.walt-button-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #303030;
}

#walt-floating-button:hover .walt-button-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip à esquerda se botão estiver à esquerda */
#walt-floating-button[style*="left"] .walt-button-tooltip {
    right: auto;
    left: calc(100% + 15px);
}

#walt-floating-button[style*="left"] .walt-button-tooltip::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: #303030;
}

/* ========== ANIMAÇÕES ========== */
@keyframes waltSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ========== MODAL OVERLAY ========== */
.walt-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

.walt-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== MODAL ESTILO CHAT ========== */
.walt-chat-modal {
    position: relative;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* ========== BOTÃO FECHAR ========== */
.walt-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.8;
}

.walt-modal-close:hover,
.walt-modal-close:focus,
.walt-modal-close:active {
    opacity: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none;
}

/* ========== HEADER ESTILO CHAT ========== */
.walt-chat-header {
    background: var(--walt-primary);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.walt-chat-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.walt-chat-avatar img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 3px solid #FFFFFF;
    display: block;
}

.walt-chat-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #00E676;
    border: 2px solid var(--walt-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.walt-chat-agent-info {
    flex: 1;
    min-width: 0;
}

.walt-chat-agent-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.walt-chat-agent-status {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

/* ========== BODY DO CHAT ========== */
.walt-chat-body {
    flex: 1;
    background: var(--walt-bg-chat);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px,
        rgba(255, 255, 255, 0.05) 35px, rgba(255, 255, 255, 0.05) 70px);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========== MENSAGENS ========== */
.walt-chat-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(10px);
    animation: messageIn 0.3s ease forwards;
}

.walt-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--walt-bubble-received);
    box-shadow: 0 1px 2px var(--walt-shadow);
    color: var(--walt-text-dark);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.walt-chat-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    border: 8px solid transparent;
    border-right-color: var(--walt-bubble-received);
    border-top-color: var(--walt-bubble-received);
}

.walt-chat-time {
    font-size: 11px;
    color: var(--walt-text-light);
    margin-top: 4px;
    padding-left: 10px;
}

/* ========== EFEITO DE DIGITAÇÃO ========== */
.walt-chat-typing {
    display: flex;
    align-items: center;
    opacity: 0;
    animation: messageIn 0.3s ease forwards;
    margin-bottom: 12px;
}

.walt-typing-dots {
    display: flex;
    gap: 4px;
    background: var(--walt-bubble-received);
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: 0 1px 2px var(--walt-shadow);
}

.walt-typing-dots span {
    width: 8px;
    height: 8px;
    background: #90949C;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.walt-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.walt-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ========== FORMULÁRIO ========== */
.walt-chat-form-wrapper {
    opacity: 0;
    animation: messageIn 0.3s ease forwards;
}

.walt-chat-form {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--walt-shadow);
}

.walt-form-group {
    margin-bottom: 12px;
}

/* Inputs simples (sem ícone) – Nome e Telefone iguais */
.walt-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--walt-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--walt-text-dark);
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.walt-form-input:focus {
    outline: none;
    border-color: var(--walt-primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.walt-form-input::placeholder {
    color: var(--walt-text-light);
}

/* Classes antigas de ícone/label – escondidas */
.walt-form-label,
.walt-form-icon {
    display: none;
}

/* ========== CHECKBOX LGPD ========== */
.walt-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--walt-text-dark);
    line-height: 1.4;
}

.walt-checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.walt-checkbox-group a {
    color: var(--walt-primary);
    text-decoration: none;
}

.walt-checkbox-group a:hover {
    text-decoration: underline;
}

/* ========== BOTÃO SUBMIT (ISOLADO) ========== */
.walt-chat-form .walt-chat-submit-btn,
#walt-lead-form .walt-chat-submit-btn,
.walt-chat-submit-btn.walt-submit-btn {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    min-height: 56px !important;
    padding: 14px 24px !important;
    box-sizing: border-box !important;

    border: none !important;
    border-radius: 8px !important;
    background-color: var(--walt-primary-dark) !important;
    color: #fff !important;

    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: normal !important;

    cursor: pointer !important;
    transition: all 0.2s ease !important;

    margin-top: 4px !important;
}

/* remove qualquer pseudo-elemento ou ícone injetado pelo tema */
.walt-chat-submit-btn::before,
.walt-chat-submit-btn::after {
    content: none !important;
}

/* ícone interno do plugin */
.walt-chat-submit-btn .walt-submit-icon {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
    fill: currentColor !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* texto interno */
.walt-chat-submit-btn span {
    display: inline-block !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* estados de hover/active/disabled, ignorando o tema */
.walt-chat-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
    filter: brightness(0.95) !important;
}

.walt-chat-submit-btn:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.walt-chat-submit-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ========== FEEDBACK ========== */
.walt-feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.walt-feedback.success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
    display: block;
}

.walt-feedback.error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
    display: block;
}

/* ========== CAMPOS HIDDEN ========== */
.walt-hidden-fields {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .walt-chat-modal {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }

    .walt-chat-header {
        padding: 16px;
    }

    .walt-chat-body {
        padding: 16px;
    }

    .walt-button-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .walt-chat-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .walt-chat-bubble {
        max-width: 90%;
    }

    .walt-chat-submit-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}
