/*
 * Flat, modern, deliberately LIGHTWEIGHT — no backdrop-filter/blur (expensive to
 * paint/repaint on scroll and on lower-end mobile GPUs), no colored glow shadows
 * (read as "smudgy" against light accent colors), minimal transition list.
 * Solid colors + clean typography only.
 *
 * Matches RetroTube's own dark tag/button family (#181818–#333, 1px borders —
 * see style.css's `.button`/`.label`/`.tag-cloud-link` rules) plus the theme's
 * own configurable accent color (--mhv-accent, set inline per-page from the
 * 'main-color' Customizer option — see class-mhv-player.php).
 *
 * --mhv-accent-text is computed server-side from the accent's actual perceived
 * brightness (Mhv_Player::get_contrasting_text_color()) — never hardcoded to
 * white, so a bright accent (e.g. this site's yellow) still gets legible
 * (dark) text on the active tab instead of a washed-out white-on-yellow.
 *
 * Placement: a slim block directly ABOVE `.video-player`, never overlapping the
 * player itself (see player-switcher.js's insertBefore) — never covers playback
 * controls or shifts the video area regardless of screen size.
 *
 * Breakpoints mirror the theme's own (768px / 992px — see style.css's @media
 * rules), mobile-first: base rules target phones, then progressively enhanced.
 */

.mhv-server-switcher-wrap {
	margin: 0 0 10px;
}

.mhv-server-switcher {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.mhv-server-switcher-label {
	font-size: 12px;
	font-weight: 600;
	color: #999;
	flex: 0 0 auto;
}

.mhv-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.mhv-tabs .mhv-tab {
	appearance: none;
	display: inline-flex;
	align-items: center;
	border: 1px solid #333;
	background: #1a1a1a;
	color: #aaa;
	padding: 0.42em 1em;
	font-size: 12.5px;
	font-weight: 600;
	border-radius: 5px;
	cursor: pointer;
	line-height: 1.3;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
	/* Comfortable tap target on touch devices without inflating desktop size. */
	min-height: 34px;
}

.mhv-tabs .mhv-tab:hover {
	background: #262626;
	color: #fff;
	border-color: #444;
}

.mhv-tabs .mhv-tab:focus-visible {
	outline: 2px solid var(--mhv-accent, #e91e63);
	outline-offset: 2px;
}

.mhv-tabs .mhv-tab.is-active {
	background: var(--mhv-accent, #e91e63);
	border-color: var(--mhv-accent, #e91e63);
	color: var(--mhv-accent-text, #ffffff);
}

/* Checkmark: reserved-width so text doesn't jump between states, just a quick
   fade — no scale/transform, keeps the transition list (and the paint work)
   minimal. */
.mhv-tabs .mhv-tab-check {
	display: inline-block;
	width: 0;
	overflow: hidden;
	opacity: 0;
	font-size: 11px;
	font-weight: 900;
	transition: width 0.12s ease, opacity 0.12s ease, margin 0.12s ease;
}

.mhv-tabs .mhv-tab.is-active .mhv-tab-check {
	width: 1em;
	opacity: 1;
	margin-right: 0.3em;
}

.mhv-server-hint {
	margin: 6px 0 0;
	font-size: 11px;
	color: #777;
}

/* Phones (< 768px): tabs share the row equally and grow to fill it — bigger,
   easier-to-hit touch targets than a left-aligned cluster of small buttons. */
@media (max-width: 767px) {
	.mhv-server-switcher {
		gap: 6px;
	}

	.mhv-server-switcher-label {
		flex: 0 0 100%;
	}

	.mhv-tabs .mhv-tab {
		flex: 1 1 0;
		justify-content: center;
		padding: 0.5em 0.4em;
		font-size: 12px;
	}
}

/* Tablet and up (>= 768px): label and tabs share one row, tabs size to content. */
@media (min-width: 768px) {
	.mhv-tabs .mhv-tab {
		flex: 0 0 auto;
	}
}

/* Desktop (>= 992px): slightly roomier, matches the theme's own desktop button padding. */
@media (min-width: 992px) {
	.mhv-tabs .mhv-tab {
		padding: 0.45em 1.2em;
		font-size: 13px;
	}
}
