/* TRANSiA AI Chatbot widget */
.trx-chat-bubble {
    position: fixed;
    bottom: 24px;
    /* Matches .trx-chat-panel's right offset below, so the launcher sits on the
       same edge as the panel it opens. This was 90px to clear a scroll-to-top
       button (.scroll-top) that the app no longer renders — it survives only in
       the html/ mockups. That left the launcher stranded ~66px short of the
       edge, which is obvious at mobile widths. */
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00B894, #00CEC9);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 22px;
    box-shadow: 0 8px 24px rgba(0,184,148,.4);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
}
.trx-chat-bubble:hover { transform: scale(1.08); }
.trx-chat-bubble .trx-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.trx-chat-panel {
    position: fixed;
    bottom: 94px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 30px);
    height: 540px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0,0,0,.2);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.trx-chat-panel.open { display: flex; }
.trx-chat-head {
    background: linear-gradient(135deg, #00B894, #00CEC9);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.trx-chat-head .name { font-weight: 800; font-family: 'Poppins'; }
.trx-chat-head .status { font-size: 11px; opacity: .9; margin-top: 2px; }
.trx-chat-head button { background: rgba(255,255,255,.18); color:#fff; border:0; width:30px; height:30px; border-radius:50%; cursor: pointer; }
.trx-chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #F8FAFC; }
.trx-msg { margin-bottom: 12px; display: flex; gap: 8px; max-width: 86%; }
.trx-msg.bot { align-self: flex-start; }
.trx-msg.user { align-self: flex-end; flex-direction: row-reverse; margin-left: auto; }
.trx-msg .ava { width: 30px; height: 30px; border-radius: 50%; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff; flex-shrink: 0; }
.trx-msg.bot .ava { background: linear-gradient(135deg, #00B894, #00CEC9); }
.trx-msg.user .ava { background: #6C5CE7; }
.trx-bubble {
    background: #fff;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.trx-msg.user .trx-bubble { background: #6C5CE7; color: #fff; }
.trx-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.trx-quick button {
    background: #fff;
    border: 1px solid #E2E8F0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #0F172A;
}
.trx-chat-foot {
    border-top: 1px solid #E2E8F0;
    padding: 12px 14px;
    background: #fff;
    display: flex;
    gap: 8px;
}
.trx-chat-foot input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    font-family: inherit;
    font-size: 13px;
    background: #F8FAFC;
}
.trx-chat-foot button {
    background: linear-gradient(135deg, #00B894, #00CEC9);
    color: #fff;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}
.trx-chat-foot input:disabled,
.trx-chat-foot button:disabled { opacity: .55; cursor: not-allowed; }

/* Deep links the assistant hands back — it never acts, it points. */
.trx-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px 38px; }
.trx-action {
    display: inline-block;
    background: #EEFBF6;
    border: 1px solid #A7E8D2;
    color: #047857;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.trx-action:hover { background: #D7F5E9; }

/* Typing indicator — shown only while a request is genuinely in flight. */
.trx-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.trx-dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: #94A3B8; display: block;
    animation: trx-blink 1.2s infinite ease-in-out;
}
.trx-dots i:nth-child(2) { animation-delay: .2s; }
.trx-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes trx-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .trx-dots i { animation: none; opacity: .6; } }

/* dark mode harmony */
html[data-theme-mode="dark"] .trx-chat-panel { background:#1E293B; }
html[data-theme-mode="dark"] .trx-chat-body { background:#0F172A; }
html[data-theme-mode="dark"] .trx-bubble { background:#334155; color:#E2E8F0; }
html[data-theme-mode="dark"] .trx-quick button { background:#334155; color:#E2E8F0; border-color:#475569; }
html[data-theme-mode="dark"] .trx-chat-foot { background:#1E293B; border-color:#334155; }
html[data-theme-mode="dark"] .trx-chat-foot input { background:#0F172A; color:#E2E8F0; border-color:#334155; }
html[data-theme-mode="dark"] .trx-action { background:#064E3B; border-color:#047857; color:#A7F3D0; }
