/* Modern AI Chatbot Styles */
:root {
    --chat-primary: #ff6b00; /* Matching the orange theme of Alibely */
    --chat-secondary: #007bff;
    --chat-bg: rgba(255, 255, 255, 0.9);
    --chat-text: #333;
    --chat-bubble-size: 60px;
}

[data-bs-theme="dark"] .chatbot-window {
    --chat-bg: rgba(33, 37, 41, 0.95);
    --chat-text: #f8f9fa;
}

/* Chat Toggle Bubble */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--chat-bubble-size);
    height: var(--chat-bubble-size);
    background-color: var(--chat-primary);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle.active {
    transform: scale(0) rotate(90deg);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background: var(--chat-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1049;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.chatbot-header {
    background: var(--chat-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-header-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.chatbot-close {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Chat Body */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message Bubbles */
.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.msg-bot {
    align-self: flex-start;
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 2px;
}

[data-bs-theme="dark"] .msg-bot {
    background: #343a40;
    color: #f8f9fa;
}

.msg-user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Quick Replies */
.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.03);
}

.option-btn {
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid var(--chat-primary);
    background: transparent;
    color: var(--chat-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--chat-primary);
    color: white;
}

/* Input Area */
.chatbot-input {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-input input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

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

.chatbot-input button {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-input button:hover {
    transform: scale(1.1);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: #e9ecef;
    border-radius: 15px;
    width: fit-content;
}

[data-bs-theme="dark"] .typing {
    background: #343a40;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #aaa;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}
