/* WhatsApp-style voice message recorder bar - shared by main chat and mini chat. */

.jws-voice-recorder-bar {
	display: none;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 12px;
	box-sizing: border-box;
}

.jws-voice-cancel,
.jws-voice-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
	font-size: 15px;
	transition: background 0.15s ease, transform 0.1s ease;
}

.jws-voice-cancel {
	background: rgba(255, 90, 122, 0.12);
	color: #ff5a7a;
}

.jws-voice-cancel:hover {
	background: rgba(255, 90, 122, 0.22);
}

.jws-voice-send {
	background: var(--main, #b08d57);
	color: #fff;
	margin-left: auto;
}

.jws-voice-send:hover {
	transform: scale(1.06);
}

.jws-voice-recording-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ff3b3b;
	flex-shrink: 0;
	animation: jwsVoicePulse 1.2s ease-in-out infinite;
}

.jws-voice-timer {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	font-size: 14px;
	color: var(--heading, #b08d57);
	flex-shrink: 0;
	min-width: 38px;
}

.jws-voice-hint {
	font-size: 13px;
	color: var(--body, #b08d57);
	opacity: 0.65;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.jws-voice-recorder-bar.is-uploading .jws-voice-recording-dot {
	background: var(--main, #b08d57);
	animation: jwsVoiceSpin 0.9s linear infinite;
}

.jws-voice-recorder-bar.is-uploading .jws-voice-cancel,
.jws-voice-recorder-bar.is-uploading .jws-voice-send {
	pointer-events: none;
	opacity: 0.5;
}

@keyframes jwsVoicePulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.35; transform: scale(0.85); }
}

@keyframes jwsVoiceSpin {
	0% { transform: rotate(0deg); border-radius: 50%; }
	100% { transform: rotate(360deg); border-radius: 50%; }
}

/* A little visual feedback on the mic button itself while idle/hover. */
.jws-voice-record-btn:hover,
#jws-mini-send-voice:hover {
	color: #ff5a7a;
}

/* ============================================================
   Custom audio message player - replaces the native browser
   <audio controls> UI (which renders with a plain grey frame in
   most browsers) with a clean player matching the chat bubble.
============================================================ */

.jws-audio-player {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 200px;
	max-width: 260px;
	padding: 6px 4px;
}

.jws-audio-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: var(--main, #b08d57);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	flex-shrink: 0;
	transition: transform 0.12s ease;
}

.jws-audio-toggle:hover {
	transform: scale(1.06);
}

/* Optical nudge so the play triangle looks centered inside the circle. */
.jws-audio-toggle .fa-play {
	margin-left: 2px;
}

.jws-audio-track {
	position: relative;
	flex: 1;
	height: 4px;
	border-radius: 4px;
	background: rgba(176, 141, 87, 0.18);
	cursor: pointer;
}

.jws-audio-player.is-playing .jws-audio-track {
	background: rgba(176, 141, 87, 0.25);
}

.jws-audio-progress {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0%;
	border-radius: 4px;
	background: var(--main, #b08d57);
}

.jws-audio-time {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--body, #b08d57);
	opacity: 0.7;
	flex-shrink: 0;
	min-width: 32px;
	text-align: right;
}
