/* Profile hero: the colour banner, the settings (gear) menu and the
   background picker. Ported from Riftmana's inc/profile-background.css
   (2026-10-22) in SpellMana blue (#03a9f4, buttons #0277bd with white words)
   where Riftmana uses gold. The header layout itself is in
   ultimate-member/templates/profile-spellmana.css. Loaded only on Ultimate
   Member's profile page. */

/* ══════════════════════════════════════════════════════════════════════
   BANNER — a layer INSIDE the header; the header content (avatar, name,
   stats) sits on top of it. Always rendered, with a neutral default until a
   colour is chosen, so nothing shifts when one is added or removed. A chosen
   colour sets the `background` shorthand inline (PHP, or the JS preview),
   overriding the default below.
   ══════════════════════════════════════════════════════════════════════ */
.sm-pbg-cover {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: #15151c;
	background-image: linear-gradient(135deg, #262532 0%, #1a1922 55%, #131218 100%);
	border-radius: 16px;
}

/* Readability scrim: darker on the left (where the content sits) and along
   the bottom, fading toward the top-right where the colour shows. */
.sm-pbg-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: 16px;
	background:
		linear-gradient(90deg, rgba(8,8,11,.86) 0%, rgba(8,8,11,.48) 38%, rgba(8,8,11,.14) 72%, rgba(8,8,11,.06) 100%),
		linear-gradient(0deg, rgba(8,8,11,.72) 0%, rgba(8,8,11,0) 52%);
}

@media (max-width: 600px) {
	/* Content is centred on a phone: an even top-to-bottom darken instead of
	   the left-weighted desktop scrim. */
	.sm-pbg-cover::after {
		background: linear-gradient(180deg, rgba(8, 8, 11, .5) 0%, rgba(8, 8, 11, .32) 38%, rgba(8, 8, 11, .66) 100%);
	}
}

/* ══════════════════════════════════════════════════════════════════════
   SETTINGS (GEAR) MENU — the grouped panel with icon boxes.
   ══════════════════════════════════════════════════════════════════════ */
.sm-profile-hero .sm-settings-dropdown {
	position: relative;
}

.sm-profile-hero .sm-settings-gear {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	background: #2a2a2a;
	border: 1px solid #444;
	border-radius: 6px;
	color: #ccc;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sm-profile-hero .sm-settings-gear:hover,
.sm-profile-hero .sm-settings-gear[aria-expanded="true"] {
	background: #3a3a3a;
	border-color: #666;
	color: #fff;
}

.sm-profile-hero .sm-settings-gear:focus {
	outline: none;
}

.sm-profile-hero .sm-settings-gear:focus-visible {
	outline: 2px solid #03a9f4;
	outline-offset: 2px;
}

.sm-profile-hero .sm-settings-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 100;
	min-width: 230px;
	padding: 7px;
	background: #2a2a2a;
	border: 1px solid #444;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
	text-align: left;
}

/* Opened by the JS (click/tap), not hover: hover never fires on touch. */
.sm-profile-hero .sm-settings-menu.is-open {
	display: block;
}

.sm-settings-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sm-settings-group-label {
	padding: 8px 10px 4px;
	color: #a8a8a8;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.sm-settings-sep {
	height: 1px;
	margin: 6px 8px;
	background: #3a3a3a;
}

/* Items: links and buttons alike. The admin menu prints Ultimate Member's own
   links (Delete, Deactivate, …) as plain <a>, so those get the same row. */
.sm-profile-hero .sm-settings-menu .sm-menu-item,
.sm-profile-hero .sm-settings-menu a {
	display: flex;
	align-items: center;
	gap: 11px;
	box-sizing: border-box;
	width: 100%;
	min-height: 0;
	padding: 9px 10px;
	background: none;
	border: 0;
	border-radius: 6px;
	color: #f5f5f5;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.sm-profile-hero .sm-settings-menu .sm-menu-item:hover,
.sm-profile-hero .sm-settings-menu a:hover {
	background: #3a3a3a;
	color: #fff;
	text-decoration: none;
}

.sm-profile-hero .sm-settings-menu .sm-menu-item:focus-visible,
.sm-profile-hero .sm-settings-menu a:focus-visible {
	outline: 2px solid #03a9f4;
	outline-offset: -2px;
}

.sm-mi-ic {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, .06);
	border-radius: 8px;
	color: #cfcfd4;
	transition: background .15s ease, color .15s ease;
}

.sm-mi-ic svg {
	width: 15px;
	height: 15px;
}

.sm-profile-hero .sm-settings-menu .sm-menu-item:hover .sm-mi-ic {
	background: #0277bd;
	color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   MODAL SHELL (.sm-pm-*) — the background picker. The shared popup look:
   #222 box, #3a3a3a edge, 10px corners, 38px buttons.
   ══════════════════════════════════════════════════════════════════════ */
.sm-pm-modal[hidden] {
	display: none;
}

.sm-pm-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sm-pm-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .7);
	animation: sm-pm-fade .15s ease;
}

.sm-pm-box {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 28px;
	background: #222;
	border: 1px solid #3a3a3a;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	color: #e0e0e0;
	animation: sm-pm-pop .12s cubic-bezier(.2, .8, .2, 1);
}

@keyframes sm-pm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sm-pm-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.sm-pm-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: #aaa;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.sm-pm-close:hover {
	background: #2a2a2a;
	color: #fff;
}

.sm-pm-close:focus {
	outline: none;
}

.sm-pm-close:focus-visible {
	outline: 2px solid #03a9f4;
	outline-offset: -2px;
}

.sm-pm-head {
	margin-bottom: 20px;
}

.sm-pm-head h2 {
	margin: 0 0 4px;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
}

.sm-pm-sub {
	margin: 0;
	color: #a8a8a8;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.sm-pm-foot {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 4px;
	padding-top: 18px;
	border-top: 1px solid #2a2a2a;
}

.sm-pm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 38px;
	min-height: 0;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.sm-pm-btn-primary {
	background: #0277bd;
	border-color: #0277bd;
	color: #fff;
}

.sm-pm-btn-primary:hover {
	background: #0288d1;
	border-color: #0288d1;
	color: #fff;
}

.sm-pm-btn-primary:disabled {
	opacity: .6;
	cursor: wait;
}

.sm-pm-btn-ghost {
	background: #1a1a1a;
	border-color: #3a3a3a;
	color: #ddd;
}

.sm-pm-btn-ghost:hover {
	background: #1a1a1a;
	border-color: #555;
	color: #fff;
}

/* ── Colour chips ─────────────────────────────────────────────────────
   Pills carrying the colour in --dc (set inline per chip in the PHP). */
.sm-bg-domains {
	margin-bottom: 18px;
}

.sm-bg-domains + .sm-bg-domains {
	margin-top: 2px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .07);
}

.sm-bg-domains-label {
	display: block;
	margin-bottom: 10px;
	color: rgba(255, 255, 255, .72);
	font-size: 12.5px;
	font-weight: 600;
}

.sm-bg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sm-bg-chip {
	--dc: #6b6b78;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	padding: 8px 14px 8px 11px;
	background: #202027;
	border: 1.5px solid #33333c;
	border-radius: 999px;
	color: #d9d9df;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.sm-bg-chip:hover {
	background: #202027;
	border-color: var(--dc);
	color: #fff;
	transform: translateY(-1px);
}

.sm-bg-chip:focus {
	outline: none;
}

.sm-bg-chip:focus-visible {
	outline: 2px solid #03a9f4;
	outline-offset: 2px;
}

.sm-bg-chip-dot {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	background: var(--dc);
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 0 9px -1px var(--dc);
}

.sm-bg-chip.is-selected {
	background: color-mix(in srgb, var(--dc) 22%, #1c1c22);
	border-color: var(--dc);
	box-shadow: 0 0 0 1px var(--dc) inset;
	color: #fff;
}

/* Black's --dc is the lighter banner slate (set in the PHP) so its edge and
   glow show on the dark chip; the dot itself stays the deck-dot black. */
.sm-bg-chip[data-domain="black"] .sm-bg-chip-dot {
	background: #374151;
}

/* "None": a hollow, slashed dot; neutral grey selection. */
.sm-bg-chip-none {
	--dc: #6b6b78;
}

.sm-bg-chip-none .sm-bg-chip-dot {
	position: relative;
	overflow: hidden;
	background: transparent;
	box-shadow: inset 0 0 0 1.5px #6b6b78;
}

.sm-bg-chip-none .sm-bg-chip-dot::after {
	content: "";
	position: absolute;
	top: 50%;
	left: -2px;
	right: -2px;
	height: 1.5px;
	background: #8a8a94;
	transform: rotate(-45deg);
}

.sm-bg-chip-none.is-selected {
	background: rgba(255, 255, 255, .06);
	border-color: #7a7a86;
	box-shadow: 0 0 0 1px #6b6b78 inset;
}

@media (prefers-reduced-motion: reduce) {
	.sm-pm-backdrop,
	.sm-pm-box { animation: none; }
	.sm-bg-chip { transition: none; }
}
