/* Chatbot Global Styles */
:root {
    --chatbot-primary: #007bff;
    --chatbot-secondary: #f0f2f5;
    --chatbot-background: #ffffff;
    --chatbot-text-primary: #212529;
    --chatbot-text-secondary: #ffffff;
    --chatbot-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Bubble */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--chatbot-primary);
    color: var(--chatbot-text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    z-index: 9998;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 370px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background-color: var(--chatbot-background);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 9999;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    background-color: var(--chatbot-primary);
    color: var(--chatbot-text-secondary);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-title {
    font-size: 1.1rem;
}

.chat-close {
    background: none;
    border: none;
    color: var(--chatbot-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

/* Chat Body */
.chat-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: var(--chatbot-font);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    display: flex;
    max-width: 85%;
}

.chat-message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.user .chat-message-content {
    background-color: var(--chatbot-primary);
    color: var(--chatbot-text-secondary);
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.bot .chat-message-content {
    background-color: var(--chatbot-secondary);
    color: var(--chatbot-text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.bot.typing .chat-message-content {
    display: flex;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-animation 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-animation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat Footer */
.chat-footer {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

#chatInput {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#chatInput:focus {
    border-color: var(--chatbot-primary);
}

#chatSend {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chatbot-primary);
    transition: color 0.2s;
}

#chatSend:hover {
    color: #0056b3;
}