/* Animations pour le chat */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Container des messages - style Apple Messages */
[data-conventionnement-chat-target="messagesContainer"] {
    background: #ffffff !important;
    border: none !important;
    padding: 16px !important;
}

/* Scrollbar personnalisée pour le chat */
[data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar {
    width: 6px;
}

[data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar-track {
    background: transparent;
}

[data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar-thumb {
    background: #d1d1d6;
    border-radius: 3px;
}

[data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar-thumb:hover {
    background: #aeaeb2;
}

/* Bulles de messages - style Apple */
.chat-message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    margin-bottom: 2px;
}

/* Messages de l'utilisateur (bleu, à droite) */
.chat-message-own .chat-message-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Messages des autres (gris, à gauche) */
.chat-message-other .chat-message-bubble {
    background: #E5E5EA;
    color: #000000;
    border-bottom-left-radius: 4px;
}

/* Texte dans les bulles */
.chat-message-content {
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

/* Métadonnées (nom, organisme) */
.chat-message-meta {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.chat-message-own .chat-message-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message-other .chat-message-meta {
    color: rgba(0, 0, 0, 0.6);
}

/* Timestamp */
.chat-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

.chat-message-own .chat-message-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-message-other .chat-message-time {
    color: rgba(0, 0, 0, 0.5);
}

/* Groupement des messages */
.chat-message-group {
    margin-bottom: 12px;
}

/* Formulaire d'envoi - style Apple */
.chat-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: #f6f6f6;
    border-radius: 20px;
}

.chat-input-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 15px;
    outline: none;
}

.chat-input-form input::placeholder {
    color: #8e8e93;
}

.chat-input-form button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #007AFF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.chat-input-form button:hover {
    background: #0051D5;
}

.chat-input-form button:disabled {
    background: #c7c7cc;
    cursor: not-allowed;
}

/* Animation des points de frappe */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    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);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator {
    transition: opacity 0.3s;
}

/* Bouton nouveaux messages */
.new-messages-button {
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

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

/* ===== Dark Mode Chat Styles ===== */
[data-bs-theme="dark"] [data-conventionnement-chat-target="messagesContainer"] {
    background: #212529 !important;
}

[data-bs-theme="dark"] [data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar-thumb {
    background: #495057;
}

[data-bs-theme="dark"] [data-conventionnement-chat-target="messagesContainer"]::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

[data-bs-theme="dark"] .chat-message-other .chat-message-bubble {
    background: #495057;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .chat-message-other .chat-message-meta {
    color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .chat-message-other .chat-message-time {
    color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .chat-input-form {
    background: #343a40;
}

[data-bs-theme="dark"] .chat-input-form input {
    color: #dee2e6;
}

[data-bs-theme="dark"] .chat-input-form input::placeholder {
    color: #6c757d;
}

