/**
 * Interests — front-end styles.
 *
 * Covers (1) the profile tab icon inside BuddyPress / GeneratePress menus,
 * and (2) the rendered tab body.
 */

/* ----------------------------------------------------------------
 * Nav tab icon — rendered via CSS ::before on the BP-generated <li>.
 *
 * STRATEGY (borrowed from the `handshaken-deals` plugin): we set
 * `item_css_id => 'interests-profile-tab'` in PHP. BuddyPress then
 * renders the tab as:
 *
 *   Legacy templates : <li id="interests-profile-tab-personal-li">
 *                         <a id="user-interests-profile-tab" ...>Interests</a>
 *                      </li>
 *   BP Nouveau       : <li id="interests-profile-tab-personal-li">
 *                         <a ...>Interests</a>
 *                      </li>
 *
 * We draw the football icon as a ::before pseudo-element on the
 * anchor. A CSS pseudo-element cannot be stripped by wp_kses, BP nav
 * sanitization, or any theme filter — it's generated by the browser
 * from our stylesheet, not by PHP output.
 *
 * Font-family stack covers FA4/FA5/FA6 Free & Pro so the icon renders
 * regardless of which FontAwesome version the theme has loaded.
 * ---------------------------------------------------------------- */

#interests-profile-tab-personal-li > a::before,
#user-interests-profile-tab::before,
li[id^="interests-profile-tab"] > a::before {
	content: "\f1e3";                            /* fa-futbol */
	font-family: "Font Awesome 6 Free",
				 "Font Awesome 6 Pro",
				 "Font Awesome 5 Free",
				 "Font Awesome 5 Pro",
				 "FontAwesome";
	font-weight: 400;                            /* regular variant */
	font-style: normal;
	font-variant: normal;
	text-rendering: auto;
	line-height: 1;
	display: inline-block;
	margin-right: 6px;
	vertical-align: -1px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	speak: none;
}

/* If the site only has the "Solid" FA file available (GeneratePress'
 * bundled subset being the common case), the browser falls back to
 * the solid variant of the glyph. Both look fine for a football. */
body.interests-force-solid-icon #interests-profile-tab-personal-li > a::before,
body.interests-force-solid-icon li[id^="interests-profile-tab"] > a::before {
	font-weight: 900;
}

/* Optional inline icon — if some future template passes INTERESTS_ICON_HTML
 * directly in page content, style it consistently. */
.interests-fa-icon {
	display: inline-block;
	margin-right: 6px;
	color: inherit;
	font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome";
	font-weight: 400;
	font-style: normal;
	-webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------
 * Profile tab body.
 * ---------------------------------------------------------------- */

.interests-profile-wrap {
	padding: 16px 0;
}

.interests-profile-wrap .interests-profile-empty {
	color: #6b7280;
	font-style: italic;
	padding: 20px;
	background: #f9fafb;
	border-radius: 6px;
	border: 1px dashed #d1d5db;
	text-align: center;
}

/* Success notice after saving. */
.interests-profile-wrap .interests-profile-notice {
  padding: 10px 14px;
  margin-bottom: 36px;
  background: #ecfdf5;
    background-clip: border-box;
  border-left: 4px solid #10b981;
  color: #065f46;
  font-size: 14px;
  border-radius: 4px;
  margin-top: -30px;
}

/* ----------------------------------------------------------------
 * Editable view — vertical checkbox list (owner + admin).
 * ---------------------------------------------------------------- */

.interests-profile-wrap .interests-edit-list {
	list-style: none;
	margin: 0 0 20px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.interests-profile-wrap .interests-edit-item {
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	padding: 10px 14px;
	transition: background-color .15s ease, border-color .15s ease;
}

.interests-profile-wrap .interests-edit-item:hover {
	background: #f9fafb;
	border-color: #cbd5e1;
}

.interests-profile-wrap .interests-edit-label {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	font-size: 15px;
	line-height: 1.4;
	cursor: pointer;
	background: transparent;
	border: 0;
	padding: 0;
}

.interests-profile-wrap .interests-edit-label:hover {
	background: transparent;
	border: 0;
}

.interests-profile-wrap .interests-edit-label input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	cursor: pointer;
}

.interests-profile-wrap .interests-edit-text {
	flex: 1 1 auto;
	word-break: break-word;
}

.interests-profile-wrap .interests-edit-actions {
	margin-top: 8px;
}

.interests-profile-wrap .interests-update-btn {
	min-width: 120px;
}

/* ----------------------------------------------------------------
 * Edit view: title, visibility radios, limit notice, disabled state.
 * ---------------------------------------------------------------- */

.interests-profile-wrap .interests-edit-title {
  margin: -20px 0 14px 0;
  padding: 12px 14px;
  background: #f8fafc;
  border-left: 3px solid #2271b1;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

.interests-profile-wrap .interests-visibility-fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 16px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	align-items: center;
}

.interests-profile-wrap .interests-visibility-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	cursor: pointer;
	color: #334155;
}

.interests-profile-wrap .interests-visibility-option input[type="radio"] {
	margin: 0;
	cursor: pointer;
	accent-color: #2271b1;
}

.interests-profile-wrap .interests-limit-notice {
	margin: 0 0 14px 0;
	padding: 10px 14px;
	background: #fef3c7;
	border-left: 3px solid #f59e0b;
	color: #78350f;
	font-size: 13px;
	line-height: 1.5;
	border-radius: 4px;
}

/* Disabled (cap-reached) state for unchecked items. */
.interests-profile-wrap .interests-edit-item--disabled {
	opacity: 0.45;
}
.interests-profile-wrap .interests-edit-item--disabled .interests-edit-label {
	cursor: not-allowed;
}
.interests-profile-wrap .interests-edit-item--disabled .interests-edit-label:hover {
	background: #fff;
	border-color: #e5e7eb;
}
.interests-profile-wrap .interests-edit-item--disabled .interests-edit-checkbox {
	cursor: not-allowed;
}

/* ----------------------------------------------------------------
 * Privacy gate — logged-out visitor on a "members-only" profile.
 * ---------------------------------------------------------------- */

.interests-privacy-gate {
	padding: 24px;
	margin: 0;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-align: center;
}

.interests-privacy-gate p {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: #334155;
}

.interests-privacy-gate .interests-auth-link {
	color: #2271b1;
	text-decoration: underline;
	font-weight: 600;
}

.interests-privacy-gate .interests-auth-link:hover {
	color: #1e5f92;
}

/* ----------------------------------------------------------------
 * Commitment slider — 7px × 150px track, 3px radius, 20px knob,
 * three snap positions (left / center / right).
 *
 * The label above the slider switches between:
 *   Light Interest    (pos 0)
 *   Active Engagement (pos 1)
 *   Full Commitment   (pos 2)
 * ---------------------------------------------------------------- */

.interests-profile-wrap .interests-slider {
	flex: 0 0 auto;
	width: 160px; /* 150 track + 5 overhang each side so knob doesn't clip */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	user-select: none;
}

.interests-profile-wrap .interests-slider-label {
	font-size: 12px;
	font-weight: 500;
	color: #475569;
	letter-spacing: 0.01em;
	text-align: center;
	line-height: 1.2;
	white-space: nowrap;
	min-height: 14px;
	transition: color .2s ease;
}

.interests-profile-wrap .interests-slider[data-level="2"] .interests-slider-label {
	color: #2271b1;
	font-weight: 600;
}

.interests-profile-wrap .interests-slider-track {
	position: relative;
	width: 150px;
	height: 7px;
	background: #e2e8f0;
	border-radius: 3px;
	cursor: pointer;
	outline: none;
	/* Room for the 20px knob to extend 6.5px above and below the track. */
	margin: 7px 0;
}

.interests-profile-wrap .interests-slider-track:focus-visible {
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.25);
}

/* Click targets for the three positions. Invisible but clickable. */
.interests-profile-wrap .interests-slider-tick {
	position: absolute;
	top: -10px;
	width: 24px;
	height: 27px;
	transform: translateX(-50%);
	cursor: pointer;
}
.interests-profile-wrap .interests-slider-tick[data-pos="0"] { left: 0; }
.interests-profile-wrap .interests-slider-tick[data-pos="1"] { left: 50%; }
.interests-profile-wrap .interests-slider-tick[data-pos="2"] { left: 100%; }

/* The moving knob. 20px round. Snaps to 0 / 50% / 100%. */
.interests-profile-wrap .interests-slider-knob {
	position: absolute;
	top: 50%;
	left: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
	border: 1px solid #94a3b8;
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.08),
		0 2px 4px rgba(0, 0, 0, 0.06);
	transform: translate(-50%, -50%);
	transition: left .18s cubic-bezier(0.4, 0, 0.2, 1),
	            background .18s ease,
	            border-color .18s ease;
	pointer-events: none;
}

.interests-profile-wrap .interests-slider[data-level="0"] .interests-slider-knob { left: 0; }
.interests-profile-wrap .interests-slider[data-level="1"] .interests-slider-knob { left: 50%; }
.interests-profile-wrap .interests-slider[data-level="2"] .interests-slider-knob { left: 100%; }

/* Track fill — colors the portion from left to the knob position. */
.interests-profile-wrap .interests-slider-track::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	border-radius: 3px 0 0 3px;
	background: linear-gradient(90deg, #60a5fa 0%, #2271b1 100%);
	transition: width .18s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.interests-profile-wrap .interests-slider[data-level="0"] .interests-slider-track::before { width: 0; }
.interests-profile-wrap .interests-slider[data-level="1"] .interests-slider-track::before { width: 50%; }
.interests-profile-wrap .interests-slider[data-level="2"] .interests-slider-track::before {
	width: 100%;
	border-radius: 3px;
}

/* Highlight the knob itself at level 2. */
.interests-profile-wrap .interests-slider[data-level="2"] .interests-slider-knob {
	background: linear-gradient(180deg, #2271b1 0%, #1e5f92 100%);
	border-color: #1e5f92;
}

.interests-profile-wrap .interests-slider-track:hover .interests-slider-knob {
	box-shadow:
		0 2px 4px rgba(0, 0, 0, 0.12),
		0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Mobile — stack the slider below the label so everything fits. */
@media (max-width: 520px) {
	.interests-profile-wrap .interests-edit-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.interests-profile-wrap .interests-slider {
		align-self: flex-end;
	}
}

/* ----------------------------------------------------------------
 * Visitor view title — explanatory line above the pill row.
 * ---------------------------------------------------------------- */

.interests-profile-wrap .interests-public-title {
	margin: 0 0 18px 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #475569;
	font-style: italic;
}

/* ----------------------------------------------------------------
 * Public view — horizontal inline-flow list.
 *
 * Items flow horizontally with ~15px horizontal space between them,
 * wrap naturally when the container's right edge is reached, and have
 * 15px of VERTICAL space between wrapped rows (controlled by the
 * margin-bottom on each item).
 *
 * Each item is a soft pill whose size/color/padding/radius scales
 * with the owner's commitment slider position.
 * ---------------------------------------------------------------- */

.interests-profile-wrap .interests-public-row {
	/* line-height set to 1 so the 15px margin below each item controls
	   the full vertical gap between wrapped rows, not an unpredictable
	   sum of line-height + margin. */
	line-height: 1;
	word-spacing: normal;
	/* Offset the first item's left margin so the row aligns flush-left. */
	margin-left: -7px;
}

.interests-public-item {
	display: inline-block;
	vertical-align: middle;
	/* Horizontal: 7px on each side → ~14–15px between adjacent items.
	 * Vertical:   15px below each item → 15px gap between wrapped rows. */
	margin: 0 7px 15px 7px;
}

/* Level 0 — Light Interest. */
.interests-profile-wrap .interests-public-item[data-level="0"] {
	font-size: 15px;
	color: #000;
	background: #cccccc30;
	padding: 6px 13px;
	border-radius: 8px;
}

/* Level 1 — Active Engagement. */
.interests-profile-wrap .interests-public-item[data-level="1"] {
	font-size: 18px;
	color: #566f49;
	background: #bbc3ac3b;
	padding: 6px 15px;
	border-radius: 10px;
	font-weight: 600;
}

/* Level 2 — Full Commitment. */
.interests-profile-wrap .interests-public-item[data-level="2"] {
	font-size: 23px;
	color: #47752f;
	font-weight: 600;
	padding: 8px 15px;
	background: #d1ddc052;
	border-radius: 12px;
}

/* If items happen to render as <a> (autolink), strip default link
 * styling so the pill look is preserved. Color still inherits from
 * the per-level rule above. */
.interests-profile-wrap a.interests-public-item,
.interests-profile-wrap a.interests-public-item:hover,
.interests-profile-wrap a.interests-public-item:focus,
.interests-profile-wrap a.interests-public-item:visited {
	text-decoration: none;
	color: inherit;
}

.interests-profile-wrap a.interests-public-item:hover {
	filter: brightness(0.94);
	transition: filter .15s ease;
}

/* ----------------------------------------------------------------
 * Members directory — "Filtered by interest: X" banner.
 *
 * Rendered by Interests_Autolink::render_filter_banner() when the
 * URL contains `?interest=<value>`. Styled to read like a BP/WP
 * info notice — subtle, scannable, with a "Clear filter" link on
 * the right.
 * ---------------------------------------------------------------- */

.interests-filter-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 10px 14px;
	margin: 0 0 18px 0;
	background: #eef4fb;
	border-left: 4px solid #2271b1;
	color: #1e3a5f;
	font-size: 14px;
	line-height: 1.4;
	border-radius: 4px;
}

.interests-filter-banner-label {
	flex: 1 1 auto;
}

.interests-filter-banner-label strong {
	font-weight: 600;
	color: #2271b1;
}

.interests-filter-banner-clear {
	flex: 0 0 auto;
	color: #2271b1;
	text-decoration: underline;
	font-size: 13px;
}

.interests-filter-banner-clear:hover {
	color: #1e3a5f;
}
