/**
 * Chatbot Widget Styles
 */

/* Bouton flottant */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chatbot-toggle--hidden {
    opacity: 0;
    pointer-events: none;
}

/* Fenêtre du chatbot */
.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
}

.chatbot-window--hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

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

.chatbot-header__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-header__icon {
    font-size: 20px;
}

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

.chatbot-header__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.chatbot-welcome {
    text-align: center;
    padding: 40px 20px;
}

.chatbot-welcome__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chatbot-welcome h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.chatbot-welcome p {
    color: #6b7280;
    font-size: 14px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

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

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

.chatbot-message--user .chatbot-message__avatar {
    background: #3b82f6;
}

.chatbot-message--assistant .chatbot-message__avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chatbot-message--system .chatbot-message__avatar {
    background: #ef4444;
}

.chatbot-message__content {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.chatbot-message--user .chatbot-message__content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message--assistant .chatbot-message__content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chatbot-message--system .chatbot-message__content {
    background: #fee2e2;
    color: #991b1b;
    border-bottom-left-radius: 4px;
}

.chatbot-message__content a {
    color: inherit;
    text-decoration: underline;
}

/* Input */
.chatbot-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.chatbot-input__field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input__field:focus {
    border-color: #667eea;
}

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

.chatbot-input__button:hover {
    transform: scale(1.05);
}

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

/* Loading */
.chatbot-loading {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
}

.chatbot-loading--hidden {
    display: none;
}

.chatbot-loading__dots {
    display: flex;
    gap: 6px;
}

.chatbot-loading__dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-loading__dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.chatbot-loading__dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}
