/**
 * Styles pour le regroupement des conversations par annonce.
 */

/* ── Conteneur groupé ──────────────────────────────────────────────────── */

.bts-conv-grouped {
	display: flex;
	flex-direction: column;
}

/* ── Groupe ─────────────────────────────────────────────────────────────── */

.bts-conv-group {
	border-bottom: 1px solid #e8e8e8;
}

.bts-conv-group:last-child {
	border-bottom: none;
}

/* ── Header de groupe ──────────────────────────────────────────────────── */

.bts-conv-group__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 15px;
	cursor: pointer;
	background: #f7f7f7;
	border-bottom: 1px solid #e8e8e8;
	user-select: none;
	transition: background-color 0.15s ease;
}

.bts-conv-group__header:hover {
	background: #efefef;
}

/* ── Icône flèche ──────────────────────────────────────────────────────── */

.bts-conv-group__icon {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #666;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.bts-conv-group--collapsed .bts-conv-group__icon {
	transform: rotate(-90deg);
}

/* ── Titre du groupe ───────────────────────────────────────────────────── */

.bts-conv-group__title {
	flex: 1;
	font-weight: 600;
	font-size: 13px;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* ── Compteur de conversations ─────────────────────────────────────────── */

.bts-conv-group__count {
	font-size: 11px;
	color: #999;
	flex-shrink: 0;
}

/* ── Badge non-lus ─────────────────────────────────────────────────────── */

.bts-conv-group__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #e74c3c;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
}

/* ── Liste des conversations ───────────────────────────────────────────── */

.bts-conv-group__list {
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.bts-conv-group--collapsed .bts-conv-group__list {
	max-height: 0 !important;
}

/* ── Largeur de la colonne conversations ───────────────────────────────── */

.bts-conv-grouped {
	width: 300px;
}

.bts-conv-grouped ~ .um-message-conv-view {
	margin-left: 300px;
}

/* ── Items dans le groupe (héritage UM) ────────────────────────────────── */

.bts-conv-group .um-message-conv-item {
	position: relative;
	padding-left: 60px;
}

.bts-conv-group .um-message-conv-name {
	display: block;
	width: auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ══ Sous-groupe profil ══════════════════════════════════════════════════ */

.bts-conv-subgroup {
	border-top: 1px solid #f0f0f0;
}

.bts-conv-subgroup:first-child {
	border-top: none;
}

/* ── Header de sous-groupe ─────────────────────────────────────────────── */

.bts-conv-subgroup__header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 15px 8px 20px;
	cursor: pointer;
	background: #fcfcfc;
	border-bottom: 1px solid #f0f0f0;
	user-select: none;
	transition: background-color 0.15s ease;
}

.bts-conv-subgroup__header:hover {
	background: #f5f5f5;
}

/* ── Icône flèche sous-groupe ──────────────────────────────────────────── */

.bts-conv-subgroup__icon {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #999;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.bts-conv-subgroup--collapsed .bts-conv-subgroup__icon {
	transform: rotate(-90deg);
}

/* ── Titre du sous-groupe ──────────────────────────────────────────────── */

.bts-conv-subgroup__title {
	flex: 1;
	font-weight: 500;
	font-size: 12px;
	color: #555;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* ── Compteur sous-groupe ──────────────────────────────────────────────── */

.bts-conv-subgroup__count {
	font-size: 10px;
	color: #aaa;
	flex-shrink: 0;
}

/* ── Badge non-lus sous-groupe ─────────────────────────────────────────── */

.bts-conv-subgroup__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: #e74c3c;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	flex-shrink: 0;
}

/* ── Liste du sous-groupe ──────────────────────────────────────────────── */

.bts-conv-subgroup__list {
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.bts-conv-subgroup--collapsed .bts-conv-subgroup__list {
	max-height: 0 !important;
}

/* ── Items dans un sous-groupe (indentation supplémentaire) ────────────── */

.bts-conv-subgroup .um-message-conv-item {
	padding-left: 68px;
}

.bts-conv-subgroup .um-message-conv-pic {
	left: 16px;
}
