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

/* Toggle Button */
.chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    padding: 0;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-title {
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-title i {
    color: #3b82f6;
}

.chatbot-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.chatbot-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Header Actions */
.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* New Chat Button */
.chatbot-new-chat {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
}

.chatbot-new-chat:hover {
    background: #e0f2fe;
    color: #0369a1;
}

/* Session Info Banner */
.chatbot-session-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #fbbf24;
    font-size: 11px;
    color: #92400e;
}

.chatbot-session-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-session-info button {
    background: rgba(146, 64, 14, 0.1);
    border: 1px solid rgba(146, 64, 14, 0.2);
    color: #92400e;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-session-info button:hover {
    background: rgba(146, 64, 14, 0.2);
}

/* Session Restored Message */
.message.session-restored {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 6px;
    align-self: center;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message.session-restored i {
    font-size: 12px;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.message.system {
    align-self: center;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #3b82f6;
}

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

.chatbot-send-btn:hover {
    background: #2563eb;
}

.chatbot-send-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Context Badge */
.context-badge {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.context-badge i {
    font-size: 10px;
}

.context-close {
    margin-left: auto;
    cursor: pointer;
    color: #93c5fd;
}

.context-close:hover {
    color: #1d4ed8;
}

/* Ask AI Button in Work Items */
.ask-ai-btn {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #3b82f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    opacity: 0;
    /* Hidden by default */
    transform: translateY(5px);
}

.work-item-card:hover .ask-ai-btn {
    opacity: 1;
    transform: translateY(0);
}

.ask-ai-btn:hover {
    background: #3b82f6;
    color: white;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}