/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Bouton Flottant */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    animation: pulse 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chatbot-button.active {
    animation: none;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.chatbot-button-icon {
    font-size: 28px;
    transition: all 0.3s ease;
}

.chatbot-button.active .chatbot-button-icon {
    transform: rotate(0deg);
    font-size: 32px;
}

/* Badge de notification */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid white;
}

/* Animation pulse */
@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 du Chat */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header du Chat */
.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;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: rotate(90deg);
}

/* Corps du Chat */
.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Messages */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot {
    flex-direction: row;
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #94a3b8;
}

.chatbot-message-content {
    max-width: 75%;
}

.chatbot-message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    line-height: 1.5;
    font-size: 14px;
    color: #1e293b;
}

.chatbot-message.user .chatbot-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chatbot-message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
    padding: 0 5px;
}

/* Suggestions Rapides */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-suggestion-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.chatbot-suggestion-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Message d'attente (typing) */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* WhatsApp Button */
.chatbot-whatsapp-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.chatbot-whatsapp-btn:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Footer du Chat */
.chatbot-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Inter', sans-serif;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Message de bienvenue */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.chatbot-welcome h4 {
    color: #1e293b;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        max-height: 600px;
        bottom: 80px;
        right: 20px;
        left: 20px;
    }
    
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-button {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-suggestion-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}
