/* Widget Chat IA - Styles */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Bulle flottante */
.chat-widget__bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget__bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
}

.chat-widget--open .chat-widget__bubble {
    background: #6c757d;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

/* Container du chat */
.chat-widget__container {
    display: none;
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 370px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.chat-widget--open .chat-widget__container {
    display: flex;
}

/* Header */
.chat-widget__header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.chat-widget__header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget__header-title i {
    font-size: 20px;
}

.chat-widget__header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-widget__header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Zone des messages */
.chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-widget__messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget__messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-widget__messages::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

/* Messages */
.chat-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    animation: fadeIn 0.2s ease;
}

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

.chat-message--user {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message--assistant {
    background: white;
    color: #212529;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-message--loading {
    color: #6c757d;
    font-style: italic;
}

/* Animation de chargement */
.chat-message--loading::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Formulaire */
.chat-widget__form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
    gap: 10px;
}

.chat-widget__form input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    padding: 12px 18px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-widget__form input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.chat-widget__form input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.chat-widget__form button {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-widget__form button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.chat-widget__form button:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget__container {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: 0;
        border-radius: 16px 16px 0 0;
    }

    .chat-widget {
        bottom: 10px;
        right: 10px;
    }
}
