/* =============================================
   Chatbot Widget - Style Moderne
   ============================================= */

/* Bouton flottant */
.chatbot-button {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.6);
}

.chatbot-button svg {
    width: 36px;
    height: 36px;
    fill: #fff;
}

.chatbot-button.active {
    transform: rotate(90deg);
}

/* Pulse effect pour attirer l'attention */
.chatbot-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.4);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Badge de notification */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Fenêtre du chatbot */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

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

/* Header du chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

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

.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 0.8;
}

.chatbot-close svg {
    width: 24px;
    height: 24px;
}

/* Corps du chatbot */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Messages */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

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

.chatbot-message.user {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.chatbot-message.bot .chatbot-message-avatar {
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    color: #fff;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #e2e8f0;
    color: #64748b;
}

.chatbot-message-content {
    max-width: 75%;
}

.chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chatbot-message.bot .chatbot-message-bubble {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chatbot-message.user .chatbot-message-bubble {
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chatbot-message-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

/* Message de typing */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out 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.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Footer du chatbot */
.chatbot-footer {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

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

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Message d'accueil */
.chatbot-welcome {
    text-align: center;
    padding: 40px 20px;
}

.chatbot-welcome-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(147, 112, 219, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.chatbot-welcome h4 {
    color: #1e293b;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.chatbot-welcome p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Suggestions rapides */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chatbot-suggestion {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.chatbot-suggestion:hover {
    background: linear-gradient(135deg, #D4AF37, #9370DB);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chatbot-button {
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-button svg {
        width: 32px;
        height: 32px;
    }
}
