/* Chatbot Floating Button */
.chatbot-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    /* Indigo/Violet Gradient */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
    /* Matching shadow */
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.7);
}

.chatbot-fab.active {
    transform: rotate(90deg);
    background: #ef4444;
    /* Red to close */
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.chatbot-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    /* Dark Indigo Header */
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.bot-avatar {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #a5b4fc;
    /* Light indigo border */
    display: flex;
    justify-content: center;
    align-items: center;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-info span {
    font-size: 0.85rem;
    color: #a5b4fc;
    /* Light indigo text */
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    /* Green status dot */
    border-radius: 50%;
    box-shadow: 0 0 5px #22c55e;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    color: #334155;
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: #6366f1;
    /* Primary Indigo color */
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    border-bottom-right-radius: 4px;
}

/* Markdown Styles in Bot Messages */
.message.bot ul {
    padding-left: 20px;
    margin: 5px 0;
}

.message.bot li {
    margin-bottom: 5px;
}

.message.bot strong {
    color: #4338ca;
    font-weight: 700;
}

/* Darker indigo for emphasis */
.message.bot p {
    margin: 0 0 10px;
}

.message.bot p:last-child {
    margin: 0;
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    background: #f1f5f9;
    border: 2px solid transparent;
    padding: 12px 16px;
    border-radius: 99px;
    color: #334155;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    background: white;
    border-color: #6366f1;
    /* Focus color */
}

.chat-send-btn {
    background: #4f46e5;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-send-btn:hover {
    background: #4338ca;
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
    padding: 15px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    display: none;
    gap: 5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}