/**
 * Hamenagen - מחוון הורדת שיר
 */

html[data-hm-theme="light"],
html:not([data-hm-theme]) {
	--hm-dlprog-brand: #cb1e53;
	--hm-dlprog-navy: #20215a;
	--hm-dlprog-text: #333333;
	--hm-dlprog-muted: #666666;
	--hm-dlprog-surface: #ffffff;
	--hm-dlprog-track: rgba(32, 33, 90, 0.12);
	--hm-dlprog-shadow: 0 16px 40px rgba(32, 33, 90, 0.22);
}

html[data-hm-theme="dark"] {
	--hm-dlprog-brand: #e8457a;
	--hm-dlprog-navy: #f5f5f7;
	--hm-dlprog-text: #f5f5f7;
	--hm-dlprog-muted: rgba(245, 245, 247, 0.65);
	--hm-dlprog-surface: #1e1e3a;
	--hm-dlprog-track: rgba(255, 255, 255, 0.14);
	--hm-dlprog-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

a.is-hm-dl-pending,
button.is-hm-dl-pending {
	pointer-events: none !important;
	opacity: 0.72 !important;
	cursor: wait !important;
}

a.is-hm-dl-pending svg,
button.is-hm-dl-pending svg {
	animation: hm-dlprog-spin 0.9s linear infinite;
}

.hm-dl-progress {
	position: fixed;
	z-index: 100050;
	inset-inline-end: 1rem;
	inset-block-end: 1.25rem;
	width: min(320px, calc(100vw - 2rem));
	padding: 0.95rem 1.05rem 1.05rem;
	border-radius: 14px;
	background: var(--hm-dlprog-surface);
	color: var(--hm-dlprog-text);
	box-shadow: var(--hm-dlprog-shadow);
	font-family: "פולין", "Polin", sans-serif;
	direction: rtl;
	text-align: right;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.hm-dl-progress.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.hm-dl-progress.is-done .hm-dl-progress__bar-fill {
	background: #15803d;
}

.hm-dl-progress.is-error .hm-dl-progress__bar-fill {
	background: var(--hm-dlprog-brand);
	width: 100% !important;
}

.hm-dl-progress__head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 0.65rem;
}

.hm-dl-progress__spinner {
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	border: 2px solid var(--hm-dlprog-track);
	border-top-color: var(--hm-dlprog-brand);
	border-radius: 50%;
	animation: hm-dlprog-spin 0.8s linear infinite;
}

.hm-dl-progress.is-done .hm-dl-progress__spinner,
.hm-dl-progress.is-error .hm-dl-progress__spinner {
	animation: none;
	border-color: transparent;
	background: currentColor;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
	color: #15803d;
}

.hm-dl-progress.is-error .hm-dl-progress__spinner {
	color: var(--hm-dlprog-brand);
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>") center / contain no-repeat;
}

.hm-dl-progress__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--hm-dlprog-navy);
	line-height: 1.35;
}

.hm-dl-progress__meta {
	margin: 0 0 0.55rem;
	font-size: 0.8rem;
	color: var(--hm-dlprog-muted);
	line-height: 1.4;
}

.hm-dl-progress__bar {
	height: 6px;
	border-radius: 999px;
	background: var(--hm-dlprog-track);
	overflow: hidden;
}

.hm-dl-progress__bar-fill {
	height: 100%;
	width: 8%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--hm-dlprog-brand), #8a2254);
	transition: width 0.18s ease;
}

.hm-dl-progress.is-indeterminate .hm-dl-progress__bar-fill {
	width: 35%;
	animation: hm-dlprog-indeterminate 1.15s ease-in-out infinite;
}

@keyframes hm-dlprog-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes hm-dlprog-indeterminate {
	0% {
		transform: translateX(120%);
	}
	100% {
		transform: translateX(-320%);
	}
}

@media (max-width: 520px) {
	.hm-dl-progress {
		inset-inline: 0.75rem;
		inset-block-end: 0.85rem;
		width: auto;
	}
}
