:root {
    --webchat-chat-btn-size: 72px;
    --webchat-btn-color: white;
    --webchat-btn-bg-color: #001955;
    --webchat-btn-color-active: white;
    --webchat-btn-bg-color-active: #00113a;
    --webchat-chat-container-width: 451px;
    --webchat-chat-container-height: 658px;
    --webchat-chat-header-bg-color: #001955;
    --webchat-chat-header-color: white;
    --webchat-chat-header-font-size: 24px;
    --webchat-bot-message-bg-color: #001955;
    --webchat-bot-message-color: white;
    --webchat-agent-message-bg-color: #001955;
    --webchat-agent-message-color: white;
    --webchat-customer-message-bg-color: #ebeae7;
    --webchat-customer-message-color: black;
}


/* Launcher button styles */
#startButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--webchat-chat-btn-size);
    height: var(--webchat-chat-btn-size);
    border-radius: 50%;
    background-color: var(--webchat-btn-bg-color);
    color: var(--webchat-btn-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

    #startButton.active {
        background-color: var(--webchat-btn-bg-color-active);
        color: var(--webchat-btn-color-active);
    }

    #startButton:hover {
        transform: scale(1.1);
        background-color: var(--webchat-btn-bg-color-active);
        color: var(--webchat-btn-color-active);
    }

/* Chat container styles */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: var(--webchat-chat-container-width);
    height: var(--webchat-chat-container-height);
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.chat-header {
    padding: 15px;
    background: var(--webchat-chat-header-bg-color);
    color: var(--webchat-chat-header-color);
    font-size: var(--webchat-chat-header-font-size);
    font-weight: bold;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatBox {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fbfe;
    box-shadow: inset 0 4px 4px rgba(0, 38, 67, 0.12), inset 0 -4px 4px rgba(0, 38, 67, 0.12);
}

.input-area {
    padding: 16px;
    background: white;
    border-radius: 0 0 20px 20px;
}

.typing-indicator-area {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    min-height: 20px;
    padding: 0 10px;
}

.message-input-container {
    display: flex;
    box-sizing: border-box;
    align-items: center;
    background: #ffffff;
    padding: 8px 8px 8px 16px;
    box-shadow: 0 0 0 1px #e0e0e0; /* subtle border */
    max-width: 500px;
    width: 100%;
    border-radius: 8px;
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #4a4a4a;
    background: transparent;
}

    #messageInput:focus {
        border-color: #007bff;
    }

.button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

#sendButton {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #002b45; /* dark blue */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

    #sendButton:hover {
        background-color: var(--webchat-btn-bg-color-active);
        color: var(--webchat-btn-color-active);
    }

#disconnectButton {
    background-color: #dc3545;
    color: white;
}

    #disconnectButton:hover {
        background-color: #c82333;
    }

/* Message styles */
.message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
}

/* Bot message style */
.bot-message {
    background-color: var(--webchat-bot-message-bg-color);
    color: var(--webchat-bot-message-color);
    margin-right: auto;
    border-bottom-left-radius: 0px;
}

.bot-message p {
    color: var(--webchat-bot-message-color);
}

/* Agent message style */
.agent-message {
    background-color: var(--webchat-agent-message-bg-color);
    color: var(--webchat-agent-message-color);
    margin-right: auto;
    border-bottom-left-radius: 0px;
}

.agent-message p {
    color: var(--webchat-agent-message-color);
}

/* Customer/human message style */
.human-message {
    background-color: var(--webchat-customer-message-bg-color); /* Blue color for customer messages */
    color: var(--webchat-customer-message-color);
    margin-left: auto;
    border-bottom-right-radius: 0px;
}

.human-message p {
    color: var(--webchat-customer-message-color);
}

.nickname {
    font-size: 0.8em;
    margin-bottom: 5px;
    opacity: 0.8;
    font-weight: bold;
}

#typingIndicator {
    color: #666;
    font-style: italic;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* File upload styles */
.file-upload {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
}

.message-attachment {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-size: 0.9em;
}

/* System message style */
.system-message {
    background-color: #f8d7da;
    color: #721c24;
    text-align: center;
    margin: 10px auto;
    padding: 8px 15px;
    border-radius: 15px;
    width: fit-content;
}

/* Typing indicator styles */
.typing-indicator {
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    background-color: rgba(248, 249, 250, 0.9);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#closeButton {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: opacity 0.3s;
}

    #closeButton:hover {
        opacity: 0.8;
    }

/* Add these styles for agent attachments */
.bot-message .message-attachment {
    background: rgba(0, 0, 0, 0.05);
    margin-top: 8px;
    padding: 8px;
    border-radius: 5px;
}

    .bot-message .message-attachment a {
        color: #007bff;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 5px;
    }

        .bot-message .message-attachment a:hover {
            text-decoration: underline;
        }

/* Quick Reply Button Styles */
.quick-reply-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-button {
    background-color: var(--webchat-btn-bg-color);
    color: var(--webchat-btn-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

    .quick-reply-button:hover {
        background-color: var(--webchat-btn-bg-color-active);
    }

/* When quick reply buttons are in a bot message */
.bot-message .quick-reply-button {
    background-color: #e9ecef;
    color: #333;
}

    .bot-message .quick-reply-button:hover {
        background-color: #dee2e6;
    }

/* Markdown styles */
.message div {
    word-wrap: break-word;
}

.message code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.message pre {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
}

.message a {
    color: inherit;
    text-decoration: underline;
}

.message mark {
    background-color: rgba(255, 255, 0, 0.4);
    padding: 0 2px;
}

/* Specific styles for different message types */
.bot-message a {
    color: #007bff;
}

.human-message a {
    color: white;
}

.agent-message a {
    color: white;
}

.chat-chatbot-header {
    display: flex;
    align-items: center;
    gap: 16px;
}
