/* Base reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Floating launcher */
#chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #a22424, #dd3830);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
}

/* Chat window */
#chat-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 360px;
    max-width: calc(100% - 32px);
    height: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#chat-widget.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 480px) {
    #chat-widget {
        width: 100%;
        height: 90%;
        right: 0;
        bottom: 0;
        border-radius: 16px 16px 0 0;
    }
}

.chat-header {
    /* background: linear-gradient(135deg, #1b67d4, #2f80ed); */
    background: linear-gradient(135deg, #a22424, #d0352d);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-title .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #1b67d4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
}

.chat-title .avatar::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #fff;
    right: -4px;
    bottom: -1px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* .green-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #fff;
    right: -2px;
    bottom: -2px;
} */


.chat-actions button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chat-actions .chat-end {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.chat-body {
    flex: 1;
    background: #f5f7fb;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-gutter: stable both-edges;
    position: relative;
}

.chat-footer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5eaf2;
    flex-shrink: 0;
}

.chat-footer.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.chat-footer form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #d7deea;
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
    font-size: 14px;
    transition: border 0.2s ease;
}

.chat-input:focus {
    border-color: #2f80ed;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #a22424, #d0352d);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(47, 128, 237, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(47, 128, 237, 0.3);
}

.bubble {
    padding: 10px 12px;
    border-radius: 16px;
    max-width: 82%;
    line-height: 1.4;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    word-break: break-word;
    animation: fadeInUp 0.2s ease;
}

.bubble.bot {
    background: #fff;
    align-self: flex-start;
}

.bubble.typing-indicator {
    background: #e8ecf5;
    box-shadow: none;
}

.bubble.user {
    /* background: #1b67d4; */
    background: #bd2e29;
    color: #fff;
    align-self: flex-end;
}

.bubble.telecaller {
    background: #10b981;
    color: #fff;
    align-self: flex-start;
}

.bullet-intro {
    display: block;
    margin-bottom: 6px;
}

.bullet-list {
    margin: 6px 0 0 18px;
    padding-left: 18px;
}

.bullet-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.chip {
    /* background: #e8efff;
    color: #1b67d4;
    padding: 8px 12px;
    border-radius: 14px;
    cursor: pointer;
    border: 1px solid #d7e2ff;
    transition: all 0.2s ease;
    font-size: 13px; */
    color: #be2e29;
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid #bc2e29;
  transition: all 0.2s ease;
  font-size: 13px;
}

.chip:hover {
    /* background: #d1ddff; */
    background: #ffb2af8f;
}

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #cdd7e7;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1s infinite ease-in-out;
}

.typing-indicator .typing span {
    background: #a6b7d3;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

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

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.prechat {
    position: absolute;
    inset: 0;
    background: #f5f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2;
}

.prechat.is-hidden {
    display: none;
}

.prechat-card {
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5eaf2;
}

.prechat-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: #1f2937;
}

.prechat-sub {
    font-size: 13px;
    color: #5f6b7c;
    margin-bottom: 14px;
}

#prechat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#prechat-form label {
    font-size: 12px;
    color: #5f6b7c;
}

#prechat-form input,
#prechat-form textarea {
    width: 100%;
    border: 1px solid #d7deea;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border 0.2s ease;
}

#prechat-form input:focus,
#prechat-form textarea:focus {
    border-color: #2f80ed;
}

.prechat-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #a22424, #d0352d);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(208, 53, 45, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.prechat-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(208, 53, 45, 0.3);
}
