/**
 * Chatbot Widget Styles
 * Modern floating chat widget for Emotion Trip AI Assistant
 */

/* Chatbot Button (Floating) */
.chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(17, 85, 184, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(17, 85, 184, 0.6);
}

.chatbot-button i {
    font-size: 28px;
    color: white;
}

.chatbot-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

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

/* Chatbot Header */
.chatbot-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

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

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar i {
    font-size: 20px;
    color: var(--primary-color);
}

.chatbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

/* Chat Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Messages */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

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

.chat-message.assistant {
    align-self: flex-start;
}

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

.message-avatar.user-avatar {
    background: var(--gradient-primary);
    color: white;
}

.message-avatar.assistant-avatar {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.message-avatar i {
    font-size: 16px;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.chat-message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    max-width: 80px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    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% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Chat Input */
.chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

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

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(17, 85, 184, 0.3);
}

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

.chatbot-send-btn i {
    font-size: 16px;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.welcome-message i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.welcome-message h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 14px;
    margin: 0;
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-header {
        border-radius: 0;
    }

    .chatbot-button {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }

    .chat-message {
        max-width: 85%;
    }
}

/* Loading State */
.chatbot-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chatbot-loading .spinner-border {
    color: var(--primary-color);
}

/* Error Message */
.chat-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 10px;
    font-size: 14px;
}
