/* 🤖 HESK-AI Chatbot Widget V2 */

/* Bouton flottant */
#heskai-chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

#heskai-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

#heskai-chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Badge de notification */
#heskai-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
}

#heskai-chatbot-badge.visible {
    display: flex;
}

/* Conteneur popup */
#heskai-chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

#heskai-chatbot-widget.visible {
    display: flex;
}

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

/* Header */
#heskai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#heskai-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#heskai-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.3s ease;
}

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

/* Messages */
#heskai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.heskai-message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

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

.heskai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.heskai-message.assistant .heskai-message-content {
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 4px;
}

.heskai-message.user .heskai-message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Loading indicator */
.heskai-loading {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
}

.heskai-loading-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.heskai-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.heskai-loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input */
#heskai-chatbot-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#heskai-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

#heskai-chatbot-input:focus {
    border-color: #667eea;
}

#heskai-chatbot-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#heskai-chatbot-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* Options boutons */
.heskai-message-options {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.heskai-option-button {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.heskai-option-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    #heskai-chatbot-widget {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        right: 15px;
        bottom: 80px;
    }

    #heskai-chatbot-button {
        bottom: 15px;
        right: 15px;
    }
}

/* Ticket info */
.heskai-ticket-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 13px;
}

.heskai-ticket-info strong {
    color: #1976d2;
}

/* Badges statut */
.heskai-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.heskai-status-verified {
    background: #c8e6c9;
    color: #2e7d32;
}

.heskai-status-pending {
    background: #fff3cd;
    color: #856404;
}

.heskai-status-escalated {
    background: #f8d7da;
    color: #721c24;
}

.heskai-status-resolved {
    background: #d4edda;
    color: #155724;
}
