/**
 * GMA Text-to-Speech Styles
 *
 * Uses the Grand Matriarchy green/gold palette:
 *   FOREST_MID:  #2B2D5E
 *   FOREST_DARK: #1A1A30
 *   GOLD_BRIGHT: #D4A84B
 *   GOLD_TEXT:   #ddb354
 *   GOLD_DIM:    #A87515
 *   CREAM:       #F8F5EC
 *   CREAM_DIM:   #E8D5AD
 *
 * @package GMA_TTS
 * @since   1.0.0
 */

/* ------------------------------------------------------------------
 * TTS Button
 * ------------------------------------------------------------------ */

.gma-tts-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid #A87515;
	border-radius: 4px;
	background: #F8F5EC;
	color: #2B2D5E;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}

.gma-tts-button:hover,
.gma-tts-button:focus {
	background: #E8D5AD;
	border-color: #D4A84B;
	outline: none;
}

.gma-tts-button.is-speaking {
	background: #2B2D5E;
	color: #F8F5EC;
	border-color: #D4A84B;
}

/* Speaker icon (CSS-only) */
.gma-tts-icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	position: relative;
}

.gma-tts-icon::before {
	content: '';
	position: absolute;
	left: 0;
	top: 3px;
	width: 6px;
	height: 10px;
	background: currentColor;
	border-radius: 1px;
}

.gma-tts-icon::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 0;
	width: 0;
	height: 0;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 8px solid currentColor;
}

/* ------------------------------------------------------------------
 * Hover Speaker Icon
 * ------------------------------------------------------------------ */

.gma-tts-hover-icon {
	display: none;
	position: absolute;
	top: 4px;
	right: 4px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(44, 74, 30, 0.8);
	cursor: pointer;
	z-index: 10;
	transition: opacity 0.2s;
}

.gma-tts-hover-icon::before {
	content: '';
	position: absolute;
	left: 5px;
	top: 6px;
	width: 4px;
	height: 8px;
	background: #F8F5EC;
	border-radius: 1px;
}

.gma-tts-hover-icon::after {
	content: '';
	position: absolute;
	left: 8px;
	top: 3px;
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 7px solid #F8F5EC;
}

[data-tts-text]:hover .gma-tts-hover-icon {
	display: block;
}

/* ------------------------------------------------------------------
 * Persistent Player Bar
 * ------------------------------------------------------------------ */

.gma-tts-player {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 48px;
	background: #2B2D5E;
	z-index: 9999;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.gma-tts-player.is-speaking,
.gma-tts-player.is-visible {
	transform: translateY(0);
}

.gma-tts-player-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 960px;
	margin: 0 auto;
	padding: 0 16px;
	height: 100%;
}

/* Player buttons */
.gma-tts-player-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #D4A84B;
	cursor: pointer;
	transition: background 0.2s;
}

.gma-tts-player-btn:hover,
.gma-tts-player-btn:focus {
	background: rgba(200, 168, 64, 0.15);
	outline: none;
}

/* Play icon */
.gma-tts-icon-play {
	display: block;
	width: 0;
	height: 0;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 14px solid #D4A84B;
	margin-left: 3px;
}

/* Stop icon */
.gma-tts-icon-stop {
	display: block;
	width: 12px;
	height: 12px;
	background: #D4A84B;
	border-radius: 2px;
}

/* Progress bar */
.gma-tts-player-progress {
	flex: 1;
	height: 4px;
	background: rgba(200, 168, 64, 0.2);
	border-radius: 2px;
	overflow: hidden;
}

.gma-tts-player-progress-bar {
	height: 100%;
	width: 0;
	background: #D4A84B;
	border-radius: 2px;
	transition: width 0.1s linear;
}

/* Status text */
.gma-tts-player-status {
	color: #ddb354;
	font-size: 12px;
	white-space: nowrap;
	min-width: 80px;
	text-align: right;
}

/* ------------------------------------------------------------------
 * Daisy Avatar Speaking Pulse
 * ------------------------------------------------------------------ */

.gma-tts-speaking {
	animation: gma-tts-pulse 1.5s ease-in-out infinite;
}

@keyframes gma-tts-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(200, 168, 64, 0.4);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(200, 168, 64, 0);
	}
}

/* ------------------------------------------------------------------
 * Greeting (hidden element, no visual)
 * ------------------------------------------------------------------ */

.gma-tts-greeting {
	display: none;
}

/* ------------------------------------------------------------------
 * Admin Styles
 * ------------------------------------------------------------------ */

.gma-tts-speed-slider {
	width: 240px;
	vertical-align: middle;
}

.gma-tts-speed-display {
	display: inline-block;
	min-width: 40px;
	text-align: center;
	font-family: monospace;
	font-size: 14px;
	margin-left: 8px;
}

.gma-tts-admin-status {
	display: inline-block;
	margin-left: 12px;
	font-size: 13px;
	font-style: italic;
}

.gma-tts-admin-status.success {
	color: #2B2D5E;
}

.gma-tts-admin-status.error {
	color: #d63638;
}

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 600px) {
	.gma-tts-player {
		height: 44px;
	}

	.gma-tts-player-inner {
		gap: 8px;
		padding: 0 10px;
	}

	.gma-tts-player-status {
		display: none;
	}

	.gma-tts-button {
		padding: 5px 10px;
		font-size: 13px;
	}
}
