/* Styles pour la messagerie Airbnb */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e6e6e6;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 12px;
}

.conversation-item:hover {
    background-color: #f5f5f5;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.conversation-details {
    flex-grow: 1;
    min-width: 0; /* Important pour que text-overflow fonctionne */
}

.conversation-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.user-name {
    font-weight: 400;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    color: #232323;
}

.conversation-preview {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 300;
}

.messages-wrapper {
    display: flex;
    height: 800px; /* Hauteur fixe au lieu de 100% */
    background: #FCFCFC;
    margin: 0px -15px -15px -15px;
    border-radius: 0;
}

.dashboard-margin {
    padding: 0;
    background: none;
    margin: 0;
}

.row.is_dashboard {
    margin: 0;
    padding: 0;
    background: #FCFCFC;
}

/* Masquer la cloche de notification */
.wpestate_bell_note {
    display: none !important;
}

.top-bar-wrapper {
    display: none !important;
}

#wpestate_footer_latest_widget-2 {
    display: none;
}

.conversations-list {
    padding-top: 20px;
    width: 20%; /* Réduire légèrement la largeur de la liste des conversations */
    border-right: 1px solid #e6e6e6;
    overflow-y: auto;
    background: #FCFCFC;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    border-bottom: none;
}

.header-content {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 15px;
}

.messages-header h2 {
    font-size: 22px;
    font-weight: 500;
    margin: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.search-container {
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 8px 0;
    font-size: 16px;
    border: none;
    background: none;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

/* État actif de la recherche */
.header-content.search-active h2 {
    opacity: 0;
    transform: translateX(10px);
}

.header-content.search-active .search-container {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions button {
    background-color: #f5f5f5;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions button:hover {
    background-color: #f5f5f5;
}
.conversation-list {
}

.messages-tabs {
    display: flex;
    gap: 10px;
    padding: 0 15px 15px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    cursor: pointer;
}

.tab-btn.active {
    background-color: #222;
    color: white;
}

.tab-btn:not(.active):hover {
    background-color: #f5f5f5;
}

.no-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    height: calc(100% - 150px);
}

.no-messages-icon {
    font-size: 40px;
    color: #666;
    margin-bottom: 20px;
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-messages h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #222;
}

.no-messages p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.message-search {
    margin: 15px 15px;
    position: relative;
}

.message-search input {
    width: 100%;
    padding: 8px 15px 8px 40px;
    border: 1px solid #e6e6e6;
    border-radius: 24px;
    font-size: 13px;
    background: #FCFCFC;
}

.message-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #717171;
}

.conversation-item {
    padding: 15px; /* Plus d'espace pour chaque conversation */
    border-bottom: 1px solid #e6e6e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: #FCFCFC;
}

.conversation-item:hover {
    background: #f7f7f7;
}

.conversation-item.active {
    background: #f7f7f7;
}

.active-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FCFCFC;
}

.select-conversation-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    color: #8E8E93;
    font-size: 14px;
    text-align: center;
    background: #FCFCFC;
}

.conversation-name {
    font-weight: 600;
    font-size: 14px;
}

.conversation-time {
    color: #717171;
    font-size: 12px;
}

.conversation-preview {
    color: #232323;
    font-size: 11px; /* Aperçu du message légèrement plus grand */
    line-height: 1.4;
    max-height: 40px; /* Plus d'espace pour l'aperçu */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 300;
}

.chat-user-details h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.chat-user-details p {
    margin: 4px 0 0;
    color: #717171;
    font-size: 13px;
}

.message-content {
    background: #f7f7f7;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px; /* Texte légèrement plus grand */
    line-height: 1.5; /* Meilleur espacement des lignes */
}

.message-time {
    font-size: 12px; /* Heure légèrement plus grande */
    color: #8E8E93;
    margin-top: 6px; /* Plus d'espace au-dessus de l'heure */
    text-align: right;
}

/* Zone de saisie */
.message-input-wrapper {
    padding: 15px; /* Plus d'espace pour la zone de saisie */
    border-top: 1px solid #E9E9EB;
}

.message-form {
    margin: 0;
}

.message-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #fff;
    border-radius: 20px;
    padding: 8px;
    border: 1px solid #E9E9EB;
}

#message-input {
    flex: 1;
    min-height: 60px; /* Zone de saisie plus haute */
    max-height: 100px;
    padding: 12px; /* Plus d'espace interne */
    border: none;
    background: transparent;
    resize: none;
    font-size: 15px; /* Texte plus grand dans la zone de saisie */
    line-height: 1.4;
}

#message-input:focus {
    outline: none;
}

.message-send-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #007AFF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.message-send-btn:hover {
    background: #0056b3;
}

.message-send-btn i {
    font-size: 14px;
}

/* Ajustements pour le conteneur de chat */
#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.select-conversation-prompt {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8E8E93;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Styles pour les détails de réservation */
.reservation-details {
    width: 300px;
    border-left: 1px solid #e6e6e6;
    overflow-y: auto;
    padding: 0;
}

.reservation-header {
    padding: 24px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reservation-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-details {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.reservation-content {
    padding: 24px;
}

.inquiry-status {
    display: inline-block;
    padding: 4px 8px;
    background: #F7F7F7;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #484848;
    margin-bottom: 20px;
}

.guest-info {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.guest-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e6e6e6;
    margin-right: 16px;
}

.guest-details h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.booking-details {
    font-size: 14px;
    color: #717171;
}

.pre-approve-section {
    margin-bottom: 24px;
}

.pre-approve-text {
    margin-bottom: 16px;
    color: #484848;
}

.pre-approve-btn {
    width: 100%;
    padding: 12px;
    background: #E51E5B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.special-offer-btn,
.decline-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #E51E5B;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.special-offer-btn {
    background: white;
    color: #E51E5B;
}

.decline-btn {
    background: white;
    color: #484848;
    border-color: #e6e6e6;
}

.guest-verification {
    margin: 24px 0;
    padding: 24px 0;
    border-top: 1px solid #e6e6e6;
    border-bottom: 1px solid #e6e6e6;
}

.verification-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #484848;
}

.verification-item i {
    width: 20px;
    margin-right: 12px;
    color: #E51E5B;
}

.view-profile {
    margin-bottom: 24px;
}

.profile-link {
    color: #E51E5B;
    text-decoration: none;
    font-weight: 600;
}

.protection-info {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #F7F7F7;
    border-radius: 8px;
    font-size: 14px;
    color: #717171;
}

.protection-info i {
    margin-right: 12px;
    color: #E51E5B;
}

/* Styles des boutons dans les détails de réservation */
.reservation-details button {
    font-size: 13px;
    padding: 8px 15px;
}

.reservation-details .pre-approve-btn,
.reservation-details .special-offer-btn,
.reservation-details .decline-btn {
    font-size: 12px;
    padding: 6px 12px;
}

.reservation-details .action-buttons {
    gap: 8px;
}

.reservation-details .pre-approve-text {
    font-size: 13px;
    margin-bottom: 8px;
}

.reservation-details .profile-link {
    font-size: 13px;
}

.reservation-details .protection-info span {
    font-size: 12px;
}

/* Styles pour les avatars dans la liste des conversations */
.profile-avatar,
.profile-avatar-letter {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-letter {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(229, 30, 91, 0.1);
    color: #E51E5B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 400;
    text-transform: uppercase;
}

.conversation-item.unread .profile-avatar-letter {
    background-color: rgba(229, 30, 91, 0.15);
    color: #E51E5B;
}

/* Zone des messages */
.messages-container {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 670px;
}

/* Groupe de messages */
.message-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 70%;
}

.message-group.sent {
    align-self: flex-end;
}

.message-group.received {
    align-self: flex-start;
}

/* Style commun pour tous les messages */
.message {
    position: relative;
    margin: 1px 0;
    display: flex;
}

.message-group.sent .message {
    justify-content: flex-end;
}

.message-content {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
    position: relative;
    max-width: 85%;
}

/* Messages envoyés */
.message-group.sent {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-left: 15%;
}

.message-group.sent .message-content {
    background-color: #E51E5B;
    color: white;
    border-top-right-radius: 4px;
}

.message-group.sent .message:first-child .message-content {
    border-bottom-right-radius: 4px;
}

/* Messages reçus */
.message-group.received {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 15%;
}

.message-group.received .message-content {
    background-color: #E9E9EB;
    color: #000;
    border-top-left-radius: 4px;
}

.message-group.received .message:first-child .message-content {
    border-bottom-left-radius: 4px;
}

/* Horodatage des messages */
.message-time {
    font-size: 10px;
    color: inherit;
    opacity: 0.7;
    margin-left: 8px;
    float: right;
    margin-top: 2px;
    margin-left: 24px;
}

.message-group.received .message-time {
    color: #8E8E93;
}

/* Zone de saisie améliorée */
.message-input-wrapper {
    padding: 15px;
    border-top: 1px solid #E9E9EB;
    position: relative;
}

.message-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background-color: #fff;
    border-radius: 20px;
    padding: 8px 12px;
    border: 1px solid #E9E9EB;
    transition: border-color 0.2s ease;
}

.message-input-container:focus-within {
    border-color: #E51E5B;
}

#message-input {
    flex: 1;
    min-height: 20px;
    max-height: 100px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    resize: none;
    font-size: 15px;
    line-height: 1.4;
}

#message-input:focus {
    outline: none;
}

.message-send-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #E51E5B;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.message-send-btn:hover {
    background-color: #d41b52;
}

.message-send-btn i {
    font-size: 14px;
}

/* Header mobile masqué sur desktop */
.mobile-conversation-header {
    display: none;
}

/* Styles responsive pour mobile */
@media screen and (max-width: 768px) {
    .messages-wrapper {
        margin: 0;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
    }

    /* Vue par défaut : liste des conversations */
    .conversations-list {
        width: 100%;
        display: block;
        height: 100vh;
        overflow-y: auto;
        border-right: solid 1px #e6e6e6;
    }

    /* Masquer les détails de réservation sur mobile */
    .reservation-details {
        display: none !important;
        width: 0;
    }

    .messages-container-wrapper {
        display: none;
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #FCFCFC;
        z-index: 1000;
        border-right: none;
    }

    .messages-container-wrapper.active {
        display: block;
    }

    .messages-container {
        height: calc(100vh - 220px);
        padding-bottom: 60px;
        width: 100%;
    }

    /* Ajuster la largeur du conteneur de chat pour occuper tout l'espace */
    .chat-content {
        width: 100%;
        max-width: 100%;
        border-right: none;
    }

    /* Header de conversation mobile */
    .mobile-conversation-header {
        display: flex;
        align-items: center;
        padding: 15px;
        background: #fff;
        border-bottom: 1px solid #E9E9EB;
        position: sticky;
        top: 0;
        z-index: 1001;
        height: 60px;
    }

    .mobile-back-btn {
        border: none;
        background: none;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #E51E5B;
        font-size: 20px;
        transition: all 0.2s ease;
    }

    .mobile-back-btn:hover {
        transform: translateX(-3px);
    }

    .mobile-conversation-title {
        font-size: 16px;
        font-weight: 600;
        color: #232323;
        flex-grow: 1;
        margin-left: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ajustements pour la vue conversation avec le nouveau header */
    .messages-container-wrapper.active {
        display: flex;
        flex-direction: column;
    }

    .messages-container {
       /*  flex: 1;  */
        overflow-y: auto;
    }
}

/* Styles pour les messages non lus */
.conversation-item.unread .user-name {
    font-weight: 500;
    color: #222;
}

.conversation-item.unread .conversation-preview {
    font-weight: 400;
    color: #222;
}

/* État sans résultats de recherche */
.no-search-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    height: calc(100% - 150px);
    position: absolute;
    top: 150px;
    left: 0;
    right: 0;
    background: #fff;
}

.no-search-results .no-messages-icon {
    font-size: 20px;
    color: #666;
    margin-bottom: 20px;
    width: 50px;
    height: 50px;
    background: rgba(229, 30, 91, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-search-results .no-messages-icon i {
    color: #E51E5B;
}

.no-search-results h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px;
    color: #222;
}

.no-search-results p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Ajuster la position du conteneur de conversations pour le message de recherche */
#conversation-list {
    position: relative;
    min-height: 200px;
}