/**
 * STUDIO 909 Continuous Player — player.css
 * Design : fond blanc, typographie noire, minimaliste, premium.
 * Aucune dependance externe (pas de framework CSS).
 *
 * IMPORTANT — specificite : chaque regle qui stylise l'interieur du player
 * est prefixee par #s909Player. C'est deliberement plus fort qu'une simple
 * classe : si un ancien widget (par ex. l'ancien widget HTML Elementor
 * remplace par ce plugin, voir README) laisse trainer un <style> qui
 * reutilise les memes noms de classe (.s909-player, .s909-cover, .s909-play...),
 * nos regles gagnent quand meme la cascade CSS, quel que soit l'ordre de
 * chargement des feuilles de style. C'est ce qui evite les rendus casses
 * (image de pochette etiree sur toute la largeur, bordures inattendues,
 * bouton mal style...) observes quand les deux jeux de styles coexistent.
 */

:root {
	--s909-bg: #ffffff;
	--s909-bg-elevated: #f0f0f0;
	--s909-fg: #0a0a0a;
	--s909-fg-muted: #595959;
	--s909-accent: #0a0a0a;
	--s909-live: #ff3b30;
	--s909-height: 92px;
	--s909-height-mobile: 84px;
	--s909-radius: 10px;
	--s909-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* -------------------------------------------------------------------
 * Barre compacte, fixe en bas de l'ecran.
 * ---------------------------------------------------------------- */
#s909Player.s909-player {
	position: fixed !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	top: auto !important;
	z-index: 999999 !important;
	display: flex !important;
	align-items: center;
	gap: 14px;
	width: 100% !important;
	max-width: 100vw !important;
	box-sizing: border-box;
	min-height: var(--s909-height);
	padding: 0 18px;
	padding-bottom: var(--s909-safe-bottom);
	background: var(--s909-bg) !important;
	color: var(--s909-fg);
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.1);
}

#s909Player * {
	box-sizing: border-box;
}

/* Pochette + badge LIVE — simple vignette, non interactive ---------- */
#s909Player .s909-cover-wrap {
	position: relative;
	flex: 0 0 auto !important;
	width: 58px !important;
	height: 58px !important;
	max-width: 58px !important;
	padding: 0;
	margin: 0;
	border-radius: 10px;
	overflow: visible;
	background: var(--s909-bg-elevated);
}

#s909Player .s909-cover {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	border-radius: 8px;
	object-fit: cover;
	background: linear-gradient(135deg, #e8e8e8, #d4d4d4);
}

#s909Player .s909-cover-empty {
	background: linear-gradient(135deg, #e8e8e8, #d4d4d4);
	/* Masque toute icone "image cassee" ou texte alternatif que certains
	 * navigateurs affichent tant qu'aucun src n'est encore defini. */
	color: transparent;
	font-size: 0;
}

#s909Player .s909-live {
	position: absolute;
	left: -4px;
	bottom: -7px;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fff;
	background: var(--s909-live);
	padding: 3px 6px;
	border-radius: 4px;
	white-space: nowrap;
	line-height: 1.4;
}

/* Metadonnees -------------------------------------------------------*/
#s909Player .s909-content {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none !important;
	display: flex;
	flex-direction: column;
	justify-content: center;
	line-height: 1.25;
}

#s909Player .s909-station {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: var(--s909-fg-muted);
	text-transform: uppercase;
	margin-bottom: 3px;
}

#s909Player .s909-station::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--s909-live);
	flex: none;
}

#s909Player .s909-track {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

#s909Player .s909-title {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--s909-fg);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#s909Player .s909-artist {
	font-size: 14px;
	font-weight: 500;
	color: var(--s909-fg-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Controles ---------------------------------------------------------*/
#s909Player .s909-controls {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 18px;
	padding-left: 18px;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
}

#s909Player .s909-play {
	flex: 0 0 auto !important;
	width: 52px !important;
	height: 52px !important;
	max-width: 52px !important;
	border-radius: 50%;
	border: 0;
	outline: none;
	background: #0a0a0a;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.12s ease;
	appearance: none;
	padding: 0;
	margin: 0;
}

#s909Player .s909-play:hover {
	transform: scale(1.05);
}

#s909Player .s909-play:active {
	transform: scale(0.96);
}

#s909Player .s909-play:focus-visible {
	outline: 2px solid var(--s909-fg);
	outline-offset: 2px;
}

#s909Player .s909-icon {
	width: 22px;
	height: 22px;
	fill: currentColor;
	flex: none;
}

#s909Player .s909-icon-pause {
	display: none;
}

#s909Player .s909-play.is-playing .s909-icon-play {
	display: none;
}

#s909Player .s909-play.is-playing .s909-icon-pause {
	display: block;
}

/* Mini-forme d'onde, discrete, active uniquement pendant la lecture.
 * Purement decorative (CSS pur, pas d'analyse audio reelle) : c'est le
 * clin d'oeil "radio professionnelle" repris des references type DI.FM,
 * sans dependance ni cout de performance. */
#s909Player .s909-equalizer {
	display: none;
	align-items: flex-end;
	gap: 3px;
	height: 24px;
}

html.s909-is-playing #s909Player .s909-equalizer {
	display: inline-flex;
}

#s909Player .s909-equalizer span {
	width: 3px;
	border-radius: 2px;
	background: var(--s909-live);
	opacity: 0.85;
	animation: s909-eq 1100ms ease-in-out infinite;
}

#s909Player .s909-equalizer span:nth-child(1) { height: 35%; animation-delay: -1.0s; }
#s909Player .s909-equalizer span:nth-child(2) { height: 70%; animation-delay: -0.6s; }
#s909Player .s909-equalizer span:nth-child(3) { height: 100%; animation-delay: -0.2s; }
#s909Player .s909-equalizer span:nth-child(4) { height: 55%; animation-delay: -0.8s; }
#s909Player .s909-equalizer span:nth-child(5) { height: 90%; animation-delay: -0.4s; }
#s909Player .s909-equalizer span:nth-child(6) { height: 45%; animation-delay: -1.1s; }
#s909Player .s909-equalizer span:nth-child(7) { height: 75%; animation-delay: -0.3s; }

@keyframes s909-eq {
	0%, 100% { transform: scaleY(0.3); }
	50% { transform: scaleY(1); }
}

/* Volume --------------------------------------------------------- */
#s909Player .s909-volume {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--s909-fg-muted);
}

#s909Player .s909-volume .s909-icon-volume {
	width: 18px;
	height: 18px;
}

#s909Player .s909-volume-range {
	width: 100px;
	accent-color: #0a0a0a;
}

/* Chargement de navigation (barre fine en haut de l'ecran) ----------*/
html.s909-nav-loading::before {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	height: 2px;
	width: 100%;
	z-index: 1000000;
	background: linear-gradient(90deg, transparent, #0a0a0a, transparent);
	background-size: 200% 100%;
	animation: s909-loading-bar 1s linear infinite;
}

@keyframes s909-loading-bar {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Lien "En Direct" ---------------------------------------------------*/
#s909Player .s909-live-link {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: var(--s909-fg-muted);
	text-decoration: none;
	transition: color 0.12s ease, background 0.12s ease;
}

#s909Player .s909-live-link:hover,
#s909Player .s909-live-link:focus-visible {
	color: var(--s909-fg);
	background: var(--s909-bg-elevated);
}

#s909Player .s909-icon-broadcast {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* -------------------------------------------------------------------
 * Mobile.
 *
 * Le player replie (barre compacte) doit rester parfaitement lisible :
 * on privilegie ici une taille de police et des zones tactiles genereuses
 * (>= 44px, recommandation d'accessibilite tactile) plutot que de tout
 * miniaturiser. On retire uniquement les elements secondaires (nom de la
 * station, volume) pour laisser la place au titre/artiste et au bouton.
 * ---------------------------------------------------------------- */
@media (max-width: 600px) {
	#s909Player.s909-player {
		min-height: var(--s909-height-mobile);
		padding: 0 14px;
		padding-bottom: var(--s909-safe-bottom);
		gap: 12px;
	}

	#s909Player .s909-cover-wrap {
		width: 56px !important;
		height: 56px !important;
		max-width: 56px !important;
	}

	#s909Player .s909-station,
	#s909Player .s909-volume {
		display: none;
	}

	#s909Player .s909-controls {
		border-left: none;
		padding-left: 0;
	}

	#s909Player .s909-content {
		gap: 2px;
	}

	#s909Player .s909-title {
		font-size: 17px;
		font-weight: 800;
		line-height: 1.3;
	}

	#s909Player .s909-artist {
		font-size: 14px;
		line-height: 1.3;
	}

	#s909Player .s909-play {
		width: 54px !important;
		height: 54px !important;
		max-width: 54px !important;
	}

	#s909Player .s909-icon {
		width: 22px;
		height: 22px;
	}

	#s909Player .s909-equalizer {
		display: none !important;
	}

	#s909Player .s909-live-link {
		width: 30px;
		height: 30px;
	}

	#s909Player .s909-icon-broadcast {
		width: 18px;
		height: 18px;
	}
}

/* Tres petits telephones (SE, mini...) : on resserre les marges, jamais
 * la taille du texte ni celle des zones tactiles. */
@media (max-width: 360px) {
	#s909Player.s909-player {
		padding: 0 10px;
		gap: 8px;
	}
}

/* Ecrans tactiles larges type tablette : on retrouve un peu plus d'aisance
 * sans pour autant repasser sur le gabarit desktop complet. */
@media (min-width: 601px) and (max-width: 900px) {
	#s909Player.s909-player {
		padding: 0 16px;
	}

	#s909Player .s909-station {
		display: none;
	}
}

/* Laisse toujours de la place en bas de la page (+ zone de securite iOS)
 * pour que le player fixe ne recouvre pas le pied de page WordPress. */
body {
	padding-bottom: calc(var(--s909-height) + var(--s909-safe-bottom));
}

@media (max-width: 600px) {
	body {
		padding-bottom: calc(var(--s909-height-mobile) + var(--s909-safe-bottom));
	}
}
