/* ===========================================
   CHATBOT WIDGET
   =========================================== */

.chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.chatbot-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(48, 60, 222, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(48, 60, 222, 0.6);
}

.chatbot-button.active {
    background: var(--yellow);
    color: var(--black);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(48, 60, 222, 0.4); }
    50% { box-shadow: 0 8px 32px rgba(48, 60, 222, 0.7); }
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 9998;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.chatbot-header-text h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.chatbot-header-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--off-white);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.message-avatar.bot {
    background: var(--blue);
    color: var(--white);
}

.message-avatar.user {
    background: var(--yellow);
    color: var(--black);
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.bot {
    background: var(--white);
    color: var(--gray-dark);
    border-bottom-left-radius: 4px;
}

.message-bubble.user {
    background: var(--blue);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: var(--white);
    border: 2px solid var(--blue);
    color: var(--blue);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reply-btn:hover {
    background: var(--blue);
    color: var(--white);
}

.chatbot-input-wrapper {
    padding: 16px;
    background: var(--white);
    border-top: 1px solid #E5E5E5;
}

.chatbot-input-form {
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E5E5;
    border-radius: 24px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

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

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.chatbot-send:hover {
    background: var(--blue-dark);
    transform: scale(1.05);
}

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

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-medium);
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Mobile responsive */
@media (max-width: 640px) {
    .chatbot-window {
        bottom: 88px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
    
    .chatbot-button {
        bottom: 16px;
        right: 16px;
    }
}
