/* Custom Audio Player Styles */
.card-actions_audio-player {
	width: 100%;
	margin-bottom: 1rem;
}

.custom-audio-player {
	display: flex;
	align-items: center;
    flex-direction: row-reverse;
	gap: 12px;
}

.audio-close-btn,
.audio-volume-btn,
.audio-speed-btn {
	position: relative;
	background: transparent;
	border: none;
	color: #6B7280;
	cursor: pointer;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
	flex-shrink: 0;
}

.audio-close-btn:hover,
.audio-volume-btn:hover,
.audio-speed-btn:hover {
	color: #374151;
}

/* Speed Button Styles */
.audio-speed-btn {
	font-size: 0.875rem;
	font-weight: 600;
	min-width: 40px;
	background: #F3F4F6;
	border-radius: 6px;
	padding: 0.375rem 0.5rem;
}

.audio-speed-btn:hover {
	background: #E5E7EB;
}

.speed-value {
	color: #6B7280;
}

.audio-speed-menu {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: white;
	border-radius: 8px;
	padding: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 10;
	display: flex;
	flex-direction: column;
	min-width: 70px;
}

.audio-speed-menu.hidden {
	display: none;
}

.speed-option {
	background: transparent;
	border: none;
	padding: 8px 12px;
	font-size: 0.875rem;
	color: #6B7280;
	cursor: pointer;
	border-radius: 4px;
	text-align: center;
	transition: all 0.2s;
}

.speed-option:hover {
	background: #F3F4F6;
	color: #374151;
}

.speed-option.active {
	background: #F9EBEF;
	color: #8A1739;
	font-weight: 600;
}

.audio-volume-slider {
	position: absolute;
	bottom: calc(100% + 8px);
	background: white;
	border-radius: 8px;
	padding: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
	touch-action: none;
}

.audio-volume-slider.hidden {
	display: none;
}

.custom-volume-track {
    width: 6px;
    height: 100px;
    background-color: #E5E7EB;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    touch-action: none;
}

.custom-volume-fill {
    width: 100%;
    background-color: #8A1739;
    border-radius: 3px;
    position: absolute;
    bottom: 0;
    pointer-events: none;
    transition: height 0.05s linear;
}

.custom-volume-thumb {
    width: 14px;
    height: 14px;
    background-color: #8A1739;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.audio-progress-wrapper {
	flex: 1;
	display: flex;
    align-items: center;
    flex-direction: row-reverse;
	gap: 16px;
	min-width: 0;
}

.audio-progress-bar {
	width: 100%;
	height: 6px;
	-webkit-appearance: none;
	appearance: none;
	background: #F9EBEF;
	border-radius: 3px;
	cursor: pointer;
}

.audio-progress-bar::-webkit-slider-track {
	height: 6px;
	background: #E5E7EB;
	border-radius: 3px;
}

.audio-progress-bar::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 0;
	height: 0;
	background: transparent;
	border: none;
	cursor: pointer;
}

.audio-progress-bar::-moz-range-track {
	height: 6px;
	background: #E5E7EB;
	border-radius: 3px;
}

.audio-progress-bar::-moz-range-thumb {
	width: 0;
	height: 0;
	background: transparent;
	border: none;
	cursor: pointer;
}

.audio-time {
	display: flex;
	align-items: center;
    flex-direction: row-reverse;
	gap: 0.25rem;
	font-size: 0.875rem;
	color: #6B7280;
	justify-content: center;
}

.audio-current-time,
.audio-duration {
	font-variant-numeric: tabular-nums;
}

.audio-separator {
	color: #9CA3AF;
}

.audio-control-btn {
	position: relative;
	background: transparent;
	border: none;
	color: #6B7280;
	cursor: pointer;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	flex-shrink: 0;

    &.audio-backward, &.audio-forward {
        padding: 8px;
        background-color: #F3F4F6;
        border-radius: 50%;
    }
}

.audio-control-btn:hover {
	color: #374151;
}

.audio-play-pause {
	background: #8A1739;
	color: white;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	padding: 0;
}

.audio-play-pause:hover {
	background: #6B1129;
	color: white;
}

.audio-skip-time {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.75rem;
	font-weight: 600;
	color: #6B7280;
	pointer-events: none;
}

.fatwa-audio-element {
	display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.custom-audio-player {
		/* flex-wrap: wrap; */
		justify-content: center;
		gap: 8px;
	}

	/* Top row: Close, Volume, Speed buttons */
	.audio-close-btn {
		padding: 0;
		order: 1;
	}

	.audio-volume-btn {
		order: 3;
	}

	.audio-speed-btn {
		order: 3;
		min-width: 42px;
		font-size: 0.8rem;
		padding: 0.4rem 0.6rem;
	}

	/* Progress wrapper takes full width on second row */
	.audio-progress-wrapper {
		order: 2;
		width: 50%;
		flex: none;
		gap: 8px;
		padding: 8px 0;

		.audio-progress-bar {
			order: 2;
		}
		.audio-time {
			order: 1;
			font-size: 0.8rem;
			min-width: 70px;
		}
	}


	/* Third row: Playback controls centered */
	.audio-forward {
		display: none;
	}
	
	.audio-play-pause {
		order: 5;
		width: 48px;
		height: 48px;
	}
	
	.audio-backward {
		display: none;
	}

	.audio-volume-btn,
	.audio-control-btn {
		padding: 0.5rem;
	}

	.audio-control-btn.audio-backward,
	.audio-control-btn.audio-forward {
		padding: 10px;
	}

	.audio-control-btn.audio-backward svg,
	.audio-control-btn.audio-forward svg {
		width: 18px;
		height: 18px;
	}

	.audio-play-pause svg {
		width: 22px;
		height: 22px;
	}
}
