.chatbot-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 30px auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    scroll-margin-top: 100px;
}

/* Slim State (Closed) */
.chatbot-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(212, 163, 115, 0.1), rgba(192, 110, 82, 0.05));
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
}

.chatbot-header:hover {
    background: linear-gradient(135deg, rgba(212, 163, 115, 0.15), rgba(192, 110, 82, 0.1));
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.chatbot-toggle-icon {
    transition: transform 0.3s ease;
}

.chatbot-container.open {
    resize: vertical;
    min-height: 400px;
}

.chatbot-container.open .chatbot-toggle-icon {
    transform: rotate(180deg);
}

/* Expanded State (Open) */
.chatbot-body {
    display: none;
    flex-direction: column;
    flex: 1;
    border-top: 1px solid var(--color-border);
}

.chatbot-container.open .chatbot-body {
    display: flex;
}

.chatbot-messages {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
    position: relative;
}

/* Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    text-align: left;
}

.chat-msg.bot {
    align-self: flex-start;
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
    scroll-margin-top: 120px;
}

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

/* Input Area */
.chatbot-input-area {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--color-border);
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.chatbot-send-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #a0a0a0;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Bounce Animation */
@keyframes bounce { 
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 
    40% { transform: translateY(-8px); } 
    60% { transform: translateY(-4px); } 
}

.bounce-animation { 
    animation: bounce 2s infinite; 
}
