
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap');
/* =============================================
   dreamschat-custom.css
   Styles adaptés du template DreamsChat pour le widget flottant
   ============================================= */

/* Variables de couleur (vous pouvez les ajuster à votre charte) */
:root {
    --primary-color: #5d4037; /* Marron */
    --secondary-color: #c78a44; /* Marron clair */
    --body-bg: #f5f5f5;
    --text-color: #2c3038;
    --text-muted: #8e9198;
    --border-color: #e9e9e9;
    --chat-bg: #ffffff;
    --chat-right-bg: var(--primary-color);
    --chat-right-color: #ffffff;
}

/* Base du Chat */
.chat {
    background-color: var(--chat-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 85vh;
    max-height: 700px;
    width: 420px;
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 10001;
    transition: all 0.3s ease-in-out;
}

.chat.hidden {
    display: none;
}

/* Mode Agrandi */
.chat.expanded {
    width: 80vw;
    height: 85vh;
    max-width: 1200px;
    max-height: 800px;
}

/* Bulle de lancement */
#chat-launcher {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-color);
    background-color: var(--body-bg);
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10002;
    transition: all 0.2s ease;
}
#chat-launcher:hover {
    transform: scale(1.1);
}
#chat-launcher.open {
     background-color: #ffffff;
     border: 1px solid #ddd;
}
.chat-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 100%;
}
#chat-launcher.open .chat-icon-image {
    width: 50%;
    height: 50%;
}


/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    flex-shrink: 0;
}
.chat-header .user-details {
    display: flex;
    align-items: center;
    overflow: hidden;
}
.chat-header .user-details .avatar {
    width: 40px;
    height: 40px;
    position: relative;
    flex-shrink: 0;
}
.chat-header .user-details .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar.online::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border-radius: 50%;
    border: 2px solid #fff;
}

.chat-header .user-details .ms-2 {
    margin-left: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header .user-details h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}
.chat-header .user-details .last-seen {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.chat-header .chat-options ul {
    list-style: none;
    padding: 5px;
    margin: 0;
    display: flex;
}
.chat-header .chat-options .btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.chat-header .chat-options .btn:hover {
    color: var(--primary-color);
}


/* Corps du chat (messages) */
.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--body-bg);
}
.slimscroll {
    /* Styles pour la barre de défilement custom si jquery.slimscroll est utilisé */
    overflow-y: auto;
    max-height: 600px;
}
.messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chats {
    display: flex;
    gap: 10px;
    max-width: 85%;
}
.chats .chat-avatar {
    flex-shrink: 0;
}
.chats .chat-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.chats .chat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chats .chat-profile-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.chats .chat-profile-name h6 {
    display: inline;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}
.ti.fs-7 { font-size: 7px !important; }

.chats .chat-info {
    position: relative;
}
.chats .message-content {
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Messages de l'utilisateur (à droite) */
.chats.chats-right {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chats.chats-right .message-content {
    background-color: var(--chat-right-bg);
    color: var(--chat-right-color);
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
}
.chats.chats-right .chat-profile-name {
    text-align: right;
}

/* Indicateur "is typing" */
.animate-typing {
    display: inline-block;
}
.animate-typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 1px;
    animation: typing 1.4s infinite;
}
.animate-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.animate-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Message d'erreur */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

/* Boutons rapides */
.quick-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    justify-content: flex-start;
    margin-left: 46px; /* align with bot messages */
}
.quick-btn {
    background-color: #fff;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.quick-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}


/* Footer */
.chat-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    flex-shrink: 0;
}
.chat-footer-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-footer-wrap .form-wrap {
    flex-grow: 1;
}
.chat-footer-wrap .form-control {
    border-radius: 15px;
    border: 1px solid #ddd;
    padding: 8px 15px;
    height: auto;
    background-color: var(--body-bg);
}
.chat-footer-wrap .form-control:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: none;
}
.chat-footer-wrap .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    width: 44px;
    height: 44px;
    border-radius: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.chat-footer-wrap .btn-primary:disabled {
    background-color: #c8b8e8;
    border-color: #c8b8e8;
}
.chat-header .chat-options .btn.close-btn {
    font-size: 1.4rem; /* Un peu plus grand pour être clair */
    border-radius: 25%;
}

/* On cache la bulle quand le chat est ouvert */
#chat-launcher.hidden {
    transform: scale(0);
    opacity: 0;
}


/* Pour la responsivité sur mobile */
@media (max-width: 767px) {
    .chat {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    #chat-launcher {
        display: none; /* Cachez la bulle si le chat est ouvert en plein écran */
    }
    .chat.hidden + #chat-launcher {
        display: flex;
    }

    /* NOUVELLE RÈGLE : Cacher le bouton agrandir/réduire sur mobile */
    .chat-header .expand-btn {
        display: none !important;
        
    }
}