/* PTP Frontend Chat Widget */

#ptp-chat-widget {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ptp-bubble {
	background-color: #1a1a1a;
	color: #ffffff;
	border-radius: 50px;
	padding: 12px 24px 12px 12px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	border: 2px solid transparent;
}

#ptp-chat-widget.ptp-idle .ptp-bubble:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ptp-icon-container {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #333333;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: background-color 0.3s ease;
}

.ptp-mic-icon {
	width: 20px;
	height: 20px;
	color: #ffffff;
	transition: transform 0.3s ease;
}

.ptp-text-container {
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.3px;
	user-select: none;
}

/* Visualization Bars */
.ptp-visualizer {
	position: absolute;
	width: 100%;
	height: 100%;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.ptp-bar {
	width: 3px;
	background-color: #fff;
	border-radius: 3px;
	animation: ptp-pulse 1s ease-in-out infinite;
}

.ptp-bar:nth-child(1) {
	height: 30%;
	animation-delay: 0.1s;
}

.ptp-bar:nth-child(2) {
	height: 60%;
	animation-delay: 0.3s;
}

.ptp-bar:nth-child(3) {
	height: 80%;
	animation-delay: 0.5s;
}

.ptp-bar:nth-child(4) {
	height: 50%;
	animation-delay: 0.2s;
}

.ptp-bar:nth-child(5) {
	height: 40%;
	animation-delay: 0.4s;
}

@keyframes ptp-pulse {

	0%,
	100% {
		transform: scaleY(0.5);
		opacity: 0.7;
	}

	50% {
		transform: scaleY(1);
		opacity: 1;
	}
}

/* Listening State */
#ptp-chat-widget.ptp-listening .ptp-bubble {
	background-color: #e53935;
	/* Reddish signaling recording */
	box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.3);
	transform: scale(1.05);
}

#ptp-chat-widget.ptp-listening .ptp-icon-container {
	background-color: transparent;
}

#ptp-chat-widget.ptp-listening .ptp-mic-icon {
	display: none;
}

#ptp-chat-widget.ptp-listening .ptp-visualizer {
	display: flex;
}

/* Processing State */
#ptp-chat-widget.ptp-processing .ptp-bubble {
	background-color: #1976d2;
	/* Blueish for loading/processing */
	animation: ptp-breathe 2s infinite ease-in-out;
}

@keyframes ptp-breathe {
	0% {
		box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4);
	}

	70% {
		box-shadow: 0 0 0 10px rgba(25, 118, 210, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(25, 118, 210, 0);
	}
}

/* Feedback Container (Results) */
#ptp-feedback-container {
	margin-top: 16px;
	background-color: #ffffff;
	border-radius: 12px;
	width: 480px;
	max-width: calc(100vw - 60px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	padding: 16px;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	border: 1px solid #eee;
	transition: opacity 0.3s ease, transform 0.3s ease;
	transform-origin: bottom center;
}

#ptp-feedback-container.ptp-hidden {
	opacity: 0;
	transform: scale(0.9);
	pointer-events: none;
}

.ptp-feedback-understood {
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0f0f0;
}

.ptp-feedback-understood strong {
	color: #1a1a1a;
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ptp-feedback-response strong {
	color: #1976d2;
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Error State */
#ptp-feedback-container.ptp-error {
	border-color: #e53935;
	background-color: #fff8f8;
}

.ptp-error-content {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.ptp-error-icon {
	font-size: 20px;
	color: #e53935;
	line-height: 1.4;
	flex-shrink: 0;
}

.ptp-error-message {
	color: #b71c1c;
	font-size: 14px;
	line-height: 1.5;
	word-break: break-word;
}