/**
 * Palyer Mafsho Audio Player CSS
 * Strict scoped rules to avoid any collisions.
 */

.palyermafsho-wrapper {
	box-sizing: border-box;
	position: relative;
	width: 100%;
	display: block;
	direction: ltr; /* Native standard direction for audio controls */
}

.palyermafsho-wrapper *,
.palyermafsho-wrapper *::before,
.palyermafsho-wrapper *::after {
	box-sizing: border-box;
}

/* Audio Player Container */
.palyermafsho-player {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	background-color: #f1f3f4;
	border-radius: 9999px;
	height: 54px;
	min-height: 54px;
	padding: 0 16px;
	gap: 12px;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	width: 100%;
}

.palyermafsho-player:focus-visible {
	box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.4);
}

/* General Buttons inside Player */
.palyermafsho-player .palyermafsho-btn {
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
	color: #3c4043;
	border-radius: 50%;
	transition: background-color 0.2s ease, transform 0.1s ease;
	flex-shrink: 0;
}

.palyermafsho-player .palyermafsho-btn:focus-visible {
	outline: 2px solid #1a73e8;
}

.palyermafsho-player .palyermafsho-btn svg {
	display: block;
	fill: currentColor;
}

/* Play Button */
.palyermafsho-btn-play {
	width: 32px;
	height: 32px;
}

.palyermafsho-btn-play svg {
	width: 16px;
	height: 16px;
}

/* Time Display */
.palyermafsho-time {
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	line-height: 1;
	color: #3c4043;
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: 0.2px;
}

/* Progress Bar Track */
.palyermafsho-progress-container {
	flex: 1 1 auto;
	height: 24px;
	display: flex;
	align-items: center;
	cursor: pointer;
	position: relative;
	touch-action: none;
	outline: none;
}

.palyermafsho-progress-rail {
	position: relative;
	width: 100%;
	height: 4px;
	background-color: #dadce0;
	border-radius: 2px;
	overflow: visible;
}

.palyermafsho-progress-buffered {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0%;
	background-color: #bdc1c6;
	border-radius: 2px;
}

.palyermafsho-progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0%;
	background-color: #5f6368;
	border-radius: 2px;
	pointer-events: none;
}

.palyermafsho-progress-thumb {
	position: absolute;
	left: 0%;
	top: 50%;
	width: 0px;
	height: 0px;
	background-color: #5f6368;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: width 0.15s ease, height 0.15s ease;
}

.palyermafsho-progress-container:hover .palyermafsho-progress-thumb,
.palyermafsho-progress-container:active .palyermafsho-progress-thumb {
	width: 12px;
	height: 12px;
}

/* Volume & Menu Buttons */
.palyermafsho-btn-volume,
.palyermafsho-btn-menu {
	width: 32px;
	height: 32px;
}

.palyermafsho-btn-volume svg,
.palyermafsho-btn-menu svg {
	width: 20px;
	height: 20px;
}

/* Popup Menu Structure */
.palyermafsho-menu-container {
	position: relative;
	display: inline-block;
}

.palyermafsho-menu-dropdown {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: #ffffff;
	border-radius: 6px;
	box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
	min-width: 170px;
	z-index: 99999;
	overflow: hidden;
	animation: palyermafsho-fade-in 0.15s ease-out;
}

.palyermafsho-menu-dropdown.palyermafsho-drop-downward {
	bottom: auto;
	top: calc(100% + 8px);
}

@keyframes palyermafsho-fade-in {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}

.palyermafsho-menu-view {
	padding: 6px 0;
	width: 100%;
}

/* Menu Items (Main View) */
.palyermafsho-menu-item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 10px 16px;
	background: transparent;
	border: none;
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	color: #202124;
	text-decoration: none;
	cursor: pointer;
	text-align: left;
	outline: none;
	transition: background-color 0.15s ease;
}

.palyermafsho-menu-item:hover,
.palyermafsho-menu-item:focus-visible {
	background-color: #f1f3f4;
}

.palyermafsho-item-icon {
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #5f6368;
}

.palyermafsho-item-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Playback Speed Submenu View */
.palyermafsho-speed-header {
	display: flex;
	align-items: center;
	padding: 8px 12px;
	gap: 8px;
	border-bottom: 1px solid #f1f3f4;
}

.palyermafsho-btn-speed-back {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #202124;
	outline: none;
}

.palyermafsho-btn-speed-back svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.palyermafsho-speed-header-title {
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	color: #202124;
}

.palyermafsho-speed-list {
	max-height: 200px;
	overflow-y: auto;
	padding: 4px 0;
	scrollbar-width: thin;
	scrollbar-color: #80868b #f1f3f4;
}

.palyermafsho-speed-list::-webkit-scrollbar {
	width: 6px;
}

.palyermafsho-speed-list::-webkit-scrollbar-thumb {
	background-color: #80868b;
	border-radius: 3px;
}

.palyermafsho-speed-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 8px 16px;
	background: transparent;
	border: none;
	font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 13px;
	color: #202124;
	cursor: pointer;
	text-align: left;
	outline: none;
}

.palyermafsho-speed-option:hover,
.palyermafsho-speed-option:focus-visible {
	background-color: #f1f3f4;
}

.palyermafsho-speed-option .palyermafsho-check-icon {
	width: 16px;
	height: 16px;
	display: none;
}

.palyermafsho-speed-option .palyermafsho-check-icon svg {
	width: 16px;
	height: 16px;
	fill: #1a73e8;
}

.palyermafsho-speed-option.palyermafsho-active .palyermafsho-check-icon {
	display: block;
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.palyermafsho-menu-dropdown {
		animation: none !important;
	}
	.palyermafsho-player .palyermafsho-btn,
	.palyermafsho-progress-thumb {
		transition: none !important;
	}
}

/* Responsive Handling */
@media (max-width: 480px) {
	.palyermafsho-player {
		padding: 0 10px;
		gap: 8px;
	}
	.palyermafsho-time {
		font-size: 11px;
	}
}