/* Chatbot Widget Styles */

#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.5rem;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(13, 148, 136, 0.5);
}

.chatbot-button:active {
    transform: scale(0.95);
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

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

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-header .subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

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

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

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

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

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

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

.message.user {
    flex-direction: row-reverse;
}

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

.message.bot .message-avatar {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

.message.user .message-avatar {
    background: #e2e8f0;
    color: #475569;
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message.bot .message-bubble {
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.375rem;
    padding: 0 0.5rem;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

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

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 0.875rem 1.125rem;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

/* Chatbot Input */
.chatbot-input {
    padding: 1.25rem 1.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 0.75rem 1.125rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #0d9488;
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

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

/* Token Counter */
.token-counter {
    font-size: 0.75rem;
    color: #64748b;
    padding: 0.5rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.token-counter.warning {
    color: #f59e0b;
    background: #fffbeb;
}

.token-counter.danger {
    color: #ef4444;
    background: #fef2f2;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 2rem 1.5rem;
    color: #64748b;
}

.welcome-message i {
    font-size: 3rem;
    color: #0d9488;
    margin-bottom: 1rem;
}

.welcome-message h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    font-size: 0.9rem;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
    }

    #chatbot-widget {
        right: 10px;
        bottom: 10px;
    }

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

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

/* Error Message */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    border-left: 3px solid #dc2626;
}
