/* styles/floating-chat.css */

:root {
    --whatsapp-color: #25D366;
    --email-color: #7f8c8d;
}

#floating-chat-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: transform 0.3s ease, background-color 0.3s ease, right 0.4s ease; /* Adicionada transição para 'right' */
}

#floating-chat-button:hover {
    transform: scale(1.1);
    background-color: #128C7E;
}

#chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 320px; 
    max-width: 90vw;
    background-color: var(--card-background); 
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

#chat-window.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.chat-header {
    background-color: var(--background-color); 
    color: var(--text-color); 
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1em;
}

#close-chat-button {
    background: none;
    border: none;
    color: var(--text-color); 
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-options {
    padding: 20px;
    text-align: center;
}

.chat-options p {
    margin-bottom: 15px;
    color: var(--secondary-color); 
}

.chat-option-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-align: center;
}

.chat-option-button i {
    margin-right: 10px;
}

.chat-option-button:hover {
    opacity: 0.9;
}

.chat-option-button.whatsapp {
    background-color: var(--whatsapp-color);
}

.chat-option-button.email {
    background-color: var(--email-color);
}

#floating-contact-form {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

#floating-contact-form.hidden {
    display: none;
}

.back-button {
    display: block;
    margin-bottom: 15px;
    color: var(--secondary-color);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
}

.back-button:hover {
    color: var(--primary-color);
}

#floating-contact-form .form-group {
    margin-bottom: 15px;
}

#floating-contact-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
    font-weight: 500;
}

#floating-contact-form input[type="text"],
#floating-contact-form input[type="email"],
#floating-contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color); 
    color: var(--text-color); 
    border-radius: 5px;
}

#floating-contact-form .submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: var(--background-color); 
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s;
}

#floating-contact-form .submit-btn:hover {
    background-color: #fbc02d;
}

#status-message {
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}


/* ===================================================================== */
/* ====== NOVA REGRA: Alinha o botão ao conteúdo em telas grandes ====== */
/* ===================================================================== */

@media (min-width: 1024px) {
  #floating-chat-button, #chat-window {
    /* CÁLCULO:
      1. (100vw - 900px) / 2 = Calcula o tamanho do espaço vazio à direita do seu conteúdo.
      2. Esse valor se torna a nova distância da direita, alinhando o botão ao conteúdo.
    */
    right: calc((100vw - 900px) / 2);
  }

  #chat-window {
    /* Pequeno ajuste para a janela de chat não ficar colada no botão */
     right: calc((100vw - 900px) / 2 + 5px);
  }
}