/* LLM Chat Widget Styles */

.llm-chat-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Position variations */
.llm-chat-widget.llm-chat-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.llm-chat-widget.llm-chat-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.llm-chat-widget.llm-chat-position-top-right {
    top: 20px;
    right: 20px;
}

.llm-chat-widget.llm-chat-position-top-left {
    top: 20px;
    left: 20px;
}

/* Toggle Button */
.llm-chat-toggle {
    width: 60px;
    height: 60px;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: white;
}

.llm-chat-toggle:hover {
    background: #005a87;
    transform: scale(1.05);
}

/* Chat Container */
.llm-chat-container {
    position: absolute;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Container position based on widget position */
.llm-chat-position-bottom-right .llm-chat-container,
.llm-chat-position-bottom-left .llm-chat-container {
    bottom: 80px;
}

.llm-chat-position-top-right .llm-chat-container,
.llm-chat-position-top-left .llm-chat-container {
    top: 80px;
}

.llm-chat-position-bottom-right .llm-chat-container,
.llm-chat-position-top-right .llm-chat-container {
    right: 0;
}

.llm-chat-position-bottom-left .llm-chat-container,
.llm-chat-position-top-left .llm-chat-container {
    left: 0;
}

/* Chat Header */
.llm-chat-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.llm-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.llm-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.llm-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages Area */
.llm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.llm-chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.llm-chat-message.user {
    align-self: flex-end;
    background: #0073aa;
    color: white;
    border-bottom-right-radius: 4px;
}

.llm-chat-message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.llm-chat-message.loading {
    align-self: flex-start;
    background: white;
    padding: 15px;
}

.llm-chat-loading-dots {
    display: flex;
    gap: 5px;
}

.llm-chat-loading-dots span {
    width: 8px;
    height: 8px;
    background: #0073aa;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.llm-chat-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.llm-chat-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input Container */
.llm-chat-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.llm-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.llm-chat-input:focus {
    border-color: #0073aa;
}

.llm-chat-send {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.llm-chat-send:hover {
    background: #005a87;
}

.llm-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Scrollbar styling */
.llm-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.llm-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.llm-chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.llm-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}
