/*
 * The floating WhatsApp chat.
 *
 * Self-contained on purpose: the theme's version leaned on Bootstrap Icons for
 * the glyph and on an SVG file for the typing indicator, and this has to look
 * the same under a theme that ships neither.
 */

.syrus-ai-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.syrus-ai-chat-toggle {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform .15s ease;
}

.syrus-ai-chat-toggle:hover,
.syrus-ai-chat-toggle:focus-visible {
    transform: scale(1.06);
}

.syrus-ai-chat-panel {
    width: 320px;
    max-width: calc(100vw - 40px);
    border-radius: 12px;
    overflow: hidden;
    background: #ece5dd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.syrus-ai-chat-panel[hidden] {
    display: none;
}

.syrus-ai-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #075e54;
    color: #fff;
}

.syrus-ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.syrus-ai-chat-avatar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .22);
    font-weight: 600;
    text-transform: uppercase;
}

.syrus-ai-chat-who {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.syrus-ai-chat-name {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.syrus-ai-chat-status {
    font-size: 12px;
    opacity: .8;
}

.syrus-ai-chat-close {
    margin-left: auto;
    border: 0;
    background: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.syrus-ai-chat-body {
    padding: 16px 12px;
    min-height: 90px;
}

.syrus-ai-chat-message {
    position: relative;
    background: #fff;
    border-radius: 0 8px 8px 8px;
    padding: 8px 10px;
    font-size: 14px;
    color: #303030;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.syrus-ai-chat-message[hidden] {
    display: none;
}

.syrus-ai-chat-message-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #075e54;
    margin-bottom: 2px;
}

.syrus-ai-chat-message-time {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #8c8c8c;
    margin-top: 4px;
}

.syrus-ai-chat-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #fff;
    border-radius: 0 8px 8px 8px;
    padding: 12px 10px;
    width: 52px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.syrus-ai-chat-typing[hidden] {
    display: none;
}

.syrus-ai-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b5b5b5;
    animation: syrus-ai-chat-bounce 1.2s infinite ease-in-out;
}

.syrus-ai-chat-typing span:nth-child(2) {
    animation-delay: .15s;
}

.syrus-ai-chat-typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes syrus-ai-chat-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .55; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.syrus-ai-chat-footer {
    padding: 10px 12px 14px;
}

.syrus-ai-chat-start {
    display: block;
    text-align: center;
    background: #25d366;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px;
    border-radius: 8px;
}

.syrus-ai-chat-start:hover {
    background: #1fb855;
}

/* Someone who asked for less motion still gets the message, just not the dance. */
@media (prefers-reduced-motion: reduce) {
    .syrus-ai-chat-toggle,
    .syrus-ai-chat-typing span {
        transition: none;
        animation: none;
    }
}

@media (max-width: 480px) {
    .syrus-ai-chat {
        right: 12px;
        bottom: 12px;
    }
}
