/* EP Voice Messages — Frontend Widget */

.ep-voice-widget {
	position: relative;
	display: inline-block;
	max-width: 360px;
}

/* ─── Main Button ─── */

.ep-voice-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 24px;
	background: #b8a88a;
	color: #fff;
	border: none;
	border-radius: 28px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	font-family: inherit;
	line-height: 1.4;
}

.ep-voice-btn:hover {
	background: #a3946e;
}

.ep-voice-btn:active {
	transform: scale(0.97);
}

.ep-voice-btn:focus-visible {
	outline: 2px solid #b8a88a;
	outline-offset: 2px;
}

.ep-voice-btn-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* ─── Recording Panel ─── */

.ep-voice-panel {
	background: #fff;
	border: 1px solid #e8e4de;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	margin-top: 8px;
	min-width: 260px;
}

/* ─── Status Text ─── */

.ep-voice-status {
	font-size: 14px;
	font-weight: 500;
	color: #5a5347;
	margin-bottom: 12px;
}

.ep-voice-status--recording {
	color: #c62828;
}

.ep-voice-status--recording::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #c62828;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: middle;
	animation: ep-voice-pulse 1s ease-in-out infinite;
}

.ep-voice-status--uploading {
	color: #b8a88a;
}

.ep-voice-status--thankyou {
	color: #4a8a5c;
	font-size: 16px;
}

.ep-voice-status--done {
	color: #4a8a5c;
	font-size: 16px;
	margin-bottom: 16px;
}

@keyframes ep-voice-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

/* ─── Timer ─── */

.ep-voice-timer {
	font-size: 32px;
	font-weight: 300;
	color: #3a352f;
	font-variant-numeric: tabular-nums;
	margin-bottom: 16px;
	letter-spacing: 1px;
}

/* ─── Audio Level ─── */

.ep-voice-level-wrap {
	height: 6px;
	background: #f0ebe5;
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 16px;
}

.ep-voice-level {
	height: 100%;
	background: linear-gradient(90deg, #b8a88a, #c08040);
	border-radius: 3px;
	transition: width 0.1s ease-out;
	width: 0%;
}

/* ─── Stop Button ─── */

.ep-voice-stop {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: #c62828;
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.ep-voice-stop:hover {
	background: #a31f1f;
}

.ep-voice-stop:active {
	transform: scale(0.93);
}

.ep-voice-stop:focus-visible {
	outline: 2px solid #c62828;
	outline-offset: 3px;
}

/* ─── Progress Bar ─── */

.ep-voice-progress-wrap {
	height: 4px;
	background: #f0ebe5;
	border-radius: 2px;
	overflow: hidden;
	margin-top: 16px;
}

.ep-voice-progress {
	height: 100%;
	background: #b8a88a;
	border-radius: 2px;
	transition: width 0.3s ease-out;
	width: 0%;
}

/* ─── Record Another Button ─── */

.ep-voice-again {
	display: inline-block;
	padding: 8px 20px;
	background: transparent;
	color: #b8a88a;
	border: 1px solid #b8a88a;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	font-family: inherit;
}

.ep-voice-again:hover {
	background: #b8a88a;
	color: #fff;
}

/* ─── Messages (error/info) ─── */

.ep-voice-message {
	margin-top: 10px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	animation: ep-voice-fade-in 0.3s ease-out;
}

.ep-voice-message--error {
	background: #fef2f2;
	color: #c62828;
	border: 1px solid #fecaca;
}

.ep-voice-message--info {
	background: #f8f7f5;
	color: #5a5347;
	border: 1px solid #e8e4de;
}

@keyframes ep-voice-fade-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */

@media (max-width: 480px) {
	.ep-voice-widget {
		max-width: 100%;
		display: block;
	}
	.ep-voice-btn {
		width: 100%;
		justify-content: center;
	}
	.ep-voice-panel {
		min-width: auto;
	}
}
