/* ============================================
   CHATBOT - Design moderne et accessible
   ============================================ */

/* Bouton flottant */
#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chatbot-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    border: none;
    color: var(--white);
    cursor: pointer;
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.4),
        0 4px 12px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: chatbotPulse 2s ease-in-out infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 32px rgba(37, 99, 235, 0.5),
        0 6px 16px rgba(37, 99, 235, 0.4);
    animation: none;
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-icon {
    width: 28px;
    height: 28px;
    stroke: var(--white);
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes chatbotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 8px 24px rgba(37, 99, 235, 0.4),
            0 4px 12px rgba(37, 99, 235, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 12px 32px rgba(37, 99, 235, 0.5),
            0 6px 16px rgba(37, 99, 235, 0.4);
    }
}

/* Modal */
.chatbot-modal {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--white);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.chatbot-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-dark) 100%);
    color: var(--white);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.chatbot-status {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

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

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--gray-50);
}

.chatbot-message {
    display: flex;
    gap: 0.75rem;
    animation: messageAppear 0.3s ease;
}

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

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

.chatbot-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.chatbot-message-content {
    max-width: 75%;
    background: var(--white);
    padding: 0.875rem 1rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-message-user .chatbot-message-content {
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    color: var(--white);
}

.chatbot-message-content p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.chatbot-message-content p:last-child {
    margin-bottom: 0;
}

.chatbot-message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.chatbot-message-content li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.chatbot-suggestions {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.5rem !important;
}

.chatbot-quick-questions {
    list-style: none;
    padding-left: 0 !important;
    margin-top: 0.75rem !important;
}

.chatbot-quick-questions li {
    padding: 0.5rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-quick-questions li:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateX(4px);
}

/* Actions (boutons dans les messages) */
.chatbot-action {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-message-user .chatbot-action {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.chatbot-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    text-align: center;
    width: 100%;
}

.chatbot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Input */
.chatbot-input-container {
    padding: 1rem 1.5rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-light) 100%);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.chatbot-send:active {
    transform: scale(0.95);
}

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

/* Scrollbar personnalisée */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Responsive */
@media (max-width: 768px) {
    #chatbot-container {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .chatbot-icon {
        width: 24px;
        height: 24px;
    }

    .chatbot-modal {
        bottom: 90px;
        right: 20px;
        left: 20px;
        width: auto;
        height: calc(100vh - 110px);
        max-height: calc(100vh - 110px);
    }
}

@media (max-width: 480px) {
    .chatbot-modal {
        bottom: 80px;
        right: 10px;
        left: 10px;
        height: calc(100vh - 90px);
        max-height: calc(100vh - 90px);
        border-radius: 20px;
    }

    .chatbot-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .chatbot-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .chatbot-close svg {
        width: 22px;
        height: 22px;
    }

    .chatbot-messages {
        padding: 1rem;
    }

    .chatbot-input-container {
        padding: 0.875rem 1rem;
    }
}

