/* Ativa Player 1.0 | Rádio Ativa FM 98.1 */
:root {
	--ap-ink: #1b252e;
	--ap-slate: #2f3d49;
	--ap-steel: #546060;
	--ap-orange: #f26c30;
	--ap-red: #e53e4a;
	--ap-text: #ffffff;
	--ap-muted: rgba(255, 255, 255, .68);
	--ap-line: rgba(255, 255, 255, .12);
	--ap-h: 80px;
	--ap-radius: 18px;
	--ap-z: 9990;
}

body.has-ativa-player { padding-bottom: calc(var(--ap-h) + 16px); }
body.has-ativa-player.ap-minimized { padding-bottom: 0; }

/* Transição de página da navegação contínua */
html.is-changing .transition-fade { transition: opacity .22s ease; opacity: 1; }
html.is-animating .transition-fade { opacity: 0; }

.ap, .ap * { box-sizing: border-box; }
.ap {
	position: fixed;
	left: 50%;
	bottom: 12px;
	transform: translateX(-50%);
	width: min(1180px, calc(100% - 24px));
	z-index: var(--ap-z);
	color: var(--ap-text);
	font-family: inherit;
	line-height: 1.25;
	-webkit-font-smoothing: antialiased;
	transition: width .35s cubic-bezier(.2, .8, .2, 1), bottom .35s ease;
}
.ap__inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	height: var(--ap-h);
	padding: 0 14px 0 12px;
	border-radius: var(--ap-radius);
	background: linear-gradient(115deg, rgba(27, 37, 46, .96), rgba(47, 61, 73, .96));
	border: 1px solid var(--ap-line);
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .04) inset;
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	overflow: hidden;
}
.ap__glow {
	position: absolute;
	inset: -1px;
	border-radius: calc(var(--ap-radius) + 1px);
	background: linear-gradient(90deg, var(--ap-orange), var(--ap-red), var(--ap-orange));
	background-size: 200% 100%;
	opacity: 0;
	filter: blur(14px);
	z-index: -1;
	transition: opacity .6s ease;
}
.ap[data-state="playing"] .ap__glow { opacity: .35; animation: ap-glow 6s linear infinite; }
@keyframes ap-glow { to { background-position: 200% 0; } }

/* Botão principal */
.ap__play {
	position: relative;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(145deg, var(--ap-orange), var(--ap-red));
	box-shadow: 0 8px 22px -6px rgba(242, 108, 48, .7);
	transition: transform .15s ease, box-shadow .2s ease;
}
.ap__play:hover { transform: scale(1.05); }
.ap__play:active { transform: scale(.96); }
.ap__play::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(242, 108, 48, .55);
	opacity: 0;
}
.ap[data-state="idle"] .ap__play::after,
.ap[data-state="paused"] .ap__play::after { animation: ap-ring 2.4s ease-out infinite; }
@keyframes ap-ring { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.ap__icon { width: 26px; height: 26px; fill: currentColor; }
.ap__icon--play { margin-left: 3px; }
.ap__icon--pause, .ap__spinner { display: none; }
.ap[data-state="playing"] .ap__icon--play { display: none; }
.ap[data-state="playing"] .ap__icon--pause { display: block; }
.ap[data-state="loading"] .ap__icon--play { display: none; }
.ap[data-state="loading"] .ap__spinner {
	display: block;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	animation: ap-spin .8s linear infinite;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* Capa */
.ap__cover {
	position: relative;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--ap-slate);
	box-shadow: 0 0 0 1px var(--ap-line);
}
.ap__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s ease; }
.ap__eq {
	position: absolute;
	inset: auto 0 0 0;
	height: 22px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 3px;
	padding-bottom: 5px;
	background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
	opacity: 0;
	transition: opacity .3s ease;
}
.ap__eq i { width: 3px; height: 4px; border-radius: 2px; background: #fff; }
.ap[data-state="playing"] .ap__eq { opacity: 1; }
.ap[data-state="playing"] .ap__eq i { animation: ap-eq .9s ease-in-out infinite alternate; }
.ap__eq i:nth-child(2) { animation-delay: -.3s !important; }
.ap__eq i:nth-child(3) { animation-delay: -.6s !important; }
.ap__eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes ap-eq { 0% { height: 3px; } 100% { height: 14px; } }

/* Informações */
.ap__meta { flex: 1 1 auto; min-width: 0; }
.ap__badge {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ap-muted);
	margin-bottom: 3px;
	white-space: nowrap;
}
.ap__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-steel); flex: 0 0 auto; }
.ap[data-state="playing"] .ap__dot { background: var(--ap-red); box-shadow: 0 0 0 0 rgba(229, 62, 74, .7); animation: ap-dot 1.6s infinite; }
.ap[data-state="playing"] [data-ap-live] { color: #fff; }
@keyframes ap-dot { 70% { box-shadow: 0 0 0 7px rgba(229, 62, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 62, 74, 0); } }
.ap__sep { opacity: .5; }
.ap__freq { color: var(--ap-orange); }
.ap__listeners::before { content: "• "; opacity: .5; }
.ap__title, .ap__artist { overflow: hidden; white-space: nowrap; position: relative; }
.ap__title { font-size: 16px; font-weight: 700; }
.ap__artist { font-size: 13.5px; color: var(--ap-muted); margin-top: 1px; }
.ap__title span, .ap__artist span { display: inline-block; }
.ap__title.is-overflow, .ap__artist.is-overflow { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ap__title.is-overflow span, .ap__artist.is-overflow span { animation: ap-marquee var(--ap-dur, 12s) linear infinite; padding-right: 40px; }
@keyframes ap-marquee { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--ap-shift, -50%)); } }

/* Ações */
.ap__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ap__btn {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ap-muted);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
	text-decoration: none;
}
.ap__btn:hover, .ap__btn[aria-expanded="true"] { background: rgba(255, 255, 255, .09); color: #fff; }
.ap__btn svg { width: 22px; height: 22px; fill: currentColor; }
.ap__btn--wa:hover { color: #25d366; }
.ap__vol-off { display: none; }
.ap.is-muted .ap__vol-on { display: none; }
.ap.is-muted .ap__vol-off { display: block; }
.ap__volume { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.ap__range {
	-webkit-appearance: none;
	appearance: none;
	width: 96px;
	height: 4px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--ap-orange) var(--ap-vol, 85%), rgba(255, 255, 255, .2) var(--ap-vol, 85%));
	outline: none;
	cursor: pointer;
}
.ap__range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ap__range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.ap__btn--min svg { transition: transform .3s ease; }

.ap :focus-visible { outline: 2px solid var(--ap-orange); outline-offset: 2px; }

/* Histórico */
.ap__history {
	position: absolute;
	right: 8px;
	bottom: calc(var(--ap-h) + 10px);
	width: min(360px, calc(100vw - 32px));
	max-height: 60vh;
	overflow: auto;
	background: rgba(27, 37, 46, .98);
	border: 1px solid var(--ap-line);
	border-radius: 16px;
	box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .6);
	padding: 8px 8px 10px;
	animation: ap-pop .2s ease;
}
@keyframes ap-pop { from { opacity: 0; transform: translateY(8px); } }
.ap__history-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px 10px; font-size: 14px; }
.ap__history-list { list-style: none; margin: 0; padding: 0; }
.ap__history-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.ap__history-list li:hover { background: rgba(255, 255, 255, .05); }
.ap__history-list img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.ap__history-list .ap__h-text { min-width: 0; flex: 1; }
.ap__history-list strong, .ap__history-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap__history-list strong { font-size: 14px; }
.ap__history-list span { font-size: 12.5px; color: var(--ap-muted); }
.ap__history-list time { font-size: 12px; color: var(--ap-muted); flex: 0 0 auto; }
.ap__history-empty { color: var(--ap-muted); font-size: 14px; }

/* Recolhido */
.ap.is-minimized { width: auto; left: auto; right: 16px; transform: none; bottom: 16px; }
.ap.is-minimized .ap__inner { height: 68px; padding: 6px 6px 6px 6px; border-radius: 40px; gap: 6px; }
.ap.is-minimized .ap__meta,
.ap.is-minimized .ap__volume,
.ap.is-minimized .ap__btn--history,
.ap.is-minimized .ap__btn--wa,
.ap.is-minimized .ap__history { display: none; }
.ap.is-minimized .ap__cover { width: 44px; height: 44px; border-radius: 50%; }
.ap.is-minimized .ap__btn--min svg { transform: rotate(180deg); }

/* Celular */
@media (max-width: 760px) {
	:root { --ap-h: 72px; }
	.ap { width: calc(100% - 16px); bottom: 8px; }
	.ap__inner { gap: 10px; padding: 0 6px 0 8px; border-radius: 16px; }
	.ap__play { width: 50px; height: 50px; }
	.ap__cover { width: 48px; height: 48px; }
	.ap__volume, .ap__freq, .ap__freq + .ap__sep { display: none; }
	.ap__title { font-size: 15px; }
	.ap__artist { font-size: 13px; }
	.ap__btn { width: 36px; height: 36px; }
	.ap__history { right: 0; left: 0; width: auto; }
}
@media (max-width: 380px) {
	.ap__btn--wa { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ap *, .ap *::before, .ap *::after { animation: none !important; transition: none !important; }
	html.is-animating .transition-fade { opacity: 1; }
}

/* Botão de chamada para usar em qualquer página: [ativa_player_botao] */
.ap-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px 10px 10px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(145deg, #f26c30, #e53e4a);
	box-shadow: 0 8px 20px -8px rgba(242, 108, 48, .8);
}
.ap-cta__icon { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .22); position: relative; }
.ap-cta__icon::before { content: ""; position: absolute; left: 11px; top: 8px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
html.ap-is-playing .ap-cta__icon::before { left: 9px; top: 9px; width: 4px; height: 12px; border: 0; background: #fff; box-shadow: 8px 0 0 #fff; }

.ap-now-card { display: flex; align-items: center; gap: 14px; }
.ap-now-card img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.ap-now-card__label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #e53e4a; }
.ap-now-card strong { display: block; font-size: 18px; }
