@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap');

.ssp-player {
	--ssp-color-bg: #12141c;
	--ssp-color-primary: #00e5ff;
	--ssp-color-accent: #ff2fb0;
	--ssp-color-text: #eaf6ff;

	position: relative;
	overflow: hidden;
	background: var(--ssp-color-bg);
	color: var(--ssp-color-text);
	border-radius: 16px;
	padding: 18px 22px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	box-shadow:
		0 8px 24px rgba(0, 0, 0, 0.35),
		inset 0 0 0 1px rgba(255, 255, 255, 0.06);
	max-width: 560px;
}

/* ====================
   STAGE (speakers + player)
   ==================== */
.ssp-stage {
	--ssp-color-bg: #12141c;
	--ssp-color-primary: #00e5ff;
	--ssp-color-accent: #ff2fb0;
	--ssp-color-text: #eaf6ff;

	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	max-width: 860px;
}

.ssp-stage .ssp-player {
	max-width: 560px;
	flex: 1 1 auto;
}

/* ====================
   SPEAKERS
   ==================== */
.ssp-speaker {
	flex: 0 0 auto;
	/* Safe fallback before JS measures the player and sets the exact
	   height below -- keeps this from ever exploding to a browser's
	   default SVG intrinsic size while the page is still loading. */
	height: 100px;
	overflow: hidden;
	filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.ssp-speaker-svg {
	display: block;
	height: 100%;
	width: auto;
}

.ssp-speaker--right .ssp-speaker-svg {
	transform: scaleX(-1);
}

.ssp-driver {
	transform-origin: 0 0;
	transition: transform 0.05s linear;
}

/* Frequency-reactive rings: green for bass (woofer), yellow for mid
   (midrange), red for treble (tweeter). JS sets opacity and a glow
   filter each frame based on the live audio level for that band; the
   short transition here smooths the frame-to-frame changes into a
   readable pulse instead of a flicker. */
.ssp-ring {
	opacity: 0.18;
	transition: opacity 0.08s linear, filter 0.08s linear;
}

.ssp-ring--bass {
	stroke: #39ff6a;
	color: #39ff6a;
}

.ssp-ring--mid {
	stroke: #ffe135;
	color: #ffe135;
}

.ssp-ring--treble {
	stroke: #ff3b3b;
	color: #ff3b3b;
}

.ssp-stage:not(.is-playing) .ssp-driver {
	animation: ssp-idle-breathe 4s ease-in-out infinite;
}

.ssp-stage:not(.is-playing) .ssp-driver--mid {
	animation-delay: -0.6s;
}

.ssp-stage:not(.is-playing) .ssp-driver--tweeter {
	animation-delay: -1.2s;
}

@keyframes ssp-idle-breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.015); }
}

@media (prefers-reduced-motion: reduce) {
	.ssp-stage:not(.is-playing) .ssp-driver {
		animation: none;
	}
}

@media (max-width: 720px) {
	.ssp-speaker {
		display: none;
	}
}

.ssp-player--unconfigured {
	max-width: none;
	padding: 14px 18px;
	font-size: 14px;
}

.ssp-player--unconfigured a {
	color: var(--ssp-color-primary, #00e5ff);
}

/* ====================
   VISUALIZER
   ==================== */
.ssp-visualizer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0.5;
	pointer-events: none;
	z-index: 0;
	transition: opacity 0.4s ease;
}

.ssp-player:not(.is-playing) .ssp-visualizer {
	opacity: 0.12;
}

/* ====================
   CONTROLS LAYOUT
   ==================== */
.ssp-controls {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* ====================
   PLAY BUTTON
   ==================== */
.ssp-play-btn {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--ssp-color-primary);
	color: #05070a;
	box-shadow: 0 0 0 rgba(0, 229, 255, 0);
	transition: box-shadow 0.25s ease, transform 0.15s ease;
}

.ssp-play-btn:hover {
	transform: scale(1.05);
}

.ssp-play-btn:active {
	transform: scale(0.97);
}

.ssp-player.is-playing .ssp-play-btn {
	box-shadow: 0 0 0 6px rgba(0, 229, 255, 0.2);
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--ssp-color-primary) 20%, transparent);
}

.ssp-play-btn:focus-visible {
	outline: 2px solid var(--ssp-color-accent);
	outline-offset: 3px;
}

.ssp-play-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* Belt-and-suspenders: some theme CSS resets strip the browser's default
   [hidden] { display: none } rule, which would show both icons at once. */
.ssp-play-btn svg[hidden] {
	display: none !important;
}

/* ====================
   TRACK INFO
   ==================== */
.ssp-track-info {
	flex: 1 1 auto;
	min-width: 0;
}

.ssp-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: 'Orbitron', sans-serif;
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ssp-color-primary);
	margin-bottom: 4px;
}

.ssp-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #6b7280;
	flex: 0 0 auto;
}

.ssp-status-dot[data-state="live"],
.ssp-status-dot[data-state="online"] {
	background: var(--ssp-color-accent);
	box-shadow: 0 0 8px var(--ssp-color-accent);
	animation: ssp-pulse 1.6s ease-in-out infinite;
}

.ssp-status-dot[data-state="connecting"] {
	background: #f5a623;
}

.ssp-status-dot[data-state="offline"] {
	background: #6b7280;
}

@keyframes ssp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
	.ssp-status-dot[data-state="live"],
	.ssp-status-dot[data-state="online"] {
		animation: none;
	}
}

.ssp-track-text {
	display: flex;
	gap: 6px;
	font-size: 15px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ssp-artist {
	font-weight: 600;
	flex: 0 0 auto;
}

.ssp-title {
	color: var(--ssp-color-text);
	opacity: 0.85;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ====================
   VOLUME
   ==================== */
.ssp-volume {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ssp-color-primary);
}

.ssp-icon-volume {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex: 0 0 auto;
}

.ssp-volume-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 90px;
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.15);
	cursor: pointer;
}

.ssp-volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--ssp-color-primary);
	box-shadow: 0 0 6px var(--ssp-color-primary);
	cursor: pointer;
}

.ssp-volume-slider::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: none;
	border-radius: 50%;
	background: var(--ssp-color-primary);
	box-shadow: 0 0 6px var(--ssp-color-primary);
	cursor: pointer;
}

.ssp-volume-slider:focus-visible {
	outline: 2px solid var(--ssp-color-accent);
	outline-offset: 3px;
}

/* ====================
   RESPONSIVE
   ==================== */
@media (max-width: 480px) {
	.ssp-player {
		padding: 14px 16px;
	}

	.ssp-controls {
		flex-wrap: wrap;
	}

	.ssp-volume {
		flex: 1 1 100%;
		order: 3;
	}

	.ssp-volume-slider {
		width: 100%;
	}
}
