/* ============================================
   CHATBOT ASSISTANT BIEN-ÊTRE
   Styles spécifiques pour l'interface chatbot
   ============================================ */

/* Container principal du chatbot */
.chatbot-wrapper {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 75vh;
    min-height: 600px;
    max-height: 800px;
    border: 1px solid var(--color-neutral-200);
}

/* ============================================
   HEADER DU CHATBOT
   ============================================ */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--spacing-6);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    box-shadow: var(--shadow-md);
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
    line-height: 1.2;
}

.chatbot-subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin: 0;
    margin-top: var(--spacing-1);
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
}

.status-dot-online {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.status-text {
    font-weight: var(--font-weight-medium);
}

/* ============================================
   ZONE DES MESSAGES
   ============================================ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-6);
    background: var(--color-neutral-50);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    scroll-behavior: smooth;
}

/* Scrollbar personnalisée */
.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-400);
}

/* ============================================
   MESSAGES
   ============================================ */
.message-wrapper {
    display: flex;
    gap: var(--spacing-3);
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-wrapper.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: var(--spacing-1);
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.user-message .message-avatar {
    background: var(--color-neutral-300);
    color: var(--color-neutral-700);
}

.message-bubble {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.message-content {
    padding: var(--spacing-4);
    border-radius: var(--radius-lg);
    line-height: 1.6;
    font-size: var(--font-size-base);
    word-wrap: break-word;
}

.bot-bubble .message-content {
    background: white;
    color: var(--color-neutral-800);
    border: 1px solid var(--color-neutral-200);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.user-bubble .message-content {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-500);
    padding: 0 var(--spacing-2);
}

.user-message .message-time {
    text-align: right;
    color: var(--color-neutral-400);
}

/* ============================================
   SUGGESTIONS (CHIPS)
   ============================================ */
.chatbot-suggestions {
    padding: var(--spacing-4) var(--spacing-6);
    background: white;
    border-top: 1px solid var(--color-neutral-200);
    display: flex;
    gap: var(--spacing-2);
    overflow-x: auto;
    flex-wrap: wrap;
}

.chatbot-suggestions::-webkit-scrollbar {
    height: 4px;
}

.chatbot-suggestions::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: 2px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    background: var(--color-neutral-100);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-700);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.suggestion-chip svg {
    stroke-width: 2;
}

.suggestion-chip.hidden {
    display: none;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-indicator {
    display: none;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-4) var(--spacing-6);
    background: white;
    border-top: 1px solid var(--color-neutral-200);
}

.typing-indicator.active {
    display: flex;
}

.typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.typing-text {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-600);
    font-style: italic;
}

/* ============================================
   INPUT ZONE
   ============================================ */
.chatbot-input-container {
    padding: var(--spacing-6);
    background: white;
    border-top: 1px solid var(--color-neutral-200);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.chatbot-input {
    width: 100%;
    padding: var(--spacing-4);
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    line-height: 1.5;
    resize: none;
    transition: all var(--transition-base);
    max-height: 120px;
    min-height: 50px;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(35, 138, 203, 0.1);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-counter {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-500);
}

.char-counter.warning {
    color: var(--color-warning);
    font-weight: var(--font-weight-medium);
}

.char-counter.error {
    color: var(--color-error);
    font-weight: var(--font-weight-bold);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.send-btn:disabled {
    background: var(--color-neutral-300);
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .chatbot-wrapper {
        height: 70vh;
        min-height: 500px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .chatbot-suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .suggestion-chip {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .chatbot-header {
        padding: var(--spacing-4);
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
    }

    .chatbot-title {
        font-size: var(--font-size-lg);
    }

    .chatbot-messages {
        padding: var(--spacing-4);
    }

    .chatbot-input-container {
        padding: var(--spacing-4);
    }
}