/* ===================================
   CHATBOT RAG - RAZI SNIHA
   =================================== */

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

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

.chatbot-button i {
    font-size: 28px;
    color: white;
}

.chatbot-button.active {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8); }
}

/* Fenêtre chatbot */
.chatbot-window {
    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);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

[data-theme="dark"] .chatbot-window {
    background: #1e293b;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

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

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

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

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

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

.chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9fafb;
    scroll-behavior: smooth;
}

[data-theme="dark"] .chatbot-messages {
    background: #0f172a;
}

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

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

.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

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

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

.chat-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.chat-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot .chat-message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .chat-message.bot .chat-message-content {
    background: #334155;
    color: #f1f5f9;
}

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

/* Animation de frappe */
.chat-typing {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Suggestions */
.chatbot-suggestions {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

[data-theme="dark"] .chatbot-suggestions {
    background: #1e293b;
    border-top-color: #334155;
}

.suggestion-btn {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1f2937;
}

[data-theme="dark"] .suggestion-btn {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Zone de saisie */
.chatbot-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
    gap: 10px;
}

[data-theme="dark"] .chatbot-input {
    background: #1e293b;
    border-top-color: #334155;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

[data-theme="dark"] .chatbot-input input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.chatbot-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chatbot-send:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        bottom: 90px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 70vh;
        max-height: 600px;
    }
    
    .chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .chat-message-content {
        max-width: 80%;
        font-size: 14px;
    }
}
