/* =========================================================================
 * קבוצות v2 – כותרת קבוצה קומפקטית, לשונית חברים חדשה, יצירת קבוצה במסך אחד
 * נטען אחרי style.css, ולכן דורס אותו בלי !important מיותר.
 * ========================================================================= */

/* ---------- כותרת קבוצה קומפקטית ---------- */
body.single-item.groups #buddypress #item-header {
	padding: 0;
}
body.single-item.groups #buddypress #item-header > .hp-bp-group-cover-title-wrap {
	padding: 8px 16px 10px;
}
body.single-item.groups #buddypress #item-header > .hp-bp-group-cover-title-wrap .hp-bp-group-cover-title {
	font-size: clamp(1.1rem, 2vw, 1.5rem);
}

body.single-item.groups #buddypress #cover-image-container {
	min-height: 0 !important;
	height: auto !important;
	position: relative;
	overflow: hidden;
}
/* תמונת הכיסוי של BP נשארת כרקע, אבל לא קובעת גובה */
body.single-item.groups #buddypress #header-cover-image {
	position: absolute;
	inset: 0;
	height: auto !important;
	background-size: cover;
	background-position: center;
}
body.single-item.groups #buddypress #item-header-cover-image {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 0 !important;
	height: auto !important;
	padding: 12px 16px !important;
	box-sizing: border-box;
}
body.single-item.groups #buddypress #item-header-avatar {
	float: none !important;
	flex: 0 0 auto;
	margin: 0 !important;
	width: 84px;
	height: 84px;
	border-width: 3px;
	line-height: 0;
}
body.single-item.groups #buddypress #item-header-avatar img {
	width: 78px !important;
	height: 78px !important;
	border-radius: 50%;
	object-fit: cover;
}
body.single-item.groups #buddypress #item-header-content {
	float: none !important;
	flex: 1 1 auto;
	width: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
}
body.single-item.groups #buddypress #item-header-content > * {
	margin: 0 !important;
}
body.single-item.groups #buddypress #item-header-content .group-status strong {
	background: rgba(255, 255, 255, 0.75);
	border-radius: 999px;
	padding: 2px 12px;
	font-size: 13px;
}
body.single-item.groups #buddypress #item-header-content .activity {
	font-size: 13px;
	color: #6b5a2e;
}
body.single-item.groups #buddypress #item-header-content .hp-invite-link-message {
	padding: 6px 12px !important;
	margin: 0 !important;
	flex: 1 1 100%;
	font-size: 13px;
}
body.single-item.groups #buddypress #item-header-content .hp-invite-link-message p {
	line-height: 1.4;
}

/* המנהלים – עוברים לתיבת התיאור (JS) */
body.single-item.groups #buddypress #item-actions {
	float: none !important;
	width: auto !important;
	padding: 0 !important;
	margin: 0 !important;
}
body.single-item.groups #buddypress #item-actions .bp-screen-reader-text {
	display: none;
}
body.single-item.groups #buddypress #item-actions dl {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}
body.single-item.groups #buddypress #item-actions dt,
body.single-item.groups #buddypress #item-actions dd {
	margin: 0;
}
body.single-item.groups #buddypress #item-actions dt {
	font-size: 12px;
	font-weight: 600;
	color: #666;
}
body.single-item.groups #buddypress #item-actions ul {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}
body.single-item.groups #buddypress #item-actions li {
	margin: 0;
}
body.single-item.groups #buddypress #item-actions img.avatar {
	width: 30px !important;
	height: 30px !important;
	border-radius: 50%;
}
body.single-item.groups #buddypress .desc-wrap {
	margin: 0 0 8px !important;
	padding: 10px 16px !important;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
}
body.single-item.groups #buddypress .desc-wrap .group-description {
	flex: 1 1 320px;
}
body.single-item.groups #buddypress .desc-wrap .group-description p {
	margin: 0;
	line-height: 1.55;
}
body.single-item.groups #buddypress .desc-wrap > #item-actions {
	margin-inline-start: auto !important;
}

@media (max-width: 600px) {
	body.single-item.groups #buddypress #item-header-cover-image {
		gap: 10px;
		padding: 10px 12px !important;
	}
	body.single-item.groups #buddypress #item-header-avatar {
		width: 64px;
		height: 64px;
	}
	body.single-item.groups #buddypress #item-header-avatar img {
		width: 58px !important;
		height: 58px !important;
	}
}

/* ---------- טולטיפ כללי לרכיבים החדשים ---------- */
.hpg-mv [data-tip],
.hpg-cr [data-tip] {
	position: relative;
}
.hpg-mv [data-tip]::after,
.hpg-cr [data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	right: 50%;
	transform: translateX(50%);
	background: #2b2b3a;
	color: #fff;
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	width: max-content;
	max-width: 260px;
	white-space: normal;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
	z-index: 20;
}
.hpg-mv [data-tip]:hover::after,
.hpg-cr [data-tip]:hover::after {
	opacity: 1;
}

/* ---------- לשונית חברים ---------- */
body.hpg-members-v2 #buddypress .subnav-filters,
body.hpg-members-v2 #buddypress #group-members-list,
body.hpg-members-v2 #buddypress #members-list,
body.hpg-members-v2 #buddypress [data-bp-list],
body.hpg-members-v2 #buddypress .bp-pagination,
body.hpg-members-v2 #buddypress .hpg-members-table-wrapper,
body.hpg-members-v2 #buddypress .hpg-group-members-header {
	display: none !important;
}

.hpg-mv {
	margin: 12px 0 24px;
}
.hpg-mv-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}
.hpg-mv-search {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 200px;
	max-width: 320px;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	padding: 0 14px;
	color: #777;
}
.hpg-mv-search input {
	flex: 1;
	border: 0 !important;
	outline: 0;
	background: transparent !important;
	box-shadow: none !important;
	padding: 9px 0 !important;
	font-size: 14px;
	min-width: 0;
}
.hpg-mv-toolbar select {
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	padding: 8px 14px;
	background: #fff;
	font-size: 14px;
	height: auto;
}
.hpg-mv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	background: #fff;
	color: #555;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hpg-mv-btn:hover {
	border-color: #7699f2;
	color: #7699f2;
}
.hpg-mv-btn.is-on {
	background: #7699f2;
	border-color: #7699f2;
	color: #fff;
}
.hpg-mv-btn.is-flipped svg {
	transform: scaleY(-1);
}
.hpg-mv-toggle {
	display: inline-flex;
	gap: 4px;
}
.hpg-mv-count {
	margin-inline-start: auto;
	font-size: 13px;
	color: #777;
}

.hpg-mv-list {
	display: grid;
	gap: 12px;
}
.hpg-mv-list.is-grid {
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.hpg-mv-list.is-list {
	grid-template-columns: 1fr;
	gap: 6px;
}
.hpg-mv-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	padding: 12px 14px;
	text-decoration: none !important;
	color: #2b2b3a;
	transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.hpg-mv-item:hover {
	border-color: #fbb59a;
	box-shadow: 0 4px 14px rgba(251, 130, 85, 0.18);
	transform: translateY(-1px);
}
.hpg-mv-avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	background: #eee;
}
.hpg-mv-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1 1 auto;
}
.hpg-mv-name {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	overflow-wrap: anywhere;
}
.hpg-mv-role {
	align-self: flex-start;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, #FB8255, #FB6965);
	border-radius: 999px;
	padding: 1px 10px;
}
.hpg-mv-stats {
	display: flex;
	gap: 10px;
	font-size: 12px;
	color: #777;
	white-space: nowrap;
}
.hpg-mv-stat b {
	color: #2b2b3a;
	font-size: 14px;
}
/* משבצות: סטטיסטיקות מתחת לשם */
.hpg-mv-list.is-grid .hpg-mv-item {
	flex-wrap: wrap;
}
.hpg-mv-list.is-grid .hpg-mv-stats {
	flex: 1 1 100%;
	justify-content: flex-start;
	border-top: 1px solid #f0f0f0;
	padding-top: 8px;
}
.hpg-mv-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #888;
	padding: 24px 0;
}
@media (max-width: 600px) {
	.hpg-mv-list.is-list .hpg-mv-stats {
		display: none;
	}
	.hpg-mv-search {
		max-width: none;
	}
}

/* ---------- יצירת קבוצה במסך אחד ---------- */
body.hpg-create-v2 #buddypress #create-group-form,
body.hpg-create-v2 #buddypress .bp-subhead {
	display: none !important;
}

.hpg-cr {
	max-width: 760px;
	margin: 8px auto 32px;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 20px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	padding: 24px 28px 28px;
}
.hpg-cr-title {
	margin: 0 0 18px;
	font-size: 1.5rem;
	color: #2b2b3a;
}
.hpg-cr-top {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	align-items: flex-start;
	margin-bottom: 18px;
}
.hpg-cr-avatar-col {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.hpg-cr-drop {
	position: relative;
	width: 160px;
	height: 160px;
	border-radius: 50%;
	border: 2px dashed #b9c6ee;
	background: #f4f7ff;
	overflow: hidden;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s, background 0.15s;
}
.hpg-cr-drop:hover,
.hpg-cr-drop.is-over,
.hpg-cr-drop:focus-visible {
	border-color: #7699f2;
	background: #eaf0ff;
	outline: 0;
}
.hpg-cr-drop.has-image {
	border-style: solid;
	border-color: #7699f2;
	cursor: grab;
}
.hpg-cr-drop canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	touch-action: none;
}
.hpg-cr-drop-hint {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: #7699f2;
	pointer-events: none;
}
.hpg-cr-drop-hint small {
	font-size: 12px;
	color: #6b7ab0;
}
.hpg-cr-zoom input {
	width: 150px;
	accent-color: #7699f2;
}
.hpg-cr-fields {
	flex: 1 1 280px;
	min-width: 0;
}
.hpg-cr-label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	margin: 0 0 6px;
	color: #2b2b3a;
}
.hpg-cr-fields .hpg-cr-label:not(:first-child) {
	margin-top: 14px;
}
.hpg-cr input[type="text"],
.hpg-cr textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #dcdcdc;
	border-radius: 14px;
	padding: 10px 14px;
	font-size: 15px;
	background: #fff;
}
.hpg-cr input[type="text"]:focus,
.hpg-cr textarea:focus {
	border-color: #7699f2;
	outline: 0;
	box-shadow: 0 0 0 3px rgba(118, 153, 242, 0.2);
}
.hpg-cr-privacy {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.hpg-cr-pill,
.hpg-cr-invite {
	cursor: pointer;
}
.hpg-cr-pill input,
.hpg-cr-invite input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.hpg-cr-pill span,
.hpg-cr-invite span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 14px;
	background: #fff;
	color: #444;
	transition: all 0.15s;
}
.hpg-cr-pill:hover span,
.hpg-cr-invite:hover span {
	border-color: #7699f2;
}
.hpg-cr-pill input:checked + span,
.hpg-cr-invite input:checked + span {
	background: #7699f2;
	border-color: #7699f2;
	color: #fff;
}
.hpg-cr-pill input:focus-visible + span,
.hpg-cr-invite input:focus-visible + span {
	box-shadow: 0 0 0 3px rgba(118, 153, 242, 0.35);
}
.hpg-cr-invite {
	display: inline-block;
	position: relative;
}
.hpg-cr-error {
	margin: 14px 0 0;
	color: #b3261e;
	background: #fdecea;
	border-radius: 12px;
	padding: 8px 14px;
	font-size: 14px;
}
.hpg-cr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}
.hpg-cr-submit,
.hpg-cr-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: 11px 28px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none !important;
	border: 0;
	transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.hpg-cr-submit {
	background: linear-gradient(135deg, #FB8255, #FB6965);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(251, 105, 101, 0.35);
}
.hpg-cr-submit:hover {
	transform: translateY(-1px);
}
.hpg-cr-submit:disabled {
	opacity: 0.6;
	cursor: wait;
}
.hpg-cr-secondary {
	background: #eaf0ff;
	color: #4a63b0 !important;
}
.hpg-cr-done {
	text-align: center;
}
.hpg-cr-done-badge {
	width: 64px;
	height: 64px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: linear-gradient(135deg, #7699f2, #5a7fd8);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.hpg-cr-done-sub {
	margin: 14px 0 6px;
	color: #666;
	font-size: 14px;
}
.hpg-cr-copyrow {
	display: flex;
	gap: 8px;
	max-width: 520px;
	margin: 0 auto;
}
.hpg-cr-copyrow input {
	direction: ltr;
	text-align: left;
	border-radius: 999px !important;
	font-size: 13px !important;
}
.hpg-cr-copy {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid #dcdcdc;
	background: #fff;
	color: #555;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.hpg-cr-copy.is-done {
	background: #7699f2;
	border-color: #7699f2;
	color: #fff;
}
.hpg-cr-done .hpg-cr-actions {
	justify-content: center;
}
@media (max-width: 600px) {
	.hpg-cr {
		padding: 18px 16px 22px;
		border-radius: 16px;
	}
	.hpg-cr-top {
		justify-content: center;
	}
}

/* ---------- דריסות מול ערכת הנושא (כפתורים/עיגולים) ---------- */
#buddypress .hpg-cr .hpg-cr-submit,
.hpg-cr .hpg-cr-submit,
.hpg-cr button.hpg-cr-submit {
	background: linear-gradient(135deg, #FB8255, #FB6965) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: 12px 34px !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	min-width: 150px;
	height: auto !important;
	box-shadow: 0 4px 12px rgba(251, 105, 101, 0.35) !important;
	text-shadow: none !important;
	-webkit-text-fill-color: #fff;
}
.hpg-cr .hpg-cr-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.hpg-cr .hpg-cr-submit:disabled { opacity: .6 !important; }
.hpg-cr .hpg-cr-secondary {
	background: #eaf0ff !important;
	color: #4a63b0 !important;
	border-radius: 999px !important;
	padding: 12px 28px !important;
	box-shadow: none !important;
}
.hpg-cr .hpg-cr-drop,
.hpg-cr .hpg-cr-done-badge,
.hpg-cr .hpg-cr-copy,
.hpg-cr .hpg-cr-drop canvas {
	border-radius: 50% !important;
}
.hpg-cr .hpg-cr-copy { background: #fff !important; padding: 0 !important; box-shadow: none !important; }
.hpg-cr .hpg-cr-copy.is-done { background: #7699f2 !important; color: #fff !important; }
.hpg-cr .hpg-cr-pill span,
.hpg-cr .hpg-cr-invite span { border-radius: 999px !important; }

/* ---------- עיגול האווטאר (היה אליפסה: רוחב 132px מהערכה) + רווח עליון ---------- */
body.single-item.groups #buddypress #item-header-avatar {
	width: 84px !important;
	height: 84px !important;
	min-width: 84px !important;
	max-width: 84px !important;
	flex: 0 0 84px !important;
	border-radius: 50% !important;
	overflow: hidden;
	display: block !important;
	box-sizing: border-box;
	aspect-ratio: 1 / 1;
}
body.single-item.groups #buddypress #item-header-avatar a {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	border-radius: 50% !important;
}
body.single-item.groups #buddypress #item-header-avatar img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	border-radius: 50% !important;
	object-fit: cover;
}
@media (max-width: 600px) {
	body.single-item.groups #buddypress #item-header-avatar {
		width: 64px !important; height: 64px !important; min-width: 64px !important; max-width: 64px !important; flex-basis: 64px !important;
	}
}
/* רווח מיותר מעל כותרת הקבוצה (padding של #content + margin של #primary בערכה) */
body.groups #content.site-content {
	padding-top: 0 !important;
}
body.groups #primary.content-area {
	margin-top: 14px !important;
}

/* ---------- הוספת חברים (מסך ניהול חברים) ---------- */
.hpg-am {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 18px;
	padding: 18px 22px 22px;
	margin: 0 0 20px;
}
.hpg-am-title { margin: 0 0 6px; font-size: 1.25rem; color: #2b2b3a; }
.hpg-am-desc { margin: 0 0 12px; color: #666; font-size: 14px; line-height: 1.5; }
.hpg-am .hpg-am-textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #dcdcdc;
	border-radius: 14px;
	padding: 10px 14px;
	font-size: 15px;
	background: #fff;
}
.hpg-am .hpg-am-textarea:focus { border-color: #7699f2; outline: 0; box-shadow: 0 0 0 3px rgba(118,153,242,.2); }
.hpg-am-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
#buddypress .hpg-am .hpg-am-btn,
.hpg-am .hpg-am-btn {
	background: linear-gradient(135deg, #FB8255, #FB6965) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: 11px 30px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(251,105,101,.35) !important;
}
.hpg-am .hpg-am-btn:disabled { opacity: .6; cursor: wait; }
.hpg-am-status { font-size: 14px; color: #666; }
.hpg-am-status.is-ok { color: #1b7a3d; font-weight: 600; }
.hpg-am-status.is-err { color: #b3261e; font-weight: 600; }
.hpg-am-results { margin-top: 14px; display: grid; gap: 10px; }
.hpg-am-sec { border-radius: 14px; padding: 10px 14px; background: #f6f7fb; }
.hpg-am-sec h4 { margin: 0 0 6px; font-size: 14px; }
.hpg-am-sec.ok { background: #eaf7ef; }
.hpg-am-sec.warn { background: #fff6e0; }
.hpg-am-sec.bad { background: #fdecea; }
.hpg-am-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hpg-am-chips span { background: rgba(255,255,255,.8); border-radius: 999px; padding: 2px 12px; font-size: 13px; }
.hpg-am-note { margin: 8px 0 6px; font-size: 13px; color: #666; }
.hpg-am .hpg-am-url { width: 100%; box-sizing: border-box; direction: ltr; border: 1px solid #dcdcdc; border-radius: 999px; padding: 7px 14px; font-size: 13px; background: #fff; }
.hpg-am-amb { margin: 4px 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hpg-am .hpg-am-pick {
	display: inline-flex; flex-direction: column; align-items: flex-start;
	border: 1px solid #dcdcdc !important; background: #fff !important; color: #2b2b3a !important;
	border-radius: 14px !important; padding: 5px 14px !important; cursor: pointer; font-size: 13px !important; line-height: 1.3;
}
.hpg-am .hpg-am-pick small { color: #777; font-size: 11px; }
.hpg-am .hpg-am-pick:hover { border-color: #7699f2 !important; }
.hpg-am .hpg-am-pick.is-done { background: #7699f2 !important; color: #fff !important; }
.hpg-am .hpg-am-pick.is-done small { color: #e6ecff; }
