/* ==========================================================================
   AFC - FOTOGRAFICKÉ REAKCIE, KRITIKA, SKELETON NÁSTENKY
   Stavia na existujúcom dizajne: tyrkysová #0097b2, sivé bubliny --afc-soft, Poppins.
   Obsah:  1) súhrn reakcií pod príspevkom   2) lišta pri srdiečku   3) štítok a vodítka kritiky
           4) tlačidlo Kritika vo formulári   5) skeleton pri prvom načítaní nástenky
   ========================================================================== */

/* 1) SÚHRN VPRAVO V LIŠTE (ikony typov ako Facebook, klik = počty) ---------------- */
/* silnejšie ako style.css „.activity-meta .generic-button { margin: 0 !important }“ */
html body #buddypress .activity-list .activity-meta .generic-button.afc-rx-wrap { order: 8; margin: 0 0 0 auto !important; display: flex; align-items: center; }
html body #buddypress .activity-list .activity-meta .generic-button.afc-rx-wrap:has(> .afc-rx-sum.is-empty) { display: none !important; }
html body #buddypress .activity-list .activity-meta .afc-rx-sum {
	display: inline-flex !important; align-items: center; justify-content: center;
	width: auto !important; height: 32px !important; min-height: 32px !important; min-width: 32px !important;
	margin: 0 !important; padding: 0 6px !important; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; box-shadow: none !important; cursor: pointer; transition: background .15s;
}
html body #buddypress .activity-list .activity-meta .afc-rx-sum:hover,
html body #buddypress .activity-list .activity-meta .afc-rx-sum[aria-expanded="true"] { background: var(--afc-soft, #f0f2f5) !important; }
#buddypress .afc-rx-sum.is-busy { opacity: .6; pointer-events: none; }
#buddypress .afc-rx-sum::before, #buddypress .afc-rx-sum::after { content: none !important; }
#buddypress .afc-rx-icos { display: inline-flex; align-items: center; }
#buddypress .afc-rx-ico {
	display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: -6px;
	border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #fff; font-size: 14px; line-height: 1;
}
#buddypress .afc-rx-ico:first-child { margin-left: 0; }
/* WordPress nahrádza emoji obrázkom img.emoji (1em) - pevná veľkosť, bez posunu */
#buddypress .afc-rx-ico img.emoji { width: 15px !important; height: 15px !important; margin: 0 !important; vertical-align: 0 !important; }
.afc-rx-pop-emoji img.emoji { width: 18px !important; height: 18px !important; margin: 0 !important; vertical-align: -3px !important; }
/* desktop: srdiečko (20 px) sedí hore vo svojom obale - súhrn rovnako, aby boli v jednej výške */
@media (min-width: 768px) {
	html body #buddypress .activity-list .activity-meta .generic-button.afc-rx-wrap { display: block; align-self: auto; }
	html body #buddypress .activity-list .activity-meta .afc-rx-sum { height: 20px !important; min-height: 20px !important; padding: 0 4px !important; vertical-align: top; }
	#buddypress .afc-rx-ico { width: 20px; height: 20px; }
}
#buddypress .afc-rx-sum.is-pop .afc-rx-icos { animation: afc-rx-pop .35s ease-out; }
@keyframes afc-rx-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: none; } }
/* súkromie príspevku (autor) ostáva úplne vpravo, hneď za súhrnom */
@media (min-width: 768px) {
	html body #buddypress .activity-list .activity-meta.action:has(> .afc-rx-wrap > .afc-rx-sum:not(.is-empty)) .rtm-activity-privacy-opt { margin-left: 6px !important; }
}

/* Detail fotky (lightbox aj stránka fotky): súhrn fotky. :not(#afc-x) prebije „#buddypress button“ z témy. */
html body #buddypress .rtmedia-single-container .afc-mrx-wrap { display: inline-flex; align-items: center; order: 99; margin-left: auto !important; vertical-align: middle; }
html body #buddypress .rtmedia-single-container .afc-mrx-wrap:has(> .afc-rx-sum.is-empty) { display: none !important; }
html body #buddypress .rtmedia-single-container .afc-mrx-sum:not(#afc-x) {
	display: inline-flex !important; align-items: center; justify-content: center;
	width: auto !important; height: 32px !important; min-height: 32px !important; min-width: 32px !important;
	margin: 0 !important; padding: 0 6px !important; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; box-shadow: none !important; color: inherit !important; cursor: pointer; transition: background .15s;
}
html body #buddypress .rtmedia-single-container .afc-mrx-sum:not(#afc-x):hover,
html body #buddypress .rtmedia-single-container .afc-mrx-sum:not(#afc-x)[aria-expanded="true"] { background: var(--afc-soft, #f0f2f5) !important; }
/* srdiečko fotky = srdiečko príspevku (trieda z afc-reactions.js) - červené ako na nástenke */
html body .rtm-single-meta:not(#afc-x) .rtmedia-actions-before-comments button.rtmedia-like.afc-liked,
html body .rtm-lightbox-container:not(#afc-x) button.rtmedia-like.afc-liked { color: #e0245e !important; }
/* číslo pri srdiečku v detaile fotky (ako .afc-fav-count na nástenke); tlačidlo má font-size 0 */
html body .rtm-single-meta:not(#afc-x) .rtmedia-actions-before-comments button.rtmedia-like .afc-like-num {
	display: inline-block; font-size: 13px !important; font-weight: 600; line-height: 1; color: #65676b !important; font-style: normal;
}
/* riadok Páči sa mi / Komentovať / Zdieľať: súhrn vpravo */
html body #buddypress .rtmedia-single-container .rtmedia-actions-before-comments:has(> .afc-mrx-wrap) { display: flex !important; flex-wrap: wrap; align-items: center; width: 100%; }
/* ostatné prvky riadku majú order 1-3 (Komentovať, Páči sa mi, Zdieľať) - súhrn vždy za nimi, úplne vpravo */
html body #buddypress .rtmedia-single-container .rtmedia-actions-before-comments > .afc-mrx-wrap { order: 99 !important; margin-left: auto !important; }
/* mobil: súhrn nad spodnou lištou fotky (presúva ho afc-reactions.js) */
@media (max-width: 767px) {
	html body .mfp-wrap #buddypress .afc-photo-modal > .afc-mrx-wrap.is-floating {
		position: absolute; right: 12px; bottom: calc(var(--afc-lb-bar-h, 58px) + 10px); z-index: 4; margin: 0;
	}
	html body .mfp-wrap #buddypress .afc-photo-modal > .afc-mrx-wrap.is-floating .afc-mrx-sum:not(#afc-x) {
		height: 34px !important; min-height: 34px !important; padding: 0 8px !important;
		background: rgba(255, 255, 255, .95) !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .3) !important;
	}
	/* text autora/popisu nesmie ísť pod súhrn */
	html body .mfp-wrap #buddypress .afc-photo-modal:has(> .afc-mrx-wrap.is-floating > .afc-rx-sum:not(.is-empty)) > .afc-lb-info:not([hidden]) { padding-right: 104px !important; }
}

/* okienko s počtami */
.afc-rx-pop {
	position: fixed; z-index: 100201; min-width: 190px; max-width: calc(100vw - 16px); padding: 10px 12px;
	border-radius: 14px; background: #fff; box-shadow: 0 6px 24px rgba(20, 30, 32, .22), 0 0 0 1px rgba(0, 0, 0, .04);
	font-size: 14px; color: var(--afc-text, #1c1e21);
}
.afc-rx-pop-title { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--afc-muted, #65676b); }
.afc-rx-pop-list { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.afc-rx-pop-list li { display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 5px 0 !important; list-style: none !important; }
.afc-rx-pop-list li::before { content: none !important; }
.afc-rx-pop-emoji { font-size: 18px; line-height: 1; }
.afc-rx-pop-label { flex: 1 1 auto; font-weight: 500; }
.afc-rx-pop-list li.is-mine .afc-rx-pop-label { color: #00788e; }
.afc-rx-pop-num { font-weight: 700; }
/* Srdiečko: dlhé podržanie nesmie označiť text ani otvoriť menu odkazu (iOS). */
#buddypress .activity-meta .fav,
#buddypress .activity-meta .unfav { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* 2) LIŠTA REAKCIÍ ------------------------------------------------------------ */
.afc-rx-picker {
	position: fixed; z-index: 100200; /* nad lightboxom fotky (100050) */ display: flex; gap: 2px; padding: 6px;
	border-radius: 999px; background: #fff; box-shadow: 0 6px 24px rgba(20, 30, 32, .22), 0 0 0 1px rgba(0, 0, 0, .04);
	opacity: 0; transform: translateY(6px) scale(.96); transform-origin: 50% 100%;
	transition: opacity .15s ease-out, transform .15s ease-out;
}
.afc-rx-picker.is-below { transform-origin: 50% 0; transform: translateY(-6px) scale(.96); }
.afc-rx-picker.is-open { opacity: 1; transform: none; }
html body .afc-rx-picker .afc-rx-pick {
	display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	width: auto !important; min-width: 58px !important; height: 58px !important; min-height: 0 !important;
	margin: 0 !important; padding: 4px 6px !important; border: 0 !important; border-radius: 16px !important;
	background: transparent !important; box-shadow: none !important; color: var(--afc-muted, #65676b) !important;
	font-family: inherit !important; cursor: pointer; transition: background .15s;
}
html body .afc-rx-picker .afc-rx-pick:hover,
html body .afc-rx-picker .afc-rx-pick:focus-visible { background: var(--afc-soft, #f0f2f5) !important; outline: none; }
html body .afc-rx-picker .afc-rx-pick.is-mine { background: #e6f6f8 !important; color: #00788e !important; }
.afc-rx-pick-emoji { font-size: 26px; line-height: 1; transition: transform .15s; }
.afc-rx-pick:hover .afc-rx-pick-emoji { transform: translateY(-2px) scale(1.12); }
.afc-rx-pick-label { font-size: 10px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
@media (max-width: 359px) {
	html body .afc-rx-picker .afc-rx-pick { min-width: 52px !important; padding: 4px 4px !important; }
	.afc-rx-pick-label { font-size: 9px; }
}

/* 3) KRITIKA: ŠTÍTOK + VODÍTKA ------------------------------------------------ */
#buddypress .afc-crit-badge {
	display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 2px 8px;
	border-radius: 999px; background: #e6f6f8; color: #00788e;
	font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: 1px;
}
#buddypress .afc-crit-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }
#buddypress .afc-crit-guide-hint { color: var(--afc-muted, #65676b); font-size: 12px; font-weight: 600; }
html body #buddypress .afc-crit-guide .afc-crit-chip {
	display: inline-flex !important; align-items: center; gap: 4px;
	width: auto !important; height: 30px !important; min-height: 30px !important; min-width: 0 !important;
	margin: 0 !important; padding: 0 10px !important; border: 1px solid var(--afc-soft-2, #e4e6eb) !important; border-radius: 999px !important;
	background: #fff !important; box-shadow: none !important; color: var(--afc-muted, #65676b) !important;
	font-family: inherit !important; font-size: 12px !important; font-weight: 600 !important; line-height: 1 !important; cursor: pointer;
}
html body #buddypress .afc-crit-guide .afc-crit-chip:hover { border-color: #0097b2 !important; color: #00788e !important; }

/* 4) TLAČIDLO KRITIKA VO FORMULÁRI (rovnaké ako Pridať fotku / Anketa) ---------- */
html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle {
	display: inline-flex !important; align-items: center; gap: 6px; flex: 0 0 auto;
	width: auto !important; height: 36px !important; min-height: 36px !important; min-width: 0 !important;
	margin: 0 !important; padding: 0 8px !important; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; box-shadow: none !important; color: var(--afc-muted, #65676b) !important;
	font-family: inherit !important; font-size: 14px !important; font-weight: 600; white-space: nowrap; cursor: pointer;
}
html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle:hover { color: #0097b2 !important; }
html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle.is-on {
	background: #e6f6f8 !important; color: #00788e !important; box-shadow: inset 0 0 0 1px #0097b2 !important;
}
#buddypress .afc-crit-icon { font-size: 17px; line-height: 1; }
/* Málo miesta v riadku (rozhoduje afc-reactions.js): len ikona, alebo vlastný riadok pod lištou. */
#buddypress .afc-crit-row { display: flex; flex: 1 1 100%; order: 20; min-width: 0; }
html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle.is-compact {
	width: 36px !important; min-width: 36px !important; padding: 0 !important; justify-content: center;
}
#buddypress .afc-crit-toggle.is-compact .afc-crit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle.is-row {
	width: auto !important; min-width: 0 !important; height: 32px !important; min-height: 32px !important;
	padding: 0 10px !important; font-size: 13px !important; justify-content: flex-start;
}
#buddypress .afc-crit-toggle.is-row .afc-crit-text { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
#buddypress .afc-crit-toggle.is-row .afc-crit-icon { font-size: 16px; }
@media (max-width: 767px) {
	/* ako Fotka a Anketa: len ikona */
	html body:is(.directory.activity, .single-item.groups, .bp-user) #buddypress #whats-new-form.activity-form .afc-crit-toggle {
		width: 36px !important; min-width: 36px !important; padding: 0 !important; justify-content: center;
	}
	#buddypress .afc-crit-toggle .afc-crit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	#buddypress .afc-crit-icon { font-size: 20px; }
}

/* 5) SKELETON PRI PRVOM NAČÍTANÍ NÁSTENKY ------------------------------------- */
#buddypress [data-bp-list="activity"] > #bp-ajax-loader { position: relative; }
#buddypress [data-bp-list="activity"] > #bp-ajax-loader > .bp-feedback {
	position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important;
	overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap; border: 0 !important;
}
#buddypress [data-bp-list="activity"] > #bp-ajax-loader::before,
#buddypress [data-bp-list="activity"] > #bp-ajax-loader::after {
	content: ""; display: block; height: 330px; margin: 0 0 16px; border-radius: 16px; background-color: #fff;
	background-repeat: no-repeat;
	background-image:
		radial-gradient(circle 20px at 36px 36px, #e4e7eb 98%, transparent 100%),
		linear-gradient(#e4e7eb, #e4e7eb), linear-gradient(#e4e7eb, #e4e7eb),
		linear-gradient(#e4e7eb, #e4e7eb), linear-gradient(#e4e7eb, #e4e7eb),
		linear-gradient(#eef0f2, #eef0f2);
	background-size: 100% 100%, 150px 12px, 80px 10px, 55% 12px, 35% 12px, calc(100% - 32px) 180px;
	background-position: 0 0, 68px 22px, 68px 42px, 16px 76px, 16px 98px, 16px 128px;
	animation: afc-rx-pulse 1.3s ease-in-out infinite;
}
#buddypress [data-bp-list="activity"] > #bp-ajax-loader::after { height: 150px; animation-delay: .2s; }
@keyframes afc-rx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
	#buddypress [data-bp-list="activity"] > #bp-ajax-loader::before,
	#buddypress [data-bp-list="activity"] > #bp-ajax-loader::after,
	#buddypress .afc-rx-sum.is-pop .afc-rx-icos { animation: none; }
	.afc-rx-picker, .afc-rx-pick-emoji { transition: none; }
}
