/* AB Stations 25 — radio page player */

:root {
	--ab-radio-width: 920px;
}

.ab-radio-denied {
	max-width: var(--ab-radio-width, 920px);
	margin: 2rem auto;
	padding: 1.25rem 1.5rem;
	border-radius: 14px;
	background: #fff8f5;
	border: 1px solid #f0d8c8;
	text-align: center;
	line-height: 1.6;
}

.ab-radio-denied a {
	color: inherit;
	font-weight: 600;
}

.ab-radio-trial-notice {
	margin: 0 0 1.25rem;
	padding: 0.9rem 1.15rem;
	border-radius: var(--ab-radius, 14px);
	background: var(--ab-teal, #d8edeb);
	border: 1px solid #c5ddd9;
	color: var(--ab-text, #111);
	line-height: 1.55;
	text-align: center;
}

.ab-radio-trial-notice a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.ab-radio {
	--ab-yellow: #ffcc06;
	--ab-teal: #d8edeb;
	--ab-text: #111;
	--ab-muted: #5a5a5a;
	--ab-border: #e8e8e8;
	--ab-radius: 14px;
	width: 100%;
	max-width: var(--ab-radio-width);
	margin: 0 auto 3rem;
	font-family: inherit;
}

/* Center radio page intro + player as one column */
.ab-page__content:has(.ab-radio) {
	width: min(100%, var(--ab-radio-width));
	max-width: var(--ab-radio-width);
	margin-inline: auto;
}

.ab-page__content:has(.ab-radio) > :not(.ab-radio) {
	text-align: center;
}

.ab-page__content:has(.ab-radio) .ab-radio {
	text-align: left;
}

body:has(.ab-radio) .ab-page__title {
	width: min(100%, var(--ab-radio-width));
	max-width: var(--ab-radio-width);
	margin-inline: auto;
}

.ab-radio .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Fixed footer player --- */
.ab-footer-player {
	--ab-yellow: #ffcc06;
	--ab-text: #111;
	--ab-muted: #5a5a5a;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #f5f5f5;
	color: var(--ab-text);
	border-top: 1px solid #ddd;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	font-family: inherit;
}

.ab-footer-player__inner {
	max-width: 920px;
	margin: 0 auto;
	padding: 0.55rem 1.25rem 0.75rem;
}

.ab-footer-player__progress {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 0.45rem;
	width: 100%;
	box-sizing: border-box;
}

.ab-footer-player__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	min-height: 44px;
}

.ab-footer-player__station {
	flex: 1;
	min-width: 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--ab-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ab-footer-player.is-active .ab-footer-player__station {
	color: var(--ab-text);
}

.ab-footer-player__buttons {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
}

body.ab-radio-active {
	padding-bottom: 110px;
}

/* --- Progress bar --- */
.ab-progress {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
	padding: 0 0.15rem;
}

.ab-progress__time {
	flex-shrink: 0;
	min-width: 2.5rem;
	font-size: 0.78rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--ab-muted);
	text-align: center;
}

.ab-progress__track-wrap {
	display: block;
	width: 100%;
	min-width: 0;
	margin: 0;
	cursor: pointer;
}

.ab-progress__seek {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	height: 8px;
	border-radius: 999px;
	background-color: rgba(0, 0, 0, 0.12);
	background-image: linear-gradient(
		to right,
		#ffcc06 0%,
		#ffcc06 var(--ab-seek-pct, 0%),
		rgba(0, 0, 0, 0.12) var(--ab-seek-pct, 0%),
		rgba(0, 0, 0, 0.12) 100%
	);
	cursor: pointer;
	outline: none;
	touch-action: none;
}

.ab-footer-player__progress {
	min-height: 1.5rem;
}

.ab-progress__seek:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.ab-progress__seek::-webkit-slider-runnable-track {
	height: 8px;
	border-radius: 999px;
	background: transparent;
}

.ab-progress__seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--ab-text);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	margin-top: -4px;
	transition: transform 0.12s ease;
}

.ab-progress__seek:not(:disabled):active::-webkit-slider-thumb {
	transform: scale(1.15);
}

.ab-progress__seek::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.1);
}

.ab-progress__seek::-moz-range-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--ab-yellow);
}

.ab-progress__seek::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--ab-text);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.ab-ctrl-btn {
	border: none;
	cursor: pointer;
	width: 34px;
	height: 34px;
	background-color: transparent;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	text-indent: -9999px;
	overflow: hidden;
	padding: 0;
	opacity: 1;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.ab-ctrl-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.ab-ctrl-btn--main {
	width: 44px;
	height: 44px;
	background-color: var(--ab-yellow);
	border-radius: 50%;
	background-size: 20px;
	box-shadow: 0 2px 10px rgba(255, 204, 6, 0.4);
}

#prev-track { background-image: var(--ab-icon-prev); }
#play-pause.play { background-image: var(--ab-icon-play); }
#play-pause.pause { background-image: var(--ab-icon-pause); }
#stop-track { background-image: var(--ab-icon-stop); }
#next-track { background-image: var(--ab-icon-next); }

.ab-volume {
	display: flex;
	align-items: center;
	margin-left: 0.25rem;
}

.ab-volume input[type="range"] {
	width: 100px;
	accent-color: var(--ab-text);
	cursor: pointer;
}

/* --- Favorite button --- */
.ab-fav-btn {
	flex-shrink: 0;
	border: none;
	background: rgba(255, 255, 255, 0.65);
	cursor: pointer;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease, transform 0.15s ease;
}

.ab-fav-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.ab-fav-btn__icon {
	width: 20px;
	height: 20px;
	background-image: var(--ab-icon-heart);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.ab-fav-btn.is-favorite .ab-fav-btn__icon {
	background-image: var(--ab-icon-heart-filled);
}

/* --- Sections --- */
.ab-radio-section__title {
	margin: 0 0 0.85rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ab-muted);
	text-align: center;
}

.ab-radio-favorites {
	margin-bottom: 2rem;
}

.ab-radio-favorites__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.55rem;
}

.ab-radio-favorites__empty {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ab-muted);
	text-align: center;
}

.ab-radio-favorites.has-items .ab-radio-favorites__empty {
	display: none;
}

.ab-fav-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--ab-border);
	border-radius: 999px;
	background: #fff;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--ab-text);
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ab-fav-chip.is-active {
	background: var(--ab-yellow);
	border-color: var(--ab-yellow);
}

.ab-fav-chip__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ab-muted);
}

.ab-fav-chip.is-active .ab-fav-chip__dot {
	background: var(--ab-text);
}

/* --- Station list --- */
#station-selector {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--ab-border);
	border-radius: var(--ab-radius);
	overflow: hidden;
	background: #fff;
}

.station-row {
	display: flex;
	align-items: stretch;
	border-bottom: 1px solid var(--ab-border);
}

.station-row:last-child {
	border-bottom: none;
}

.station-btn {
	all: unset;
	box-sizing: border-box;
	flex: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	cursor: pointer;
	padding: 0.85rem 1rem;
	min-width: 0;
	transition: background 0.15s ease;
}

.station-left {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}

.station-left .play-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	background-image: var(--ab-icon-play);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0.55;
}

.station-btn.active-station .play-icon {
	background-image: var(--ab-icon-pause);
	opacity: 1;
}

.station-btn.active-station.is-paused .play-icon {
	background-image: var(--ab-icon-play);
}

.station-left .station-name {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--ab-text);
}

.station-btn .tags {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	justify-content: flex-end;
	margin-left: auto;
	flex-shrink: 0;
}

.station-btn .ab-tag {
	background: var(--ab-teal);
	border-radius: 999px;
	padding: 0.15rem 0.55rem;
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--ab-text);
}

.station-btn.active-station {
	background: var(--ab-yellow);
}

.station-btn.active-station .ab-tag {
	background: rgba(255, 255, 255, 0.55);
}

.ab-fav-btn--row {
	border-radius: 0;
	width: 48px;
	height: auto;
	background: transparent;
	border-left: 1px solid var(--ab-border);
}

/* --- Desktop: single row --- */
@media (min-width: 769px) {
	.ab-footer-player__inner {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 1rem;
		padding: 0.65rem 1.25rem;
	}

	.ab-footer-player__controls {
		order: 1;
		flex-shrink: 0;
		flex-wrap: nowrap;
		justify-content: flex-start;
	}

	.ab-footer-player__buttons {
		order: 1;
	}

	.ab-footer-player__station {
		order: 2;
		flex: 0 1 auto;
		max-width: 220px;
	}

	.ab-volume {
		order: 3;
	}

	.ab-footer-player__progress {
		order: 2;
		flex: 1;
		min-width: 0;
		width: auto;
		margin-bottom: 0;
	}
}

/* --- Mobile --- */
@media (max-width: 768px) {
	body.ab-radio-active {
		padding-bottom: 120px;
	}

	#wpadminbar {
		display: none !important;
	}

	html, body {
		overflow-x: hidden;
		margin-top: 0 !important;
	}

	.ab-footer-player__inner {
		padding: 0.45rem 0.75rem 0.65rem;
	}

	.ab-footer-player__progress {
		gap: 0.45rem;
		padding: 0 0.1rem;
	}

	.ab-progress__time {
		font-size: 0.72rem;
		min-width: 2.35rem;
	}

	.ab-footer-player__controls {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.35rem;
	}

	.ab-footer-player__station {
		font-size: 0.82rem;
		text-align: center;
		width: 100%;
	}

	.ab-footer-player__buttons {
		justify-content: center;
	}

	.ab-volume {
		justify-content: center;
	}

	.ab-ctrl-btn {
		width: 28px;
		height: 28px;
	}

	.ab-ctrl-btn--main {
		width: 38px;
		height: 38px;
	}

	.ab-volume input[type="range"] {
		width: 70px;
	}

	.station-btn {
		flex-direction: column;
		align-items: flex-start;
	}

	.station-btn .tags {
		justify-content: flex-start;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.ab-volume {
		display: none;
	}

	.ab-footer-player__progress {
		gap: 0.35rem;
	}

	.ab-progress__time {
		font-size: 0.68rem;
		min-width: 2.1rem;
	}

	.ab-progress__seek {
		height: 10px;
	}

	.ab-progress__seek::-webkit-slider-runnable-track {
		height: 10px;
	}

	.ab-progress__seek::-webkit-slider-thumb {
		width: 16px;
		height: 16px;
		margin-top: -3px;
	}
}
