:root {
    --primary-color: #3498db;
    --bg-color: #f5f5f5;
    --chat-bg: #ffffff;
    --user-bubble: #e6e6e6;
    --bot-bubble: #e9f5fe;
    --text-color: #333333;
    --light-text: #888888;
    --button-color: #3498db;
    --button-text: #ffffff;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.chatbot-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title-text {
    margin: 0;
    font-size: 16px;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}

.chatbot-controls {
    display: flex;
    gap: 10px;
}

.control-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.control-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.message.user .avatar {
    margin-right: 0;
    margin-left: 10px;
    background-color: #95a5a6;
}

.message-content {
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 14px;
    color: var(--text-color);
    position: relative;
}

.message.bot .message-content {
    background-color: var(--bot-bubble);
    border-bottom-left-radius: 5px;
}

.message.user .message-content {
    background-color: var(--user-bubble);
    border-bottom-right-radius: 5px;
}

.timestamp {
    font-size: 11px;
    color: var(--light-text);
    margin-top: 5px;
    text-align: right;
}

.message.bot .timestamp {
    text-align: left;
}

.message-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.message-button {
    background-color: var(--button-color);
    color: var(--button-text);
    border: none;
    border-radius: 18px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.message-button:hover {
    opacity: 0.9;
}

.message-form {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.form-field {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--light-text);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-submit {
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    float: right;
}

.form-submit:hover {
    opacity: 0.9;
}

.chatbot-input {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid var(--border-color);
    align-items: center;
}

.input-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-button:hover {
    opacity: 0.9;
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: transform 0.3s, background-color 0.2s;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
}

.chat-icon, .close-icon {
    width: 24px;
    height: 24px;
}

.close-icon {
    display: none;
}

.chatbot-widget.hidden {
    display: none;
}

.chatbot-toggle.active .chat-icon {
    display: none;
}

.chatbot-toggle.active .close-icon {
    display: block;
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Status indicator */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #2ecc71;
    margin-right: 5px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--bot-bubble);
    border-radius: 18px;
    margin-top: 10px;
    align-self: flex-start;
    max-width: 100px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--light-text);
    margin: 0 2px;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes typingAnimation {
    0%, 100% {
        transform: translateY(0);
    } 
    50% {
        transform: translateY(-5px);
    }
}

.not-sent {
    opacity: 0.6;
}

.not-sent::after {
    content: "Not Sent Yet";
    font-size: 10px;
    color: var(--light-text);
    margin-top: 2px;
    display: block;
}

/* Media queries for responsiveness */
@media (max-width: 480px) {
    .chatbot-widget {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }
}