/* Chatbot Styles */
#chatbot-widget {
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

/* Floating Button */
.chatbot-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-accent, #c9a961);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 999;
    color: #1a1a1a;
}

.chatbot-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-accent, #c9a961);
}

.chatbot-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

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

.chatbot-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.chatbot-icon-btn:hover {
    opacity: 0.8;
}

/* API Key Setup */
.chatbot-api-setup {
    padding: 16px;
    background-color: #fff3cd;
    border-bottom: 1px solid #ffc107;
}

.chatbot-api-label {
    margin: 0 0 8px;
    font-size: 13px;
    color: #856404;
}

.chatbot-api-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.chatbot-save-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--color-accent, #c9a961);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.chatbot-save-btn:hover {
    opacity: 0.9;
}

.chatbot-api-hint {
    margin: 8px 0 0;
    font-size: 11px;
    color: #666;
}

.chatbot-api-hint a {
    color: #0066cc;
    text-decoration: none;
}

.chatbot-api-hint a:hover {
    text-decoration: underline;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #f8f9fa;
}

.chatbot-message {
    display: flex;
    margin-bottom: 12px;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message.assistant {
    justify-content: flex-start;
}

.chatbot-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbot-message.user .chatbot-message-content {
    background-color: var(--color-accent, #c9a961);
    color: #1a1a1a;
}

.chatbot-message.assistant .chatbot-message-content {
    background-color: #fff;
    color: #333;
}

.chatbot-message.error .chatbot-message-content {
    background-color: #f8d7da;
    color: #721c24;
}

.chatbot-loading {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.chatbot-loading-content {
    padding: 10px 14px;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    opacity: 0.6;
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
    display: flex;
    gap: 8px;
}

.chatbot-text-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-text-input:focus {
    border-color: var(--color-accent, #c9a961);
}

.chatbot-text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--color-accent, #c9a961);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    color: #1a1a1a;
}

.chatbot-send-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 20px) !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}
