/* 1. VARIÁVEIS DE CORES STUDIODESS */
:root {
    --sd-orange: #f57c00;
    --sd-bg-light: #f9f9f9;
    --sd-text: #333;
    --sd-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* 2. CONTAINER FLUTUANTE */
#sd-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 550px; /* Altura ideal para mobile e desktop */
    background: white;
    border-radius: 15px;
    box-shadow: var(--sd-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    z-index: 999999; /* Garante que fique acima de tudo */
    border: 1px solid #eee;
}

/* 3. JANELA DE MENSAGENS */
#chat-window {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--sd-bg-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* 4. BOLHAS DE MENSAGEM */
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: sdFadeIn 0.3s ease;
}

@keyframes sdFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.bot-message {
    background: #e9edef;
    color: var(--sd-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: var(--sd-orange);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* 5. BOTÕES DE OPÇÃO */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.option-btn {
    background: white;
    border: 1px solid var(--sd-orange);
    color: var(--sd-orange);
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    text-align: center;
}

.option-btn:hover {
    background: var(--sd-orange);
    color: white;
}

/* 6. ÁREA DE INPUT */
.input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    gap: 8px;
}

#user-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
}

#user-input:focus { border-color: var(--sd-orange); }

#send-btn {
    background: var(--sd-orange);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

/* 7. EFEITO DIGITANDO */
.typing { display: flex; gap: 4px; padding: 5px; }
.typing span {
    width: 6px; height: 6px; background: #bbb; border-radius: 50%;
    animation: sdBlink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sdBlink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* 8. AJUSTE PARA MOBILE */
@media (max-width: 400px) {
    #sd-chat-container {
        width: 90%;
        right: 5%;
        bottom: 10px;
        height: 80vh;
    }
}