/* =============================================================
   IME Podcast Player — v1.3.0
   Italy Made Easy · Two-row premium audio player
   ============================================================= */

.ime-player {
	--ime-bg:          #1C3447;
	--ime-bg-dark:     #0f2334;
	--ime-blue:        #0090FF;
	--ime-blue-dark:   #0078d4;
	--ime-pink:        #E93D82;
	--ime-text:        #ffffff;
	--ime-text-muted:  rgba(255, 255, 255, 0.5);
	--ime-track:       rgba(255, 255, 255, 0.2);
	--ime-btn-hover:   rgba(255, 255, 255, 0.1);
	--ime-radius:      16px;
	--ime-play-size:   54px;
	--ime-btn-size:    40px;
	--ime-gradient:    linear-gradient(135deg, #0090FF, #E93D82);

	display: flex;
	flex-direction: column;
	gap: 0;
	background: var(--ime-bg);
	border-radius: var(--ime-radius);
	padding: 24px 28px 22px;
	font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--ime-text);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.16);
	position: relative;
	overflow: hidden;
	user-select: none;
	margin: 32px 0;
}

/* Brand gradient accent bar across the top */
.ime-player::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, #0090FF 0%, #E93D82 100%);
	pointer-events: none;
}

/* =============================================================
   ROW 1 — Brand + CTA (top), full-width title (below)
   ============================================================= */

.ime-player__row1 {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Top sub-row: podcast name + tricolor ↔ CTA button */
.ime-player__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.ime-player__brand {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ime-player__podcast-name {
	font-size: 12px;
	font-weight: 300;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ime-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Italian tricolor dots — approved brand element */
.ime-player__tricolor {
	display: flex;
	gap: 4px;
	align-items: center;
	margin: 4px 0 2px;
}
.ime-player__tricolor span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: block;
	flex-shrink: 0;
}
.ime-player__tricolor span:nth-child(1) { background: #009246; }
.ime-player__tricolor span:nth-child(2) { background: rgba(255, 255, 255, 0.8); }
.ime-player__tricolor span:nth-child(3) { background: #CE2B37; }

.ime-player__title-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

/* Episode number — solid blue square badge */
.ime-player__ep-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 6px;
	background: #0090FF;
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1;
}

.ime-player__title {
	font-size: 21px;
	font-weight: 700;
	color: var(--ime-text);
	line-height: 1.3;
}

/* CTA — white rounded rect, high contrast, premium */
.ime-player__cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	background: #ffffff;
	color: #1C3447;
	font-family: inherit;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	border-radius: 10px;
	padding: 13px 20px;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
	-webkit-tap-highlight-color: transparent;
}

.ime-player__cta-btn:hover {
	background: #EEF7FF;
	box-shadow: 0 0 0 2px rgba(0, 144, 255, 0.25);
}

.ime-player__cta-btn:active {
	transform: scale(0.97);
}

.ime-player__cta-icon {
	display: block;
	flex-shrink: 0;
	color: #0090FF;
}

/* =============================================================
   ROW 2 — Controls + Progress + Actions
   ============================================================= */

.ime-player__row2 {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 18px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.ime-player__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--ime-text);
	cursor: pointer;
	border-radius: 50%;
	width: var(--ime-btn-size);
	height: var(--ime-btn-size);
	padding: 0;
	flex-shrink: 0;
	transition: background 0.15s, transform 0.1s;
	-webkit-tap-highlight-color: transparent;
}

.ime-player__btn:hover  { background: var(--ime-btn-hover); }
.ime-player__btn:active { transform: scale(0.92); }

.ime-player__btn svg {
	width: 22px;
	height: 22px;
	display: block;
}

/* ── Controls cluster ─────────────────────────────────────────── */

.ime-player__controls {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

/* Play — large filled circle with pink gradient */
.ime-player__play {
	width: var(--ime-play-size);
	height: var(--ime-play-size);
	background: linear-gradient(135deg, #FF7EB8, #E93D82);
	color: #fff;
	margin: 0 4px;
	box-shadow: 0 4px 16px rgba(233, 61, 130, 0.35);
}
.ime-player__play:hover {
	background: linear-gradient(135deg, #F472B6, #C7326E);
	box-shadow: 0 4px 20px rgba(233, 61, 130, 0.5);
}
.ime-player__play svg   { width: 26px; height: 26px; }

/* Hide pause icon by default — higher specificity than .ime-player__btn svg */
.ime-player__btn .ime-player__icon-pause { display: none; }

/* Speed — text label */
.ime-player__speed-btn {
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	width: auto;
	min-width: 32px;
	height: var(--ime-btn-size);
	padding: 0 7px;
	border-radius: 8px;
}
.ime-player__speed-label { display: block; pointer-events: none; }

/* ── Speed menu ───────────────────────────────────────────────── */

.ime-player__speed-wrap { position: relative; }

.ime-player__speed-menu {
	display: none;
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--ime-bg-dark);
	border-radius: 12px;
	padding: 6px;
	z-index: 200;
	min-width: 72px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ime-player__speed-menu.open {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ime-player__speed-opt {
	background: transparent;
	border: none;
	color: var(--ime-text-muted);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	padding: 7px 12px;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	transition: background 0.12s, color 0.12s;
	-webkit-tap-highlight-color: transparent;
}
.ime-player__speed-opt:hover  { background: rgba(0, 144, 255, 0.2); color: #fff; }
.ime-player__speed-opt.active { background: var(--ime-blue); color: #fff; }

/* ── Progress block ───────────────────────────────────────────── */

.ime-player__progress-block {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.ime-player__progress {
	position: relative;
	height: 6px;
	background: var(--ime-track);
	border-radius: 6px;
	cursor: pointer;
	transition: height 0.15s;
}
.ime-player__progress:hover { height: 8px; }

.ime-player__progress-buffered,
.ime-player__progress-fill {
	position: absolute;
	top: 0; left: 0;
	height: 100%;
	border-radius: 6px;
	pointer-events: none;
	width: 0%;
}
.ime-player__progress-buffered { background: rgba(255, 255, 255, 0.2); }
.ime-player__progress-fill {
	background: linear-gradient(90deg, #0090FF, #E93D82);
	background-size: 450px 100%;
	background-repeat: no-repeat;
	transition: width 0.1s linear;
}

.ime-player__progress-thumb {
	position: absolute;
	top: 50%; left: 0%;
	transform: translate(-50%, -50%);
	width: 14px; height: 14px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
}
.ime-player__progress:hover .ime-player__progress-thumb,
.ime-player--seeking .ime-player__progress-thumb { opacity: 1; }

.ime-player__time {
	font-size: 12px;
	color: var(--ime-text-muted);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

/* ── Actions: volume + download ──────────────────────────────── */

.ime-player__actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.ime-player__volume-wrap { position: relative; }

.ime-player__volume-popup {
	display: none;
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--ime-bg-dark);
	border-radius: 12px;
	padding: 14px 16px;
	z-index: 200;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
	align-items: center;
	justify-content: center;
}
.ime-player__volume-popup.open { display: flex; }

.ime-player__volume {
	-webkit-appearance: slider-vertical;
	writing-mode: vertical-lr;
	direction: rtl;
	cursor: pointer;
	outline: none;
	accent-color: var(--ime-blue);
	width: 4px;
	height: 80px;
	margin: 0; padding: 0;
}

.ime-player__download { color: var(--ime-text); text-decoration: none; }

/* =============================================================
   Mobile — ≤ 640px
   ============================================================= */

@media (max-width: 640px) {
	.ime-player {
		padding: 18px 18px 16px;
	}

	/* Row 1: CTA wraps below brand on small screens */
	.ime-player__row1 {
		gap: 10px;
		padding-bottom: 14px;
	}

	.ime-player__top {
		flex-wrap: wrap;
	}

	.ime-player__title {
		font-size: 18px;
	}

	.ime-player__ep-num {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}

	.ime-player__cta-btn {
		flex: 0 0 100%;
		padding: 13px 20px;
		font-size: 12px;
	}

	/* Row 2 */
	.ime-player__row2 {
		gap: 12px;
		padding-top: 14px;
	}

	.ime-player {
		--ime-play-size: 48px;
		--ime-btn-size:  36px;
	}
}
