/* Chat Window - Glassmorphic */
#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 370px;
    height: 520px;
    max-height: 80vh;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

#chatbot-container.chatbot-visible #chatbot-window {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Header */
#chatbot-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
}

/* Dragging state cursor */
.chatbot-dragging, 
.chatbot-dragging #chatbot-toggle, 
.chatbot-dragging #chatbot-header {
    cursor: grabbing !important;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chatbot-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.chatbot-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.chatbot-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 5px;
}

/* Message Area */
#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Messages */
.chatbot-msg {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    animation: chatbot-fade-in-up 0.3s ease forwards;
}

@keyframes chatbot-fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-msg.bot { align-self: flex-start; }
.chatbot-msg.user { align-self: flex-end; }

.chatbot-msg-content {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    white-space: pre-wrap;
}

.chatbot-msg.bot .chatbot-msg-content {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.chatbot-msg.user .chatbot-msg-content {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

/* Typing Indicator */
#chatbot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px 18px 18px 4px;
    align-self: flex-start;
    margin-left: 20px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.chatbot-typing-hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    display: none !important;
}

.chatbot-dot {
    width: 6px;
    height: 6px;
    background-color: #64748b;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s infinite ease-in-out both;
}

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

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Input Area / Form */
#chatbot-form {
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 30px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    font-size: 14px;
    background: white;
    color: #1e293b;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

#chatbot-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

#chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

#chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

#chatbot-send-btn:active { transform: scale(0.95); }
#chatbot-send-btn svg { margin-left: 2px; }
