/* Floating Chatbot Styles */
.floating-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.04);
    transition: all 0.3s ease;
    position: relative;
    color: white;
    font-size: 24px;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.04);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

.chatbot-toggle.minimized {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 70vh !important;
    max-height: 90vh !important;
    min-height: 420px !important;
    background: #f4f6fa !important;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-window {
    border-radius: 22px !important;
    box-shadow: 0 12px 32px rgba(37,99,235,0.10), 0 2px 8px rgba(0,0,0,0.04);
    padding-bottom: 8px;
}

.chat-messages, .conversation-list {
    padding: 24px 18px 18px 18px !important;
    gap: 18px;
}

.chat-message {
    margin-bottom: 18px !important;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
    flex-wrap: wrap;
    gap: 10px;
}

/* Add more spacing for header and controls */
.chatbot-header {
    padding: 20px 24px 16px 24px !important;
    border-radius: 22px 22px 0 0 !important;
}

/* Counters */
.chatbot-counters {
    display: flex;
    gap: 15px;
    font-size: 12px;
    align-items: center;
}

.llm-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.llm-counter.low-quota {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.llm-counter.depleted {
    background: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* Conversation Sidebar */
.conversation-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-sidebar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.conversation-list {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: linear-gradient(135deg, #E0F2FE 0%, #F0F9FF 100%);
    max-height: calc(100vh - 200px);
    scroll-behavior: smooth;
}

.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.conversation-list {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.conversation-item:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.conversation-item.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15);
}

.convo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.convo-details {
    flex: 1;
    min-width: 0;
}

.convo-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.convo-date {
    font-size: 12px;
    color: #666;
}

.delete-conversation-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.delete-conversation-btn:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.1);
}

.no-conversations {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-conversations i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.no-conversations p {
    margin: 0;
    font-size: 14px;
}

.sidebar-new-chat {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: rgba(37, 99, 235, 0.05);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.new-chat-btn {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
}

/* Boost Pack Button */
.boost-pack-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1), 0 2px 4px -1px rgba(245, 158, 11, 0.06);
}

.boost-pack-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(245, 158, 11, 0.2), 0 4px 6px -2px rgba(245, 158, 11, 0.1);
}

/* AI Badge */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Responsive adjustments for counters */
@media (max-width: 480px) {
    .chatbot-counters {
        gap: 8px;
    }
    
    .llm-counter {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .chatbot-header {
        padding: 12px 15px;
    }
    
    .conversation-list {
        max-height: calc(100vh - 150px);
        padding: 10px;
    }
    
    .conversation-item {
        padding: 10px;
        margin-bottom: 6px;
    }
}



.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

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

.chatbot-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

.chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-btn:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.chatbot-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Ensure buttons are always clickable */
.chatbot-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
    z-index: 10;
}

.chatbot-controls .chatbot-btn {
    position: relative;
    z-index: 15;
    pointer-events: auto !important;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    min-height: 200px;
}



.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    border: 2px solid #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Message Styles */
.chat-message {
    display: flex;
    margin-bottom: 10px;
    width: 100%;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
}

.bot-message .message-content, .chat-messages .bot-message .message-content {
    background: #fff !important;
    color: #222 !important;
    border: 1.5px solid #e3e9f7 !important;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 12px 0 rgba(37,99,235,0.07) !important;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

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

.bot-message .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator .message-content {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f2ff 100%);
    border: 1px solid #d1e7ff;
    padding: 15px 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #c1c1c1;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span: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;
    }
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 15px;
}

#chat-input {
    flex: 1;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    max-height: 120px;
    min-height: 44px;
    background: #f8fafc;
    color: #111 !important;
}

#chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#chat-input:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
}

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

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2563eb;
    font-family: inherit;
}

.quick-action-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.boost-pack-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #f59e0b;
    font-weight: 600;
}

.boost-pack-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.1), 0 4px 6px -2px rgba(245, 158, 11, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .floating-chatbot {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 60vh;
        bottom: 80px;
        right: 0;
        border-radius: 15px 15px 0 0;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    

}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 10px);
        height: 70vh;
        right: 5px;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .quick-actions {
        gap: 6px;
    }
    
    .quick-action-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .chat-messages {
        background: #1a202c;
    }
    
    .bot-message .message-content, .chat-messages .bot-message .message-content {
        background: #fff !important;
        color: #222 !important;
        border: 1.5px solid #e3e9f7 !important;
    }
    
    #chat-input {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    #chat-input:focus {
        border-color: #667eea;
    }
    
    .quick-action-btn {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #2d3748;
    }
    
    .chat-input-area {
        background: #2d3748;
        border-top-color: #4a5568;
    }
} 

/* Force light grey background for chatbot conversation area */
.chatbot-window, .chat-messages, .conversation-list {
    background: #f4f6fa !important;
} 

/* Hidden state for chatbot window */
.chatbot-window.hidden {
    display: none !important;
}

/* Make conversation bubbles friendlier */
.user-message .message-content, .bot-message .message-content {
    border-radius: 18px !important;
    margin-bottom: 6px !important;
    font-size: 1.04rem !important;
    padding: 14px 18px !important;
}

#chat-input {
    border-radius: 18px !important;
    padding: 16px 20px !important;
    font-size: 1.08rem !important;
    border: 2px solid #e0e7ef !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: 0 2px 8px rgba(37,99,235,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
#chat-input:focus, #chat-input:hover {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
    background: #f8faff !important;
}
#chat-input::placeholder {
    color: #888 !important;
    opacity: 1;
}

.send-btn {
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.send-btn:hover {
    background: #2563eb !important;
    box-shadow: 0 6px 18px rgba(37,99,235,0.18);
    transform: scale(1.08);
} 

.chatbot-window {
    display: flex !important;
    flex-direction: column !important;
    height: 500px;
}

.chat-messages, .conversation-list {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

.chat-input-area, .input-container {
    flex-shrink: 0 !important;
} 

.chatbot-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 8px 12px 6px 12px !important;
    min-height: unset !important;
    gap: 0 !important;
}

.chatbot-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.chatbot-header-row:first-child {
    margin-bottom: 2px !important;
}

.chatbot-title {
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
}

.chatbot-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.chatbot-counters, .chatbot-controls {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.chatbot-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
    padding: 0 !important;
}

.quick-actions {
    gap: 6px !important;
    margin-top: 8px !important;
    margin-bottom: 2px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}

.quick-action-btn {
    padding: 2px 7px !important;
    font-size: 0.85rem !important;
    border-radius: 9px !important;
    margin-bottom: 0 !important;
    min-width: 0 !important;
    height: 28px !important;
    line-height: 1.1 !important;
}

.input-container {
    margin-bottom: 4px !important;
} 

#chat-input {
    padding: 10px 12px !important;
    font-size: 0.97rem !important;
    min-height: 36px !important;
    border-radius: 12px !important;
}

.input-container {
    margin-bottom: 0 !important;
}

.quick-actions {
    gap: 4px !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.quick-action-btn {
    padding: 4px 8px !important;
    font-size: 0.93rem !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
} 