﻿:root {
    --cw-bg: #ffffff;
    --cw-accent: #F44236;
    --cw-text: #111827;
    --cw-border: rgba(0,0,0,0.12);
}

.chat-widget-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cw-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    cursor: pointer;
    z-index: 999999;
}

.chat-widget-panel {
    position: fixed;
    right: 20px;
    bottom: 86px;
    width: 340px;
    max-height: 70vh;
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.chat-widget-header {
    padding: 12px 14px;
    font-weight: 600;
    color: var(--cw-text);
    background: linear-gradient(0deg, rgba(0,0,0,0.02), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-body {
    padding: 12px;
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-widget-message {
    max-width: 80%;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.3;
}

    .chat-widget-message.user {
        margin-left: auto;
        background: var(--cw-accent);
        color: white;
        border-bottom-right-radius: 2px;
    }

    .chat-widget-message.bot {
        margin-right: auto;
        background: #f3f4f6;
        color: var(--cw-text);
        border-bottom-left-radius: 2px;
    }

.chat-widget-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--cw-border);
    background: #fff;
}

    .chat-widget-input input {
        flex: 1;
        padding: 8px 10px;
        border: 1px solid var(--cw-border);
        border-radius: 8px;
        font-size: 14px;
    }

    .chat-widget-input button {
        background: var(--cw-accent);
        color: #fff;
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
    }

/* Dot-style inline loader used in the bot bubble while waiting for response */
.spinner {
  display: inline-block;
  vertical-align: middle;
  width: 36px;
  text-align: center;
}
.spinner > div {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 3px;
  background-color: var(--cw-accent);
  border-radius: 50%;
  animation: dot 1s infinite linear;
  opacity: 0.4;
  transform: scale(0.6);
}
.spinner > div:nth-child(2) { animation-delay: 0.12s; }
.spinner > div:nth-child(3) { animation-delay: 0.24s; }

@keyframes dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
