/**
 * HLI Chatbot Widget - Floating Button & Window
 */

/* Widget Container */
.hli-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Toggle Button */
.hli-chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
}

.hli-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.hli-chatbot-toggle:active {
    transform: scale(0.95);
}

/* Badge (notification) */
.hli-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #fff;
}

/* Chatbot Window */
.hli-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.hli-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.hli-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.hli-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
}

.hli-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tabs */
.hli-chatbot-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.hli-chatbot-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.hli-chatbot-tab:hover {
    color: #667eea;
}

.hli-chatbot-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Chatbot Content */
.hli-chatbot-content {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
}

.hli-chatbot-buttons-container {
    padding: 0;
    min-height: 100%;
}

/* Input Area */
.hli-chatbot-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hli-chatbot-input-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.hli-chatbot-input-field:focus {
    border-color: #667eea;
}

.hli-chatbot-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hli-chatbot-send-btn:hover {
    background: #5a6fd6;
}

.hli-chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading State */
.hli-chatbot-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hli-chatbot-loading p {
    font-size: 14px;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hli-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }

    .hli-chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .hli-chatbot-window {
        bottom: 70px;
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
}

@media (max-width: 480px) {
    .hli-chatbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .hli-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
}

/* Open State */
.hli-chatbot-widget.open .hli-chatbot-toggle svg {
    transform: rotate(45deg);
}

/* Scrollbar Styling */
.hli-chatbot-content::-webkit-scrollbar {
    width: 6px;
}

.hli-chatbot-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.hli-chatbot-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.hli-chatbot-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Tab Content Transition */
.tab-exit {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tab-enter {
    animation: tabFadeIn 0.15s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
