.bot-widget {
    position: fixed;
    z-index: 1000;
    --primary-color: #007bff;
    --bg-color: #ffffff;
    --text-color: #333333;
}

.bot-trigger {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: move;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    position: absolute;
}

.bot-trigger:hover {
    transform: scale(1.1);
}

.bot-container {
    background: var(--bg-color);
    border-radius: 8px;
    width: 350px;
    max-height: 500px;
    display: none; /* Ensure initial state is hidden */
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    position: fixed;
    z-index: 1001;
    resize: both;
    overflow: auto;
    min-width: 250px;
    min-height: 300px;
}

.bot-header {
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-header {
    cursor: move;
}

.bot-clear {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: white;
}

.bot-clear:hover {
    color: #ff4444;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    cursor: se-resize;
    border-radius: 0 0 8px 0;
}

.bot-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f5f5f5;
}

.bot-messages::-webkit-scrollbar {
    width: 8px;
}

.bot-messages::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.bot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.message {
    margin: 5px 0;
    padding: 8px;
    border-radius: 8px;
    max-width: 80%;
}

.message.user {
    background: #e3f2fd;
    margin-left: auto;
}

.message.bot {
    background: #f5f5f5;
    margin-right: auto;
}

.bot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.bot-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
}

.send-btn, .voice-input {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
}

.quick-buttons {
    padding: 10px;
    border-top: 1px solid #eee;
}

.quick-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    margin: 0 5px;
    cursor: pointer;
}

.rating button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
}

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

/* Dark theme */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --primary-color: #0056d2;
}

/* High contrast theme */
[data-theme="contrast"] {
    --bg-color: #000000;
    --text-color: #ffffff;
    --primary-color: #ffff00;
}

/* Accessibility */
.bot-widget :focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}