/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #864FFE 0%, #A585FF 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(134, 79, 254, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(134, 79, 254, 0.4);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    z-index: 1001;
    pointer-events: auto;
}

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

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

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

.chatbot-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
}

.chatbot-header-right {
    display: flex;
    gap: 8px;
}

.chatbot-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
    max-height: 400px;
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    scroll-behavior: smooth;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.chatbot-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
}

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

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

.chatbot-message.assistant .chatbot-message-avatar {
    background: linear-gradient(135deg, #864FFE 0%, #A585FF 100%);
    color: white;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #e5e7eb;
    color: #374151;
}

.chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chatbot-message.assistant .chatbot-message-bubble {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.chatbot-message.user .chatbot-message-bubble {
    background: #864FFE;
    color: white;
}

.chatbot-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: center;
}

.chatbot-input {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.chatbot-input-field:focus {
    border-color: #864FFE;
}

.chatbot-input-field::placeholder {
    color: #9ca3af;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: #864FFE;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.chatbot-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.chatbot-loading-dots {
    display: flex;
    gap: 4px;
}

.chatbot-loading-dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: chatbot-pulse 1.5s infinite;
}

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

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

@keyframes chatbot-pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Tablet Responsive */
@media (max-width: 768px) and (min-width: 481px) {
    .chatbot-window {
        width: 350px;
        height: 450px;
        bottom: 75px;
    }
    
    .chatbot-messages {
        max-height: 350px;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 65px;
        right: 15px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 70vh;
        max-height: 500px;
        min-height: 300px;
        bottom: 85px;
        right: 10px;
        left: 10px;
        margin: 0;
        max-width: none;
        position: fixed;
    }
    
    /* Prevent body scroll when chat is open on mobile */
    body.chat-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }
    
    .chatbot-messages {
        max-height: 250px;
        min-height: 150px;
        padding: 15px;
        gap: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .chatbot-input {
        padding: 12px 15px;
    }
    
    .chatbot-header {
        padding: 12px 15px;
    }
    
    .chatbot-logo {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .chatbot-title {
        font-size: 14px;
    }
    
    .chatbot-status {
        font-size: 11px;
    }
    
    .chatbot-message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chatbot-message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1f2937;
        border-color: #374151;
    }
    
    .chatbot-messages {
        background: #111827;
    }
    
    .chatbot-message.assistant .chatbot-message-bubble {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    
    .chatbot-input {
        background: #1f2937;
        border-color: #374151;
    }
    
    
    .chatbot-input-field {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .chatbot-input-field::placeholder {
        color: #9ca3af;
    }
}
