/* ============================================================
   LC Engenharia — Chatbot Widget CSS
   ============================================================ */

/* Variáveis */
:root {
    --lc-primary:     #1a56a0;
    --lc-primary-dk:  #133f7a;
    --lc-accent:      #f5a623;
    --lc-white:       #ffffff;
    --lc-bg:          #f4f6f9;
    --lc-text:        #2c3e50;
    --lc-radius:      12px;
    --lc-shadow:      0 8px 32px rgba(0,0,0,.18);
    --lc-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lc-z:           9999;
}

/* ── Wrapper ─────────────────────────────────────────────── */
#lc-chat-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--lc-z);
    font-family: var(--lc-font);
    font-size: 14px;
    line-height: 1.5;
}

/* ── Botão flutuante ─────────────────────────────────────── */
#lc-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--lc-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,86,160,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s, background .2s;
    position: relative;
    outline-offset: 3px;
}

#lc-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(26,86,160,.55);
    background: var(--lc-primary-dk);
}

#lc-chat-toggle svg {
    width: 28px;
    height: 28px;
    color: var(--lc-white);
}

/* Badge de notificação */
#lc-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--lc-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

#lc-badge.visible {
    display: flex;
}

/* ── Caixa do chat ───────────────────────────────────────── */
#lc-chat-box {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: var(--lc-white);
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

#lc-chat-box.lc-open {
    display: flex;
    animation: lcSlideIn .25s ease;
}

@keyframes lcSlideIn {
    from { opacity: 0; transform: scale(.85) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header ──────────────────────────────────────────────── */
#lc-chat-header {
    background: linear-gradient(135deg, var(--lc-primary) 0%, var(--lc-primary-dk) 100%);
    color: var(--lc-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#lc-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

#lc-chat-header > div {
    flex: 1;
}

#lc-chat-header strong {
    display: block;
    font-size: 15px;
}

#lc-chat-header span {
    font-size: 12px;
    opacity: .8;
}

#lc-chat-close-btn {
    background: none;
    border: none;
    color: var(--lc-white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: .8;
    transition: opacity .2s;
}

#lc-chat-close-btn:hover { opacity: 1; }

/* ── Área de mensagens ───────────────────────────────────── */
#lc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--lc-bg);
    scroll-behavior: smooth;
}

#lc-chat-messages::-webkit-scrollbar { width: 4px; }
#lc-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Bolhas */
.lc-msg {
    display: flex;
    margin-bottom: 10px;
    animation: lcFadeUp .2s ease;
}

@keyframes lcFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lc-msg-bot  { justify-content: flex-start; }
.lc-msg-user { justify-content: flex-end; }

.lc-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.lc-msg-bot .lc-bubble {
    background: var(--lc-white);
    color: var(--lc-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.lc-msg-user .lc-bubble {
    background: var(--lc-primary);
    color: var(--lc-white);
    border-bottom-right-radius: 4px;
}

/* Indicador "digitando" */
.lc-typing .lc-bubble {
    padding: 12px 16px;
}

.lc-dots {
    display: inline-flex;
    gap: 4px;
}

.lc-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aaa;
    animation: lcDot 1.2s infinite;
}

.lc-dots span:nth-child(2) { animation-delay: .2s; }
.lc-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes lcDot {
    0%, 80%, 100% { transform: scale(.8); opacity: .5; }
    40%           { transform: scale(1);  opacity: 1;  }
}

/* ── Input area ──────────────────────────────────────────── */
#lc-chat-input-area {
    padding: 10px 12px 12px;
    border-top: 1px solid #e8eaed;
    background: var(--lc-white);
    flex-shrink: 0;
}

/* Botões de opção */
#lc-chat-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.lc-opt-btn {
    background: var(--lc-white);
    border: 2px solid var(--lc-primary);
    color: var(--lc-primary);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
}

.lc-opt-btn:hover {
    background: var(--lc-primary);
    color: var(--lc-white);
}

/* Campo de texto + envio */
#lc-chat-text-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

#lc-chat-input {
    flex: 1;
    border: 1.5px solid #dde1e7;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-family: var(--lc-font);
    outline: none;
    color: var(--lc-text);
    background: var(--lc-bg);
    transition: border-color .15s;
}

#lc-chat-input:focus { border-color: var(--lc-primary); }

#lc-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--lc-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}

#lc-chat-send:hover { background: var(--lc-primary-dk); }
#lc-chat-send svg { width: 18px; height: 18px; color: #fff; }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 480px) {
    #lc-chat-wrapper { bottom: 16px; right: 16px; }

    #lc-chat-box {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 100px);
        right: -16px;
        bottom: 70px;
    }
}

/* ── Chat Popup [lc_chatbot_popup] ───────────────────────── */
.lc-popup-chat {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 480px;
    background: var(--lc-white);
    border-radius: var(--lc-radius);
    overflow: hidden;
    font-family: var(--lc-font);
    font-size: 14px;
}

.lc-popup-chat__header {
    background: linear-gradient(135deg, var(--lc-primary) 0%, var(--lc-primary-dk) 100%);
    color: var(--lc-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.lc-popup-chat__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.lc-popup-chat__header strong { display: block; font-size: 15px; }
.lc-popup-chat__header span   { font-size: 12px; opacity: .8; }

.lc-popup-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--lc-bg);
    scroll-behavior: smooth;
}

.lc-popup-chat__messages::-webkit-scrollbar { width: 4px; }
.lc-popup-chat__messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.lc-popup-chat__footer {
    padding: 10px 12px 12px;
    border-top: 1px solid #e8eaed;
    background: var(--lc-white);
    flex-shrink: 0;
}

.lc-popup-chat__options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.lc-popup-chat__input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lc-popup-chat__input {
    flex: 1;
    border: 1.5px solid #dde1e7;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-family: var(--lc-font);
    outline: none;
    color: var(--lc-text);
    background: var(--lc-bg);
    transition: border-color .15s;
}

.lc-popup-chat__input:focus { border-color: var(--lc-primary); }

.lc-popup-chat__send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--lc-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}

.lc-popup-chat__send:hover { background: var(--lc-primary-dk); }
.lc-popup-chat__send svg { width: 18px; height: 18px; color: #fff; }