/* Sidebar de conversations à droite */
.conversations-right-sidebar {
    position: fixed;
    left: 280px; /* Position collée à la sidebar principale (280px = largeur de la sidebar) */
    top: 0;
    height: 100vh;
    width: 320px;
    background: var(--primary-color);
    color: white;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    z-index: 998;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.conversations-right-sidebar.active {
    transform: translateX(0);
}

/* Header de la sidebar de conversations */
.conversations-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Barre de recherche */
.conversations-search-bar {
    position: relative;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.conversations-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.conversations-search-bar i.fa-search {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 8px;
    font-size: 14px;
}

.conversations-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 13px;
    outline: none;
    padding: 0;
}

.conversations-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clear-search-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.conversations-sidebar-title {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversations-close-btn {
    background: #293F50;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.conversations-close-btn:hover {
    background: #293F50;
    transform: rotate(90deg);
}

/* Container pour les conversations */
.conversations-right-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Section des conversations avec scroll */
.conversations-right-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 15px;
}

/* Style des éléments de conversation */
.conversation-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.conversation-item.active {
    background: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.conversation-item-content {
    flex: 1;
    overflow: hidden;
}

.conversation-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.conversation-item-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.conversation-item-delete {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0;
}

.conversation-item:hover .conversation-item-delete {
    opacity: 1;
}

.conversation-item-delete:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #ED7470;
}

/* Contrôles de conversation */
.conversation-right-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.conversation-right-controls .btn-small {
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.conversation-right-controls .btn-small:first-child {
    background: var(--secondary-color);
    color: white;
}

.conversation-right-controls .btn-small:first-child:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.conversation-right-controls .btn-small.danger {
    background: rgba(231, 76, 60, 0.2);
    color: #ED7470;
}

.conversation-right-controls .btn-small.danger:hover {
    background: #ED7470;
    color: white;
    transform: translateY(-2px);
}

/* Badge compteur de conversations */
.conversations-count {
    background: #DC714A;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Bouton pour ouvrir la sidebar dans la sidebar principale */
.conversations-toggle-btn {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: white;
    position: relative;
}

.conversations-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.conversations-toggle-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversations-toggle-btn .btn-badge {
    background: #DC714A;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .conversations-right-sidebar {
        left: 0;
        width: 100%;
        max-width: 320px;
        transform: translateX(-100%);
    }

    .conversations-right-sidebar.active {
        transform: translateX(0);
    }
}

/* Ajustement pour tablettes */
@media (min-width: 769px) and (max-width: 1024px) {
    .conversations-right-sidebar {
        left: 220px; /* Ajusté pour la sidebar de 220px sur tablette */
        width: 280px;
    }
}

/* Scrollbar pour la section conversations */
.conversations-right-section::-webkit-scrollbar {
    width: 6px;
}

.conversations-right-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.conversations-right-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.conversations-right-section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
