/* ==========================================================================
   Chatbot Styles
   ========================================================================== */

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Chatbot Container */
.chatbot-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 480px;
    height: 520px;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chatbot-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-info p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.8;
    transition: var(--transition);
}

.chatbot-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--gray-50);
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: var(--primary);
    color: white;
}

.user-message .message-avatar {
    background: var(--gray-300);
    color: var(--text-primary);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: var(--primary);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
    background: white;
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
    box-shadow: var(--shadow-sm);
}

.message-content {
    padding: 12px 16px;
    max-width: 80%;
    line-height: 1.4;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.quick-question {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.quick-question:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* Chatbot Input */
.chatbot-input {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

#chatbotInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

#chatbotInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-button {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
}

.chatbot-footer {
    text-align: center;
}

.chatbot-footer small {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.chatbot-footer a {
    color: var(--primary);
    text-decoration: none;
}

.chatbot-footer a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 70vh;
        right: -10px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}