/* ============================================================
   SOA Suite — Chat Widget Styles
   Brand: #4f1507 (maroon) / #c9a437 (gold)
   ============================================================ */

#soa-chat-root {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9990;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Bubble ──────────────────────────────────────────────── */
#soa-chat-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #4f1507;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 22px 12px 14px;
    cursor: pointer;
    box-shadow: 0 6px 28px rgba(79,21,7,.45);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
    position: relative;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}
#soa-chat-bubble:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 36px rgba(79,21,7,.55);
}
#soa-chat-bubble:active { transform: scale(.96); }

.soa-chat-bubble__icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    display: grid; place-items: center;
    flex-shrink: 0;
}

.soa-chat-bubble__pulse {
    position: absolute;
    top: -3px; right: -3px;
    width: 14px; height: 14px;
    background: #c9a437;
    border-radius: 50%;
    border: 2px solid #4f1507;
}
.soa-chat-bubble__pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: rgba(201,164,55,.4);
    border-radius: 50%;
    animation: soa-pulse 2s ease-out infinite;
}
@keyframes soa-pulse {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ── Panel ───────────────────────────────────────────────── */
#soa-chat-panel {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 360px;
    max-height: 580px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 64px rgba(0,0,0,.18), 0 4px 16px rgba(79,21,7,.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(79,21,7,.12);
    animation: soa-panel-in .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes soa-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(.95); }
    to   { opacity: 1; transform: none; }
}

/* ── Header ──────────────────────────────────────────────── */
.soa-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #4f1507 0%, #7a2010 100%);
    color: #fff;
    flex-shrink: 0;
}
.soa-chat-header__info {
    display: flex; align-items: center; gap: 10px;
}
.soa-chat-header__avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    display: grid; place-items: center;
}
.soa-chat-header strong { display: block; font-size: 14px; font-weight: 700; }
.soa-chat-status {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; opacity: .85;
}
.soa-chat-dot {
    width: 7px; height: 7px;
    background: #c9a437;
    border-radius: 50%;
    animation: soa-breathe 2.4s ease-in-out infinite;
}
@keyframes soa-breathe {
    0%,100% { opacity: 1; } 50% { opacity: .45; }
}
.soa-chat-header__actions { display: flex; align-items: center; gap: 4px; }
.soa-chat-header__actions button {
    width: 30px; height: 30px;
    background: rgba(255,255,255,.1);
    border: none; border-radius: 8px;
    display: grid; place-items: center;
    color: #fff; cursor: pointer;
    transition: background .15s;
}
.soa-chat-header__actions button:hover { background: rgba(255,255,255,.2); }

/* ── Messages ────────────────────────────────────────────── */
#soa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    background: #faf7f6;
}
#soa-chat-messages::-webkit-scrollbar { width: 4px; }
#soa-chat-messages::-webkit-scrollbar-thumb { background: rgba(79,21,7,.2); border-radius: 4px; }

.soa-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: soa-msg-in .25s ease;
}
@keyframes soa-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.soa-msg--user { align-self: flex-end; align-items: flex-end; }
.soa-msg--bot  { align-self: flex-start; align-items: flex-start; }

.soa-msg__bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}
.soa-msg--user .soa-msg__bubble {
    background: #4f1507;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.soa-msg--bot .soa-msg__bubble {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e8e0dd;
    border-bottom-left-radius: 4px;
}
.soa-msg__time {
    font-size: 10px;
    color: #9e8e8a;
    margin-top: 3px;
    padding: 0 4px;
}

/* Typing indicator */
.soa-typing {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 14px;
    background: #fff; border: 1px solid #e8e0dd;
    border-radius: 14px; border-bottom-left-radius: 4px;
    width: fit-content;
}
.soa-typing span {
    width: 7px; height: 7px; background: #c9a437; border-radius: 50%;
    animation: soa-bounce 1.2s ease-in-out infinite;
}
.soa-typing span:nth-child(2) { animation-delay: .15s; }
.soa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes soa-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); }
}

/* ── Suggestions ─────────────────────────────────────────── */
.soa-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background: #faf7f6;
    border-top: 1px solid #e8e0dd;
    flex-shrink: 0;
}
.soa-suggestion {
    background: #fff;
    border: 1.5px solid rgba(79,21,7,.25);
    color: #4f1507;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.soa-suggestion:hover { background: #4f1507; color: #fff; border-color: #4f1507; }

/* ── Input ───────────────────────────────────────────────── */
.soa-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e8e0dd;
    background: #fff;
    flex-shrink: 0;
}
#soa-chat-input {
    flex: 1;
    border: 1.5px solid #e8e0dd;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
    transition: border-color .15s;
    font-family: inherit;
}
#soa-chat-input:focus { outline: none; border-color: #4f1507; }
#soa-send-msg, #soa-chat-send {
    width: 38px; height: 38px;
    background: #4f1507;
    border: none; border-radius: 10px;
    display: grid; place-items: center;
    color: #fff; cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
#soa-chat-send:hover { background: #7a2010; }
#soa-chat-send:active { transform: scale(.92); }
#soa-chat-send:disabled { background: #ccc; cursor: not-allowed; }

/* ── Footer ──────────────────────────────────────────────── */
.soa-chat-footer {
    text-align: center;
    font-size: 10px;
    color: #b0a0a0;
    padding: 6px;
    background: #fff;
    border-top: 1px solid #f0ebe8;
    margin: 0;
    flex-shrink: 0;
}
.soa-chat-footer a { color: #4f1507; text-decoration: none; font-weight: 600; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    #soa-chat-root { bottom: 14px; right: 14px; }
    #soa-chat-panel { width: calc(100vw - 28px); right: -14px; }
    .soa-chat-bubble__label { display: none; }
    #soa-chat-bubble { padding: 14px; border-radius: 50%; }
}
