:root {
    --primary-color: #d32f2f;
    --secondary-color: #d32f2f;
    --accent-color: #d32f2f;
    --bg-color: #ffffff;
    --text-color: #2d3748;
    --light-gray: #edf2f7;
    --medium-gray: #e2e8f0;
    --dark-gray: #a0aec0;
    --success-color: #48bb78;
    --bot-message-bg: #f5f5f5;
    --user-message-bg: #e0e7ff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: #fff;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Chatbot Container */
#chatbot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
    background: #fff;
    display: flex;
    flex-direction: column;
}

#chatbot-container.minimized {
    height: 60px;
    overflow: hidden;
}

/* Header */
.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #d32f2f !important;
    color: white !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: pointer;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: var(--transition);
    border-radius: 50%;
}

.header-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Layout */
.chatbot-layout {
    display: flex;
    height: calc(100% - 59px);
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.chatbot-sidebar {
    width: 0;
    background-color: var(--light-gray);
    transition: var(--transition);
    overflow-y: auto;
    border-right: 1px solid var(--medium-gray);
}

.chatbot-sidebar.active {
    width: 180px;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new-chat-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background-color: var(--secondary-color);
}

.conversations-list {
    padding: 8px;
}

.conversation-item {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.conversation-item:hover {
    background-color: var(--medium-gray);
}

.conversation-item.active {
    background-color: var(--medium-gray);
    font-weight: 500;
}

/* Chat Area */
.chatbot-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-message-bg);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-message-bg);
    border-bottom-right-radius: 4px;
    color: var(--text-color);
}

.thinking {
    display: flex;
    gap: 4px;
    padding: 8px 14px;
    align-self: flex-start;
    background-color: var(--bot-message-bg);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dark-gray);
    animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.timestamp {
    font-size: 10px;
    color: var(--dark-gray);
    margin-top: 4px;
    display: block;
}

/* Input Area */
.input-container {
    padding: 12px;
    border-top: 1px solid var(--medium-gray);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.model-selector label {
    font-size: 12px;
    color: var(--dark-gray);
}

.model-select {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--medium-gray);
    background-color: var(--light-gray);
}

.input-area {
    display: flex;
    gap: 8px;
}

.message-input {
    flex: 1;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    resize: none;
    height: 40px;
    max-height: 120px;
    outline: none;
    font-size: 14px;
    transition: var(--transition);
}

.message-input:focus {
    border-color: var(--primary-color);
}

.send-button {
    background-color: #d32f2f !important;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.send-button:hover {
    background-color: #b71c1c !important;
}

.send-button:disabled {
    background-color: var(--dark-gray);
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    color: var(--dark-gray);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.empty-state-description {
    font-size: 14px;
    color: var(--dark-gray);
    margin-bottom: 16px;
    max-width: 80%;
}

.start-chat-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.start-chat-btn:hover {
    background-color: var(--secondary-color);
}

.lead-submit-btn {
    background-color: #d32f2f !important;
    color: white !important;
}

.lead-form-container {
    height: 100%;
    max-height: 100%;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #d32f2f #f0f0f0;
}
.lead-form {
    min-height: 0;
}

/* For Webkit browsers */
.lead-form-container::-webkit-scrollbar {
    width: 8px;
}
.lead-form-container::-webkit-scrollbar-thumb {
    background: #d32f2f;
    border-radius: 4px;
}
.lead-form-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

/* Launcher Button (when minimized to just a button) */
#chatbot-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 999;
    transition: var(--transition);
}

#chatbot-launcher:hover {
    background-color: var(--secondary-color);
}

/* Small screens adjustments */
@media (max-width: 576px) {
    #chatbot-container {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-header {
        border-radius: 0;
    }

    #chatbot-launcher {
        bottom: 10px;
        right: 10px;
    }
}
