/* Floating Chatbot Widget Button */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(138, 43, 226, 0.6);
}

.chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.chatbot-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chatbot-button:hover .chatbot-tooltip {
    opacity: 1;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(138, 43, 226, 0.7);
    }
}

/* Chatbot Window Popup */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 390px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.chatbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chatbot-window-header {
    padding: 20px;
    background: #7f8999;
    /* background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); */
    border-radius: 16px 16px 0 0;
    color: rgb(0, 0, 0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-window-title {
    font-size: 18px;
    font-weight: 600;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: rgb(0, 0, 0);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-window-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.widget-message {
    margin-bottom: 16px;
    display: flex;
}

.widget-message.user-message {
    justify-content: flex-end;
}

.widget-message.ai-message {
    justify-content: flex-start;
}

.widget-message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.widget-message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.user-message .widget-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-weight: 500;
}

.ai-message .widget-message-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2d3748 !important;
    border-bottom-left-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.widget-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-window-input {
    padding: 16px;
    background: white;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e0e0e0;
}

.widget-input-container {
    display: flex;
    gap: 8px;
}

.widget-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

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

.widget-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.widget-send-btn:hover {
    transform: scale(1.1);
}

.widget-send-btn:active {
    transform: scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-button {
        width: 50px;
        height: 50px;
    }

    .chatbot-button svg {
        width: 24px;
        height: 24px;
    }

    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(80vh - 140px);
        right: 20px;
        bottom: 80px;
    }
}