.chat-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    height: 70vh;
    min-height: 500px;
}

.chat-sidebar {
    width: 30%;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
}

.chat-sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

#thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thread-item {
    padding: 12px 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin-bottom: 5px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    user-select: none;
}

.thread-item:hover {
    background-color: #e9ecef;
}

.thread-item.selected {
    background-color: #ff7c3c;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

.thread-item.selected .unread-badge {
    background-color: #ffc107;
    color: #212529;
}

.reveal-icon {
    font-size: 14px;
    margin-left: 5px;
    opacity: 0.7;
}

.thread-item.selected .reveal-icon {
    opacity: 1;
}

.reveal-icon.visible {
    color: #28a745;
}

.reveal-icon.hidden {
    color: #6c757d;
}

.thread-item.selected .reveal-icon.visible {
    color: #ffeb3b;
}

.thread-item.selected .reveal-icon.hidden {
    color: #ffffff;
    opacity: 0.6;
}

.chat-main {
    width: 70%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#chat-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
    border-radius: 5px 5px 0 0;
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-bottom: none;
}

.chat-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#chat-with {
    font-size: 16px;
    color: #495057;
    display: block;
    flex: 1;
}

#reveal-identity-control {
    display: flex;
    align-items: center;
}

.reveal-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    user-select: none;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.reveal-toggle:hover {
    background-color: #f0f0f0;
    border-color: #007bff;
}

.reveal-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.reveal-toggle input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.reveal-toggle span {
    color: #495057;
    transition: color 0.3s ease;
}

.reveal-toggle input[type="checkbox"]:checked + span {
    color: #ff7c3c;
    font-weight: bold;
}

.chat-main #chat-messages {
    margin-top: 0;
    border-radius: 0 0 5px 5px;
    border-top: none;
}

.chat-container:not(.admin-chat) #chat-header {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.chat-container:not(.admin-chat) #chat-with {
    color: #ff7c3c;
}

#chat-header {
    transition: all 0.3s ease;
}

#chat-with {
    transition: color 0.3s ease;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    min-height: 300px;
    scroll-behavior: smooth;
}

.message {
    margin: 8px 0;
    padding: 12px;
    border-radius: 8px;
    max-width: 75%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    background-color: #ff7c3c;
    color: white;
    margin-left: auto;
    margin-right: 0;
}

.message.received {
    background-color: #e9ecef;
    color: #333;
    margin-left: 0;
    margin-right: auto;
}

.message .sender {
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.message .text {
    display: block;
    line-height: 1.4;
}

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

#chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

#chat-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

#chat-form button {
    padding: 12px 20px;
    background-color: #ff7c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    height: fit-content;
    min-width: 90px;
    position: relative;
}

#chat-form button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#chat-form button:active:not(:disabled) {
    transform: translateY(0);
}

#chat-form button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Style pour le bouton pendant l'envoi */
#chat-form button.sending {
    background-color: #6c757d;
    cursor: wait;
    pointer-events: none;
}

#chat-form button.sending::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#chat-form button.sending span {
    visibility: hidden;
}

.start-chat-button {
    display: inline-block;
    padding: 12px 24px;
    margin: 10px 0;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.start-chat-button:hover {
    background-color: #218838;
    color: white;
    text-decoration: none;
}

.chat-notification-badge {
    display: inline-block;
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.chat-notification-badge.has-unread {
    background-color: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.unread-badge {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    display: inline-block;
    line-height: 1.2;
    animation: bounceIn 0.5s ease;
    margin-left: 5px;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.thread-item.selected .unread-badge {
    background-color: #ffc107;
    color: #212529;
}

.chat-status {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.new-message-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.chat-container.real-time {
    border-left: 4px solid #28a745;
}

.real-time-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* STYLES POUR LE CHAT ADMINISTRATEUR */
.admin-chat .chat-sidebar {
    background-color: #f8f9fa;
}

.admin-chat .chat-sidebar h3 {
    color: #222;
    border-bottom: 2px solid #222;
    padding-bottom: 10px;
    font-size: 23px;
}

.user-search {
    margin-bottom: 15px;
}

.user-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    background-color: white;
}

.user-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.user-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.tab-button.active {
    color: #007bff;
    font-weight: bold;
    border-bottom-color: #007bff;
}

#user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-item {
    padding: 12px 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin-bottom: 5px;
    position: relative;
}

.user-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.user-item.selected {
    background-color: #007bff;
    color: white;
    pointer-events: none;
}

.user-item.selected .role-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-meta {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.role-badge.employeur {
    background-color: #007bff;
    color: white;
}

.role-badge.employe {
    background-color: #28a745;
    color: white;
}

.admin-chat #chat-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
    border-radius: 5px 5px 0 0;
    margin-bottom: 0;
}

.admin-chat #chat-messages {
    margin-top: 0;
    border-radius: 0 0 5px 5px;
}

.no-users,
.no-conversations {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    list-style: none;
}

.admin-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #007bff;
    border-radius: 50%;
    border: 2px solid white;
}

.user-item.has-new-message {
    animation: newMessagePulse 2s infinite;
}

@keyframes newMessagePulse {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 123, 255, 0.2);
    }
}

#user-list.hidden,
#thread-list.hidden {
    display: none;
}

.admin-chat .thread-item {
    padding: 12px 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin-bottom: 5px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-chat .thread-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.admin-chat .thread-item.selected {
    background-color: #007bff;
    color: white;
}

.admin-chat .message.sent {
    background-color: #007bff;
    border-left: 4px solid #0056b3;
}

.admin-chat .message.sent .sender::after {
    content: " (Admin)";
    font-size: 0.8em;
    opacity: 0.7;
}

.admin-chat .unread-badge {
    background-color: #007bff;
}

.admin-chat .thread-item.selected .unread-badge,
.admin-chat .user-item.selected .unread-badge {
    background-color: white;
    color: #007bff;
}

/* BADGES DE MENU */
.chat-menu-badge {
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 50% !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    margin-left: 5px !important;
    display: inline-block !important;
    min-width: 18px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    animation: chat-badge-pulse 2s infinite !important;
    position: relative !important;
    top: -2px !important;
}

@keyframes chat-badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.menu-item a .chat-menu-badge {
    vertical-align: super !important;
}

.navbar .chat-menu-badge,
.main-navigation .chat-menu-badge {
    position: absolute !important;
    top: 17px !important;
    right: 3px !important;
    margin-left: 0 !important;
}

.navbar-dark .chat-menu-badge,
.bg-dark .chat-menu-badge {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

/* NOTIFICATIONS TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #333;
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10000;
    animation: slideInUp 0.3s ease;
}

.toast.toast-success {
    background-color: #28a745;
}

.toast.toast-error {
    background-color: #dc3545;
}

.toast.toast-info {
    background-color: #17a2b8;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: auto;
        min-height: 600px;
    }

    .chat-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .chat-main {
        width: 100%;
        flex: 1;
    }

    .message {
        max-width: 85%;
    }

    .chat-notification-badge {
        text-align: center;
        display: block;
        margin: 10px auto;
    }

    .thread-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .unread-badge {
        align-self: flex-end;
    }

    #chat-header {
        padding: 10px;
        font-size: 14px;
    }
    
    #chat-with {
        font-size: 14px;
    }
    
    .chat-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #reveal-identity-control {
        width: 100%;
    }
    
    .reveal-toggle {
        width: 100%;
        justify-content: center;
    }

    .user-tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1 1 50%;
        min-width: 80px;
    }
    
    .user-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .role-badge {
        align-self: flex-start;
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .user-item .unread-badge {
        align-self: flex-end;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .chat-sidebar {
        width: 35%;
    }
    
    .chat-main {
        width: 65%;
    }
    
    .chat-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ACCESSIBILITÉ */
.thread-item:focus,
.user-item:focus,
.tab-button:focus,
#user-search:focus,
#chat-input:focus,
#chat-form button:focus,
.reveal-toggle:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.admin-chat .thread-item:focus,
.admin-chat .user-item:focus,
.admin-chat .tab-button:focus {
    outline-color: #007bff;
}

.message.received {
    border: 1px solid #d1ecf1;
}

.message.sent {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 1px 2px;
    border-radius: 2px;
}

.reveal-icon {
    transition: all 0.3s ease;
}

.thread-item:hover .reveal-icon {
    transform: scale(1.1);
}

#chat-form.sending {
    opacity: 0.7;
    pointer-events: none;
}

.chat-sidebar::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-sidebar::-webkit-scrollbar-track,
#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-sidebar::-webkit-scrollbar-thumb,
#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-sidebar::-webkit-scrollbar-thumb:hover,
#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.thread-item,
.message .sender {
    word-wrap: break-word;
    word-break: break-word;
}

.thread-item {
    white-space: normal;
    line-height: 1.4;
}

.message .sender {
    font-weight: bold;
}


/* Ajustement du thread-item pour accueillir les boutons d'action */
.thread-item {
    padding-right: 90px !important; /* Espace pour les boutons */
}

/* Conteneur des actions (boutons profil et suppression) */
.thread-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

/* Styles communs pour les boutons d'action */
.view-profile-btn,
.delete-thread-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
    line-height: 1;
}

.view-profile-btn:hover,
.delete-thread-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    background-color: rgba(0, 0, 0, 0.08);
}

/* Bouton de suppression */
.delete-thread-btn {
    color: #dc3545;
}

.delete-thread-btn:hover {
    color: #c82333;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Bouton de profil */
.view-profile-btn {
    color: #007bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-profile-btn:hover {
    color: #0056b3;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Styles quand le thread est sélectionné */
.thread-item.selected .view-profile-btn,
.thread-item.selected .delete-thread-btn {
    opacity: 0.9;
}

.thread-item.selected .view-profile-btn:hover,
.thread-item.selected .delete-thread-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.thread-item.selected .delete-thread-btn {
    color: #fff;
}

.thread-item.selected .delete-thread-btn:hover {
    color: #ffcccc;
}

.thread-item.selected .view-profile-btn {
    color: #fff;
}

.thread-item.selected .view-profile-btn:hover {
    color: #cce5ff;
}

/* Animation au clic */
.thread-actions > * {
    transition: all 0.2s ease;
}

.thread-actions > *:active {
    transform: scale(0.95);
}

/* Empêcher le nom du thread de chevaucher les boutons */
.thread-name {
    flex: 1;
    pointer-events: none;
    padding-right: 10px;
}

/* =================================================================
   MODAL DE CONFIRMATION DE SUPPRESSION
   ================================================================= */

.delete-confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.delete-confirmation-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.delete-confirmation-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #dc3545;
    font-size: 22px;
    font-weight: bold;
}

.delete-confirmation-content p {
    margin: 15px 0;
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

.delete-confirmation-content p strong {
    color: #333;
    font-weight: 600;
}

.delete-confirmation-content p:last-of-type {
    font-size: 13px;
    color: #dc3545;
    font-weight: 500;
    margin-top: 20px;
}

/* Boutons du modal */
.delete-confirmation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.delete-confirmation-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 120px;
}

.delete-confirmation-buttons button:active {
    transform: scale(0.97);
}

/* Bouton de confirmation */
.confirm-delete-btn {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.confirm-delete-btn:hover {
    background-color: #c82333;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.confirm-delete-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Bouton d'annulation */
.cancel-delete-btn {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.cancel-delete-btn:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

/* =================================================================
   RESPONSIVE POUR LES NOUVEAUX ÉLÉMENTS
   ================================================================= */

@media (max-width: 768px) {
    .thread-item {
        padding-right: 100px !important;
    }
    
    .thread-actions {
        right: 5px;
        gap: 3px;
    }
    
    .view-profile-btn,
    .delete-thread-btn {
        font-size: 16px;
        padding: 5px 8px;
    }
    
    .delete-confirmation-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .delete-confirmation-content h3 {
        font-size: 18px;
    }
    
    .delete-confirmation-content p {
        font-size: 14px;
    }
    
    .delete-confirmation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .delete-confirmation-buttons button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .thread-actions {
        flex-direction: column;
        gap: 2px;
    }
    
    .view-profile-btn,
    .delete-thread-btn {
        font-size: 14px;
        padding: 4px 6px;
    }
}

/* =================================================================
   ÉTATS DE FOCUS POUR L'ACCESSIBILITÉ
   ================================================================= */

.view-profile-btn:focus,
.delete-thread-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.confirm-delete-btn:focus,
.cancel-delete-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* =================================================================
   ANIMATIONS SUPPLÉMENTAIRES
   ================================================================= */

/* Animation de suppression du thread */
.thread-item.deleting {
    animation: threadFadeOut 0.3s ease forwards;
}

@keyframes threadFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Effet de hover sur tout le thread sauf les actions */
.thread-item:hover .thread-name {
    color: inherit;
}

/* Assurer que les icônes sont alignées correctement */
.thread-item .reveal-icon,
.thread-item .unread-badge {
    flex-shrink: 0;
}

/* Ajustement pour les longs noms */
.thread-item .thread-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 100px);
}

/* Support pour les écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    .view-profile-btn,
    .delete-thread-btn {
        opacity: 0.8;
        font-size: 20px;
        padding: 8px 12px;
    }
    
    .thread-actions {
        gap: 8px;
    }
}

/* Amélioration du contraste pour l'accessibilité */
@media (prefers-contrast: high) {
    .delete-thread-btn {
        color: #c82333;
        font-weight: bold;
    }
    
    .view-profile-btn {
        color: #0056b3;
        font-weight: bold;
    }
    
    .delete-confirmation-modal {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Mode sombre (si votre site le supporte) */
@media (prefers-color-scheme: dark) {
    .delete-confirmation-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .delete-confirmation-content h3 {
        color: #ff6b6b;
    }
    
    .delete-confirmation-content p {
        color: #b0b0b0;
    }
    
    .delete-confirmation-content p strong {
        color: #e0e0e0;
    }
}

/* =================================================================
   CORRECTIONS ET AJUSTEMENTS FINAUX
   ================================================================= */

/* Assurer que les boutons ne sont pas cliquables quand le thread est sélectionné */
.thread-item.selected {
    pointer-events: auto !important; /* Override le none du CSS existant */
}

.thread-item.selected .thread-name {
    pointer-events: none;
}

.thread-item.selected .thread-actions {
    pointer-events: auto;
}

/* Meilleure gestion du z-index */
.thread-item {
    position: relative;
    z-index: 1;
}

.thread-item:hover {
    z-index: 2;
}

.thread-actions {
    z-index: 3;
}

/* Empêcher le double-clic accidentel */
.thread-actions * {
    user-select: none;
}

/* Amélioration du feedback visuel */
.view-profile-btn:active,
.delete-thread-btn:active {
    filter: brightness(0.9);
}

/* Style pour le message "Aucune conversation" */
.no-threads {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    list-style: none;
}

/* Transition douce lors de l'ajout/suppression d'éléments */
.thread-item {
    transition: all 0.3s ease;
}

/* Amélioration de la lisibilité sur petits écrans */
@media (max-width: 360px) {
    .thread-item {
        font-size: 13px;
    }
    
    .view-profile-btn,
    .delete-thread-btn {
        font-size: 13px;
    }
}

/* Print styles (masquer les boutons lors de l'impression) */
@media print {
    .thread-actions {
        display: none !important;
    }
    
    .thread-item {
        padding-right: 20px !important;
    }
}

li.thread-item {
    padding-left: 25px;
}

span.reveal-icon {
    position: absolute;
    left: 0;
}