/* AI Chatbot Widget Styles */

:root {
    --chatbot-primary: #2563eb;
    --chatbot-primary-dark: #1d4ed8;
    --chatbot-bg: #ffffff;
    --chatbot-text: #1f2937;
    --chatbot-text-light: #6b7280;
    --chatbot-border: #e5e7eb;
    --chatbot-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Chat Button */
.ai-chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s infinite;
}

.ai-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(37, 99, 235, 0.4);
}

.ai-chatbot-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3), 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    50% {
        box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3), 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

/* Chat Window */
.ai-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: var(--chatbot-shadow);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chatbot-window.open {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.ai-chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chatbot-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.ai-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.ai-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-chatbot-close svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Chat Messages */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ai-chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chatbot-message.bot {
    align-items: flex-start;
}

.ai-chatbot-message.user {
    flex-direction: row-reverse;
}

.ai-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-chatbot-message-avatar svg {
    width: 18px;
    height: 18px;
}

.ai-chatbot-message.bot .ai-chatbot-message-avatar {
    background: var(--chatbot-primary);
    color: white;
}

.ai-chatbot-message.bot .ai-chatbot-message-avatar svg {
    fill: white;
}

.ai-chatbot-message.user .ai-chatbot-message-avatar {
    background: #e5e7eb;
    color: var(--chatbot-text);
}

.ai-chatbot-message.user .ai-chatbot-message-avatar svg {
    fill: #4b5563;
}

.ai-chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-chatbot-message.bot .ai-chatbot-message-content {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-chatbot-message.user .ai-chatbot-message-content {
    background: var(--chatbot-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.ai-chatbot-typing {
    display: none;
    align-items: center;
    gap: 10px;
}

.ai-chatbot-typing.active {
    display: flex;
}

.ai-chatbot-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.ai-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-text-light);
    animation: typing 1.4s infinite;
}

.ai-chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chatbot-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;
    }
}

/* Chat Input */
.ai-chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
}

.ai-chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-chatbot-input {
    flex: 1;
    border: 1px solid var(--chatbot-border);
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.ai-chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

.ai-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chatbot-send:hover:not(:disabled) {
    background: var(--chatbot-primary-dark);
    transform: scale(1.05);
}

.ai-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Error Message */
.ai-chatbot-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 20px;
    display: none;
}

.ai-chatbot-error.show {
    display: block;
}

/* Responsive */
@media (max-width: 480px) {
    .ai-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 80px;
    }

    .ai-chatbot-button {
        right: 10px;
        bottom: 10px;
    }
}

/* Position: Bottom Left */
.ai-chatbot-position-bottom-left .ai-chatbot-button {
    left: 20px;
    right: auto;
}

.ai-chatbot-position-bottom-left .ai-chatbot-window {
    left: 20px;
    right: auto;
}

@media (max-width: 480px) {
    .ai-chatbot-position-bottom-left .ai-chatbot-button {
        left: 10px;
    }

    .ai-chatbot-position-bottom-left .ai-chatbot-window {
        left: 10px;
    }
}