/*chat.css*/

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

* {
    /* Font */
    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* =========================================
   MESSAGERIE - CHAT PAAXIO
   ========================================= */

:root {
    --paaxio-brand: #E07A5F; 
    --paaxio-brand-hover: #cd6b50;
    --chat-bg: #f9f9fa;
    --chat-border: #eaeaea;
    --msg-received-bg: #e4e6eb;
    --msg-received-text: #050505;
    --msg-sent-bg: var(--paaxio-brand);
    --msg-sent-text: #ffffff;
    --msg-sent-bg: #ffc6ac; 
    --msg-sent-text: #000000;
}

.chat-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    height: 100%;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    background-color: #ffffff;
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: 75vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.chat-header {
    padding: 16px 24px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    z-index: 10;
}

.chat-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 16px;
    object-fit: cover;
    border: 2px solid var(--chat-border);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--chat-bg);
}

.message-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95rem;
}

/* Message reçu (Contact) - Aligné à gauche */
.message-received {
    background-color: var(--msg-received-bg);
    color: var(--msg-received-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Message envoyé (Toi) - Aligné à droite */
.message-sent {
    background-color: var(--msg-sent-bg);
    color: var(--msg-sent-text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 6px;
    text-align: right;
    display: block;
}

.message-received .message-time {
    text-align: left;
}

.chat-empty-state {
    text-align: center;
    color: #888;
    margin: auto;
    font-weight: 500;
}

.chat-input-area {
    padding: 16px 24px;
    background-color: #ffffff;
    border-top: 1px solid var(--chat-border);
}

.chat-input-form {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 14px 24px;
    background-color: #f0f2f5;
    border: 1px solid transparent;
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.chat-input:focus {
    background-color: #ffffff;
    border-color: var(--paaxio-brand);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.chat-send-btn {
    padding: 12px 28px;
    background-color: var(--paaxio-brand);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.1s;
}

.chat-send-btn:hover {
    background-color: var(--paaxio-brand-hover);
}

.chat-send-btn:active {
    transform: scale(0.96);
}

/* =========================================
   LISTE DES CONVERSATIONS (MESSAGERIE)
   ========================================= */

.contact-list {
    flex: 1;
    overflow-y: auto;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--chat-border);
    transition: background-color 0.2s ease;
    background-color: #ffffff;
}

.contact-item:hover {
    background-color: var(--msg-received-bg);
    color: inherit;
}

.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 16px;
    object-fit: cover;
    border: 2px solid var(--chat-border);
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
}

.contact-action {
    font-size: 0.9rem;
    color: var(--paaxio-brand);
    font-weight: 600;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.contact-item:hover .contact-action {
    opacity: 1;
    transform: translateX(5px);
}

/* =========================================
   PASTILLE NON LU
   ========================================= */

.unread-badge {
    position: absolute;
    top: 0px;
    right: 14px; /* On le décale un peu à cause du margin-right de l'avatar */
    width: 14px;
    height: 14px;
    background-color: #FF3B30; /* Ton beau orange */
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: popIn 0.3s ease-out forwards;
}

/* Petite animation d'apparition pour le style */
@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}