.beebee-ai-chat-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.beebee-ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.beebee-ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.beebee-ai-icon {
    font-size: 24px;
}

.beebee-ai-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.beebee-ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.beebee-ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.beebee-ai-chat-close span {
    font-size: 20px;
    line-height: 1;
}

.beebee-ai-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.beebee-ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.beebee-ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.user-message .beebee-ai-avatar {
    background: #667eea;
}

.ai-message .beebee-ai-avatar {
    background: #10b981;
}

.beebee-ai-message-content {
    flex: 1;
    max-width: 75%;
}

.user-message .beebee-ai-message-content {
    text-align: right;
}

.user-message .beebee-ai-message-content p {
    background: #667eea;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 10px 16px;
    margin: 0;
    word-break: break-word;
}

.ai-message .beebee-ai-message-content p {
    background: #fff;
    color: #374151;
    border-radius: 16px 16px 16px 4px;
    padding: 10px 16px;
    margin: 0;
    word-break: break-word;
    border: 1px solid #e5e7eb;
}

.beebee-ai-chat-actions {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.beebee-ai-chat-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.beebee-ai-tab {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.beebee-ai-tab:hover:not(.disabled) {
    background: #e5e7eb;
}

.beebee-ai-tab.active {
    background: #667eea;
    color: #fff;
}

.beebee-ai-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.beebee-ai-chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#beebee-ai-chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#beebee-ai-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#beebee-ai-chat-input::placeholder {
    color: #9ca3af;
}

.beebee-ai-chat-send-area {
    display: flex;
    justify-content: flex-end;
}

.beebee-ai-chat-send-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.beebee-ai-chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.beebee-ai-chat-send-btn:active {
    transform: translateY(0);
}

.beebee-ai-chat-mode-select {
    margin-top: 10px;
}

.beebee-ai-chat-mode-select select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #374151;
}

.beebee-ai-search-results {
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    background: #fff;
}

.beebee-ai-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.beebee-ai-search-results-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.beebee-ai-search-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.beebee-ai-search-close:hover {
    color: #374151;
}

.beebee-ai-search-results-list {
    max-height: 200px;
    overflow-y: auto;
}

.beebee-ai-search-results-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.beebee-ai-search-item {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.beebee-ai-search-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.beebee-ai-search-item a {
    display: flex;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.beebee-ai-search-thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 6px;
}

.beebee-ai-search-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.beebee-ai-search-info {
    flex: 1;
    min-width: 0;
}

.beebee-ai-search-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beebee-ai-search-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beebee-ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
}

.beebee-ai-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.beebee-ai-loading span {
    color: #6b7280;
    font-size: 14px;
}

.beebee-ai-login-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(243, 244, 246, 0.95);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.beebee-ai-login-box {
    text-align: center;
}

.beebee-ai-login-prompt {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.beebee-ai-login-prompt:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.beebee-ai-login-hint {
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
}

.beebee-ai-login-hint a {
    color: #374151;
    font-weight: 600;
    text-decoration: none;
}

.beebee-ai-login-hint a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .beebee-ai-chat-container {
        margin: 10px;
        border-radius: 8px;
    }

    .beebee-ai-chat-messages {
        height: 300px;
        padding: 12px;
    }

    .beebee-ai-message-content {
        max-width: 85%;
    }

    .beebee-ai-chat-actions {
        padding: 12px;
    }
}