/* =====================
   Chatbot Variables
===================== */
:root {
    --chat-bg: #ffffff;
    --primary: #222222;
    --primary-hover: #333333;
    --bot-bg: #f4f4f6;
    --text-dark: #333;
    --border-light: #e6e6e6;
    --radius: 14px;
    --transition: 0.3s ease;
}

/* =====================
   Chatbot Container
===================== */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--chat-bg);
    border-radius: var(--radius);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: var(--transition);
    visibility: hidden;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* =====================
   Header
===================== */
.chatbot-header {
    background: linear-gradient(135deg, #1c1c1c, #2e2e2e);
    color: white;
    padding: 18px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

/* =====================
   Messages Area
===================== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* =====================
   Messages
===================== */
.message {
    display: flex;
    animation: messageIn 0.25s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot-message {
    justify-content: flex-start;
}

.message.user-message {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 78%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 14px;
}

/* Bot Bubble */
.bot-message .message-bubble {
    background: var(--bot-bg);
    color: var(--text-dark);
    border-radius: 14px 14px 14px 6px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}

/* User Bubble */
.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border-radius: 14px 14px 6px 14px;
}

/* =====================
   Input Area
===================== */
.chatbot-input-area {
    padding: 14px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    background: #fafafa;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chatbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(34,34,34,0.15);
}

/* Send Button */
.chatbot-send {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.chatbot-send:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* =====================
   Floating Toggle Button
===================== */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1c1c1c, #333);
    border-radius: 50%;
    color: white;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 9998;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =====================
   Mobile
===================== */
@media (max-width: 768px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-header {
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
}