/* Chat Widget Styling */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(132, 12, 13, 0.3);
    display: none;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    border: 1px solid #840c0d;
}

#chat-widget-header {
    background: linear-gradient(135deg, #840c0d, #a50e10);
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

#chat-widget-header span {
    display: flex;
    align-items: center;
}

#chat-widget-header img {
    object-fit: cover;
    width: 30px;
    height: 30px;
    margin-right: 8px;
}

#chat-widget-header button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#chat-widget-header button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#chat-widget-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Message Styling */
.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    word-wrap: break-word;
    position: relative;
    max-width: 85%;
    line-height: 1.4;
}

.user-message {
    /* background: #f0f0f0; */
    background: linear-gradient(135deg, #840c0d, #a50e10);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background: linear-gradient(135deg, #c49c31, #c49c31);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.bot-message ol, p, ul {
    font-size: 14px;
}

.bot-message ul li,
ol li {
    margin: 12px 0px;
}

.welcome-message {
    background: linear-gradient(135deg, #c49c31, #c49c31);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.bot-message .message-time,
.welcome-message .message-time {
    text-align: left;
}

/* Loading indicator */
.loading-message {
    background: linear-gradient(135deg, #c49c31, #c49c31);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-dots {
    display: flex;
    gap: 3px;
}

.loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}
.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDots {
    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

#chat-widget-footer {
    width: 100%;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.5);
    padding: 3px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    background: white;
}

#chat-widget-input {
    background: transparent;
    padding: 12px 15px 12px 15px;
    /* font-weight: 500; */
    flex: 1;
    width: 100%;
    height: 65px;
    min-height: 61px;
    /* max-height: 128px; */
    font-size: 15px;
    resize: none;
    direction: ltr;
    text-align: left;
    border: none;
    /* outline: none; */
    /* font-family: "Geist Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; */
}

#chat-widget-input:focus {
    outline: none;
}

#chat-widget-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    brightness: 100%;
}

/* Hide scrollbar */
#chat-widget-input::-webkit-scrollbar {
    display: none;
}

#chat-widget-send {
    padding: 8px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    filter: brightness(1);
}

#chat-widget-send:hover {
    filter: brightness(0.9);
}

#chat-widget-send:active {
    filter: brightness(0.75);
}

#chat-widget-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: brightness(1);
}

.send-button-circle {
    background-color: #840c0d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat button styling */
#chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #840c0d, #a50e10);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(132, 12, 13, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

#chat-widget-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(132, 12, 13, 0.5);
}

/* Scrollbar styling */
#chat-widget-body::-webkit-scrollbar {
    width: 6px;
}

#chat-widget-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#chat-widget-body::-webkit-scrollbar-thumb {
    background: #c49c31;
    border-radius: 3px;
}

#chat-widget-body::-webkit-scrollbar-thumb:hover {
    background: #b8912c;
}
