/**
 * AGFO Cmx Full Width - media experience styles.
 * Prompt card and the realistic MediaElement audio player skin. Themed with --agfo-primary.
 */

/* ------------------------------------------------------------------
 * Prompt card
 * ---------------------------------------------------------------- */

.agfo-media-prompt {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	max-width: 360px;
	padding: 18px 20px;
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 16px;
	box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.agfo-media-prompt.is-open {
	opacity: 1;
	transform: translateY(0);
}

.agfo-media-prompt-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--agfo-primary, #a61e30) 12%, #ffffff);
	color: var(--agfo-primary, #a61e30);
}

.agfo-media-prompt-text {
	margin: 0 0 12px;
	font-size: 14.5px;
	line-height: 1.5;
	color: #1f2937;
}

.agfo-media-prompt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.agfo-media-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 7px 16px;
	border: 0;
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
}

.agfo-media-btn-primary {
	background: var(--agfo-primary, #a61e30);
	color: #ffffff;
}

.agfo-media-btn-primary:hover {
	filter: brightness(1.1);
}

.agfo-media-btn-ghost {
	background: transparent;
	color: #6b7280;
}

.agfo-media-btn-ghost:hover {
	background: rgba(15, 23, 42, 0.06);
	color: #374151;
}

/* ------------------------------------------------------------------
 * Main player attention pulse (after accepting the audio prompt)
 * ---------------------------------------------------------------- */

.agfo-media-highlight {
	animation: agfo-media-pulse 1s ease 2;
}

@keyframes agfo-media-pulse {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--agfo-primary, #a61e30) 45%, transparent); }
	100% { box-shadow: 0 0 0 14px rgba(0, 0, 0, 0); }
}

/* ------------------------------------------------------------------
 * Realistic MediaElement audio player skin (body.agfo-media-skin)
 *
 * CHANGED: full rewrite. Sprite icons stay at their native 20x20 size so
 * the MediaElement icon sheet never shifts; the play button gets its
 * colored circle from the wrapper instead of a scaled sprite. Progress
 * and volume bars are vertically centered with absolute positioning
 * (the old margin hack painted a stray bar under the player).
 * ---------------------------------------------------------------- */

body.agfo-media-skin .entry-content .wp-audio-shortcode {
	max-width: 100%;
}

body.agfo-media-skin .mejs-audio.mejs-container {
	height: 58px !important;
	padding: 9px 12px;
	box-sizing: border-box;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 12px;
	background: linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%);
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 10px 26px rgba(15, 23, 42, 0.07);
}

body.agfo-media-skin .mejs-audio .mejs-inner,
body.agfo-media-skin .mejs-audio .mejs-controls {
	height: 40px;
}

body.agfo-media-skin .mejs-audio .mejs-controls {
	display: flex;
	align-items: center;
	padding: 0;
	background: transparent;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-button {
	position: relative;
	width: 32px;
	height: 40px;
	margin: 0;
	background: transparent;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-button > button {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	padding: 0;
	background-color: transparent;
	filter: brightness(0) opacity(0.55);
	transition: filter 0.15s ease;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-button > button:hover,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-button > button:focus {
	filter: brightness(0) opacity(0.85);
	outline: 0;
}

/* Play / pause: primary colored circle, native-size white sprite inside. */
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button {
	width: 38px;
	height: 38px;
	margin: 1px 10px 1px 0;
	border-radius: 50%;
	background: var(--agfo-primary, #a61e30);
	box-shadow: 0 4px 10px color-mix(in srgb, var(--agfo-primary, #a61e30) 35%, transparent);
	transition: filter 0.15s ease, transform 0.1s ease;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button:hover {
	filter: brightness(1.08);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button:active {
	transform: scale(0.96);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button > button,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button > button:hover,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-playpause-button > button:focus {
	filter: brightness(0) invert(1);
}

/* Time labels. */
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time {
	display: flex;
	align-items: center;
	height: 40px;
	padding: 0 4px;
	box-sizing: border-box;
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	color: #64748b;
}

/* Progress rail: vertically centered, rounded, primary colored. */
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-rail {
	position: relative;
	flex: 1 1 auto;
	height: 40px;
	margin: 0 8px;
	padding: 0;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-total {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 5px;
	margin: 0;
	transform: translateY(-50%);
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.12);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-buffering,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-loaded {
	top: 0;
	height: 5px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.18);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-current {
	top: 0;
	height: 5px;
	border-radius: 999px;
	background: var(--agfo-primary, #a61e30);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-hovered,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-handle,
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-time-float {
	display: none;
}

/* Horizontal volume slider: centered on the control axis. */
body.agfo-media-skin .mejs-audio .mejs-controls .mejs-horizontal-volume-slider {
	position: relative;
	width: 62px;
	height: 40px;
	margin: 0 0 0 2px;
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-horizontal-volume-total {
	position: absolute;
	top: 50%;
	left: 0;
	width: 58px;
	height: 5px;
	margin: 0;
	transform: translateY(-50%);
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.12);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-horizontal-volume-current {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	margin: 0;
	border-radius: 999px;
	background: var(--agfo-primary, #a61e30);
}

body.agfo-media-skin .mejs-audio .mejs-controls .mejs-horizontal-volume-handle {
	display: none;
}

/* ------------------------------------------------------------------
 * Small screens
 * ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.agfo-media-prompt {
		right: 12px;
		bottom: 12px;
	}

	.agfo-media-prompt {
		left: 12px;
		max-width: none;
	}

	body.agfo-media-skin .mejs-audio .mejs-controls .mejs-horizontal-volume-slider {
		display: none;
	}
}
