/* ==========================================================================
   RWA Floating Radio Player
   ========================================================================== */

/* ---- Layout ---- */
.rwa-player {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
	padding: 0 20px;
	background: linear-gradient(135deg, #121218 0%, #1a1a2e 50%, #16213e 100%);
	color: #fff;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, .45);
	transition: transform .4s cubic-bezier(.4, 0, .2, 1);
	will-change: transform;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Collapsed state */
.rwa-player.rwa-player--collapsed {
	transform: translateY(calc(100% - 0px));
	min-height: 0;
	height: 0;
	padding: 0;
	overflow: hidden;
}

/* Toggle pill when collapsed */
.rwa-player--collapsed .rwa-player__btn--toggle {
	position: fixed;
	bottom: 0;
	right: 20px;
	z-index: 100000;
}

/* ---- Metadata (left) ---- */
.rwa-player__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
}

.rwa-player__artwork {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	overflow: hidden;
	background: #222;
}

.rwa-player__artwork img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity .3s ease;
}

.rwa-player__info {
	min-width: 0;
}

.rwa-player__status {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 2px;
}

.rwa-player__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 10px;
	border-radius: 20px;
	background: rgba(16, 185, 129, .18);
	color: #10b981;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	white-space: nowrap;
}

.rwa-player__badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #10b981;
	animation: rwa-pulse 1.8s ease-in-out infinite;
}

@keyframes rwa-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: .5; transform: scale(.7); }
}

.rwa-player__name {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 260px;
	transition: opacity .2s ease;
}

.rwa-player__desc {
	margin: 0;
	font-size: 12px;
	color: rgba(255, 255, 255, .55);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 320px;
	transition: opacity .2s ease;
}

/* Fade out during now-playing metadata swap */
.rwa-player__meta-fade {
	opacity: 0;
}

/* ---- Controls (center) ---- */
.rwa-player__controls {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

/* Volume button + popup group */
.rwa-player__vol-group {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.rwa-player__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: none;
	color: rgba(255, 255, 255, .75);
	cursor: pointer;
	padding: 8px;
	border-radius: 50%;
	transition: background .2s, color .2s, transform .15s;
	-webkit-tap-highlight-color: transparent;
}

.rwa-player__btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, .08);
}

.rwa-player__btn:active {
	transform: scale(.92);
}

/* Play button – bigger + accent ring */
.rwa-player__btn--play {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: linear-gradient(135deg, #ff6b35 0%, #f7931a 100%);
	color: #fff;
	box-shadow: 0 4px 16px rgba(255, 107, 53, .35);
	margin: 0 4px;
}

.rwa-player__btn--play:hover {
	background: linear-gradient(135deg, #ff8555 0%, #ffa640 100%);
	color: #fff;
	box-shadow: 0 6px 20px rgba(255, 107, 53, .5);
}

/* Spinner inside play button */
.rwa-player__spinner {
	width: 24px;
	height: 24px;
	border: 3px solid rgba(255, 255, 255, .3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rwa-spin .7s linear infinite;
}

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

/* ---- Right section ---- */
.rwa-player__right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

/* Volume popup */
.rwa-player__volume-wrap {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	background: rgba(20, 20, 40, .92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-radius: 16px;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .5);
	width: 36px;
	height: 120px;
	z-index: 10;
	overflow: visible;
}

.rwa-player__volume {
	-webkit-appearance: none;
	appearance: none;
	width: 96px;
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .15);
	outline: none;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-90deg);
}

.rwa-player__volume::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ff6b35;
	cursor: pointer;
	box-shadow: 0 0 8px rgba(255, 107, 53, .5);
	margin-top: -6px;
}

.rwa-player__volume::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ff6b35;
	cursor: pointer;
	border: 0;
	box-shadow: 0 0 8px rgba(255, 107, 53, .5);
}

.rwa-player__volume::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .15);
}

.rwa-player__volume::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .15);
}

/* Toggle / collapse button */
.rwa-player__btn--toggle {
	transition: transform .3s ease, background .2s;
}

.rwa-player--collapsed .rwa-player__btn--toggle svg {
	transform: rotate(180deg);
}

/* ---- Floating toggle pill (visible when collapsed) ---- */
#rwa-player-mini-toggle {
	position: fixed;
	bottom: 12px;
	right: 20px;
	z-index: 100000;
	display: none;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: none;
	border-radius: 28px;
	background: linear-gradient(135deg, #121218, #1a1a2e);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
	transition: transform .2s;
	-webkit-tap-highlight-color: transparent;
}

#rwa-player-mini-toggle:hover {
	transform: translateY(-2px);
}

.rwa-player--collapsed ~ #rwa-player-mini-toggle {
	display: inline-flex;
}

/* ---- Share toast ---- */
.rwa-player__toast {
	position: fixed;
	bottom: 84px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background: #10b981;
	color: #fff;
	padding: 8px 20px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s, transform .3s;
	z-index: 100001;
}

.rwa-player__toast.rwa-player__toast--show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
	.rwa-player {
		padding: 0 12px;
		gap: 10px;
		min-height: 64px;
	}

	.rwa-player__artwork {
		width: 40px;
		height: 40px;
		border-radius: 6px;
	}

	.rwa-player__name {
		font-size: 13px;
		max-width: 120px;
	}

	.rwa-player__desc {
		font-size: 11px;
		max-width: 140px;
	}

	.rwa-player__badge {
		font-size: 10px;
		padding: 2px 7px;
	}

	.rwa-player__btn--play {
		width: 42px;
		height: 42px;
	}

	.rwa-player__btn--play svg {
		width: 22px;
		height: 22px;
	}
}

@media (max-width: 480px) {
	.rwa-player {
		flex-wrap: wrap;
		gap: 6px;
		padding: 8px 10px;
		min-height: auto;
	}

	.rwa-player__meta {
		flex: 1 1 100%;
		order: 1;
	}

	.rwa-player__controls {
		flex: 1;
		justify-content: center;
		order: 2;
	}

	.rwa-player__right {
		order: 3;
	}

	.rwa-player__btn--share {
		display: none;
	}
}

/* ---- Padding for page content so player doesn't overlap ---- */
body.rwa-has-player {
	padding-bottom: 80px;
}

@media (max-width: 480px) {
	body.rwa-has-player {
		padding-bottom: 110px;
	}
}

/* ==========================================================================
   Share Modal
   ========================================================================== */
.rwa-share {
	position: fixed;
	inset: 0;
	z-index: 200000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
}

.rwa-share--open {
	opacity: 1;
	pointer-events: auto;
}

.rwa-share__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.rwa-share__card {
	position: relative;
	width: 90%;
	max-width: 400px;
	background: #fff;
	border-radius: 20px;
	padding: 32px 28px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	transform: translateY(30px) scale(.95);
	transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.rwa-share--open .rwa-share__card {
	transform: translateY(0) scale(1);
}

.rwa-share__close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 28px;
	color: #666;
	cursor: pointer;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 50%;
	transition: background .2s, color .2s;
}

.rwa-share__close:hover {
	background: rgba(0, 0, 0, .06);
	color: #333;
}

.rwa-share__title {
	margin: 0 0 20px;
	font-size: 18px;
	font-weight: 700;
	color: #222;
}

.rwa-share__artwork {
	width: 200px;
	height: 200px;
	margin: 0 auto 16px;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}

.rwa-share__artwork img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rwa-share__name {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	color: #222;
}

.rwa-share__desc {
	margin: 0 0 24px;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
}

.rwa-share__socials {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
}

.rwa-share__social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	color: #fff;
	text-decoration: none;
	transition: transform .2s, box-shadow .2s;
}

.rwa-share__social:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.rwa-share__social--fb { background: #1877f2; }
.rwa-share__social--x { background: #000; }
.rwa-share__social--tiktok { background: #000; }
.rwa-share__social--ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.rwa-share__social--wa { background: #25d366; }
.rwa-share__social--web { background: #555; }

@media (max-width: 480px) {
	.rwa-share__card {
		padding: 24px 18px;
	}

	.rwa-share__artwork {
		width: 160px;
		height: 160px;
	}

	.rwa-share__social {
		width: 48px;
		height: 48px;
	}

	.rwa-share__social svg {
		width: 20px;
		height: 20px;
	}
}
