/* Live Radio sticky player — dual mode (live / offline) */

/* ── Root ──────────────────────────────────────────────────────────────── */

.live-radio-player {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	color: #fff;
	font-family: var(--font-body, system-ui, sans-serif);
	will-change: transform;
	transform: translateZ(0);
	transition: min-height 0.2s ease;
}

/* Offline (default — muted, compact) */
.live-radio-player.is-offline {
	background: linear-gradient(180deg, #0c1118 0%, #111827 100%);
	border-top: 1px solid rgba(200, 134, 10, 0.25);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
	min-height: 48px;
}

/* Live (full player) */
.live-radio-player.is-live {
	background: linear-gradient(180deg, #0f172a 0%, #161d33 100%);
	border-top: 2px solid #C8860A;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4), 0 -2px 12px rgba(200, 134, 10, 0.2);
	min-height: 74px;
}

/* ── Inner shell ────────────────────────────────────────────────────────── */

.lr-inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 22px;
	height: 100%;
	display: flex;
	align-items: stretch;
	position: relative;
}

/* ── Live content — shown only when .is-live ────────────────────────────── */

.lr-live-content {
	display: none;
	align-items: center;
	gap: clamp(14px, 2vw, 28px);
	width: 100%;
	padding: 6px 0;
}

.live-radio-player.is-live .lr-live-content {
	display: flex;
}

/* Logos block */
.lr-logos {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
	min-width: 190px;
	justify-content: center;
}

.lr-logo-gs {
	width: 48px;
	height: 34px;
	border-radius: 9px;
	overflow: hidden;
	background: #1e293b;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.lr-logo-gs img {
	width: 46px;
	height: 32px;
	object-fit: contain;
	display: block;
}

.lr-logo-sep {
	width: 1px;
	height: 34px;
	background: rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
}

.lr-logo-fm {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.lr-logo-fm img {
	width: 48px;
	height: 26px;
	object-fit: contain;
	display: block;
}

.lr-fm-badge {
	font-size: 8px;
	font-weight: 700;
	color: #fff;
	background: #1e3a5f;
	border-radius: 3px;
	padding: 1px 4px;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.lr-fm-sub {
	display: none;
	font-size: 7px;
	color: rgba(255, 255, 255, 0.35);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Vertical divider between logos and play */
.lr-divider-v {
	width: 1px;
	height: 40px;
	background: rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
}

/* Play button */
.lr-play-btn {
	flex-shrink: 0;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: linear-gradient(135deg, #C8860A 0%, #9a6400 100%);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 150ms ease, box-shadow 150ms ease;
	box-shadow: 0 4px 16px rgba(200, 134, 10, 0.5);
}

.lr-play-btn:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 20px rgba(200, 134, 10, 0.65);
}

.lr-play-btn:focus-visible {
	outline: 2px solid #D4940A;
	outline-offset: 3px;
}

.lr-play-btn .lr-icon {
	transform: translateX(1px);
}

.lr-play-btn .lr-icon--pause {
	transform: none;
}

/* main.css sets display:block on svg — override hidden attr */
.lr-play-btn .lr-icon[hidden] {
	display: none;
}

/* Spinner */
.lr-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lr-spin 0.7s linear infinite;
}

.lr-play-btn.is-loading .lr-icon    { display: none; }
.lr-play-btn.is-loading .lr-spinner { display: inline-block; }

@keyframes lr-spin {
	to { transform: rotate(360deg); }
}

/* Info block */
.lr-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.lr-info-top {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.lr-badge-live {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #dc2626;
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	padding: 2px 8px;
	border-radius: 999px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
}

.lr-dot {
	width: 5px;
	height: 5px;
	background: #fff;
	border-radius: 50%;
	flex-shrink: 0;
	animation: lr-pulse 1.5s ease-in-out infinite;
}

@keyframes lr-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.3; }
}

.lr-brand {
	font-size: 12px;
	font-weight: 800;
	color: #C8860A;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.lr-station {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.8);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lr-show-name {
	font-size: 10px;
	color: rgba(255, 255, 255, 0.4);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.live-radio-player.is-live .lr-show-name {
	display: none;
}

.lr-typewriter {
	display: inline-flex;
	align-items: center;
	min-height: 0.85rem;
	font-family: var(--font-display, var(--font-body, system-ui, sans-serif));
	font-size: 10px;
	line-height: 1;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(212, 148, 10, 0.92);
	white-space: nowrap;
	overflow: hidden;
	max-width: 44ch;
}

.lr-typewriter__text {
	overflow: visible;
}

.lr-typewriter__cursor {
	display: inline-block;
	width: 1px;
	height: 0.95em;
	margin-left: 5px;
	background: currentColor;
	animation: lr-typewriter-cursor 0.9s steps(1) infinite;
}

@keyframes lr-typewriter-cursor {
	0%, 45% { opacity: 1; }
	46%, 100% { opacity: 0; }
}

.lr-volume {
	display: none;
	align-items: center;
	gap: 8px;
	flex: 0 0 126px;
	max-width: 126px;
	padding: 7px 9px;
	border: 1px solid rgba(200, 134, 10, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.045);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 860px) {
	.lr-volume { display: inline-flex; }
}

.lr-volume-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba(255, 255, 255, 0.72);
	cursor: pointer;
	transition: color 0.2s ease, transform 0.2s ease;
}

.lr-volume-btn:hover,
.lr-volume-btn:focus-visible {
	color: #D4940A;
	transform: translateY(-1px);
	outline: none;
}

.lr-volume-icon[hidden] {
	display: none;
}

.lr-volume-range {
	width: 72px;
	height: 4px;
	accent-color: #C8860A;
	cursor: pointer;
}

/* Wave bars */
.lr-wave {
	display: none;
	align-items: flex-end;
	gap: 3px;
	height: 28px;
	flex-shrink: 0;
}

@media (min-width: 520px) {
	.lr-wave { display: flex; }
}

.lr-wave span {
	display: inline-block;
	width: 4px;
	background: #C8860A;
	border-radius: 2px;
	transform-origin: bottom;
	transform: scaleY(0.25);
}

body.lr-playing .lr-wave span {
	animation: lr-wave-bar 0.8s ease-in-out infinite alternate;
}

body.lr-playing .lr-wave span:nth-child(1) { height: 10px; animation-delay: 0ms;   }
body.lr-playing .lr-wave span:nth-child(2) { height: 22px; animation-delay: 120ms; }
body.lr-playing .lr-wave span:nth-child(3) { height: 28px; animation-delay: 60ms;  }
body.lr-playing .lr-wave span:nth-child(4) { height: 16px; animation-delay: 180ms; }
body.lr-playing .lr-wave span:nth-child(5) { height: 20px; animation-delay: 90ms;  }

.live-radio-player.is-live .lr-wave span:nth-child(1) { height: 10px; }
.live-radio-player.is-live .lr-wave span:nth-child(2) { height: 22px; }
.live-radio-player.is-live .lr-wave span:nth-child(3) { height: 28px; }
.live-radio-player.is-live .lr-wave span:nth-child(4) { height: 16px; }
.live-radio-player.is-live .lr-wave span:nth-child(5) { height: 20px; }

@keyframes lr-wave-bar {
	0%   { transform: scaleY(0.25); }
	100% { transform: scaleY(1);    }
}

/* ── Offline content — shown only when .is-offline ──────────────────────── */

.lr-offline-content {
	display: none;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 0;
}

.live-radio-player.is-offline .lr-offline-content {
	display: flex;
}

/* Small logo */
.lr-logo-sm {
	width: 42px;
	height: 34px;
	background: #1e293b;
	border-radius: 7px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.6;
}

.lr-logo-sm img {
	width: 40px;
	height: 32px;
	object-fit: contain;
	display: block;
}

/* Offline info */
.lr-offline-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.lr-offline-top {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.lr-offline-label {
	font-size: 10px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.45);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
}

.lr-offline-sep {
	color: rgba(255, 255, 255, 0.15);
	font-size: 12px;
}

.lr-offline-next {
	font-size: 10px;
	color: rgba(255, 255, 255, 0.65);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lr-next-time {
	color: #C8860A;
	font-weight: 700;
}

.lr-offline-sched {
	font-size: 9px;
	color: rgba(255, 255, 255, 0.3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lr-typewriter--offline {
	font-size: 9px;
	color: rgba(212, 148, 10, 0.75);
}

/* Countdown */
.lr-countdown {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	color: #C8860A;
	white-space: nowrap;
}

.lr-countdown:empty {
	display: none;
}

/* ── Error toast ────────────────────────────────────────────────────────── */

.lr-error {
	position: absolute;
	top: -32px;
	left: 50%;
	transform: translateX(-50%);
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}

.lr-error[hidden] { display: none; }

/* ── Body offset ────────────────────────────────────────────────────────── */

body:has(#live-radio-player.is-live)    { padding-bottom: 78px; }
body:has(#live-radio-player.is-offline) { padding-bottom: 48px; }

/* Fallback: no :has() support */
@supports not selector(:has(*)) {
	body { padding-bottom: 74px; }
}

/* ── Mobile adjustments ─────────────────────────────────────────────────── */

@media (max-width: 479px) {
	.lr-station,
	.lr-offline-sched,
	.lr-typewriter {
		display: none;
	}

	.lr-divider-v {
		display: none;
	}

	.lr-logos {
		gap: 6px;
	}

	.lr-logo-gs {
		width: 46px;
		height: 34px;
	}

	.lr-logo-gs img {
		width: 44px;
		height: 32px;
	}

	.lr-logo-fm img {
		width: 42px;
		height: 23px;
	}

	.lr-play-btn {
		width: 46px;
		height: 46px;
	}
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.lr-play-btn,
	.lr-dot,
	.lr-spinner,
	.lr-typewriter__cursor,
	body.lr-playing .lr-wave span {
		animation: none !important;
		transition: none !important;
	}
}
