/* =========================================
   Fawkes Bot — Widget CSS
   ========================================= */

#fawkes-bot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Botão flutuante ── */
#fawkes-bot-toggle {
    width: 72px;
    height: 72px;
    border: none;
    background: transparent !important;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    padding: 0;
    animation: fawkes-float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
    transition: filter .2s;
}
#fawkes-bot-toggle:hover {
    animation-play-state: paused;
    filter: drop-shadow(0 12px 28px rgba(0,0,0,.5));
}
#fawkes-bot-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
#fawkes-bot-toggle[aria-expanded="true"] {
    animation-play-state: paused;
}
/* Ícone fica com tom avermelhado quando o chat está aberto */
#fawkes-bot-toggle[aria-expanded="true"] img,
#fawkes-bot-toggle[aria-expanded="true"] svg {
    filter: drop-shadow(0 0 6px rgba(220,38,38,.7)) hue-rotate(200deg) saturate(2) brightness(0.9);
    transition: filter .3s;
}
@keyframes fawkes-float {
    0%   { transform: translateY(0px);   }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px);   }
}

/* ── Janela ── */
#fawkes-bot-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    display: flex;
    flex-direction: column;
    background: #fff;
    /* fechado por padrão */
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.97);
    transition: opacity .22s ease, transform .22s ease;
}
#fawkes-bot-window.fawkes-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* ── Cabeçalho ── */
#fawkes-bot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
}
#fawkes-bot-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fawkes-bot-avatar {
    font-size: 20px;
    line-height: 1;
}
#fawkes-bot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: .8;
    transition: opacity .15s;
}
#fawkes-bot-close:hover { opacity: 1; }

/* ── Mensagens ── */
#fawkes-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    max-height: 340px;
    background: #f8f9fb;
}

.fawkes-msg {
    display: flex;
    max-width: 85%;
}
.fawkes-msg-bot  { align-self: flex-start; }
.fawkes-msg-user { align-self: flex-end;   }

.fawkes-msg-text {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.fawkes-msg-bot  .fawkes-msg-text {
    background: #fff;
    color: #222;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.fawkes-msg-user .fawkes-msg-text {
    color: #fff;
    border-bottom-right-radius: 4px;
    /* cor injetada via JS */
}

/* ── Digitando ── */
.fawkes-typing .fawkes-msg-text {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
}
.fawkes-typing .fawkes-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    animation: fawkes-bounce 1.2s infinite;
}
.fawkes-typing .fawkes-dot:nth-child(2) { animation-delay: .2s; }
.fawkes-typing .fawkes-dot:nth-child(3) { animation-delay: .4s; }
@keyframes fawkes-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%         { transform: translateY(-6px); }
}

/* ── Input ── */
#fawkes-bot-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e8eaed;
    background: #fff;
}
#fawkes-bot-input {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 24px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
#fawkes-bot-input:focus {
    border-color: #4b8aec;
}
#fawkes-bot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s, transform .15s;
    flex-shrink: 0;
}
#fawkes-bot-send:hover  { opacity: .88; transform: scale(1.06); }
#fawkes-bot-send:active { transform: scale(.95); }
#fawkes-bot-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Responsivo ── */
@media (max-width: 400px) {
    #fawkes-bot-wrapper { bottom: 12px; right: 12px; }
    #fawkes-bot-window  { width: calc(100vw - 24px); right: -12px; }
}

/* ── Botão silenciar ── */
#fawkes-bot-mute {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    opacity: .85;
    transition: opacity .15s, transform .15s;
}
#fawkes-bot-mute:hover {
    opacity: 1;
    transform: scale(1.15);
}
