/**
 * Appearance Settings Styles
 *
 * @package Agentorie_Chat
 * @since   1.0.0
 */

/* ==========================================================================
   Layout — Main two-column grid
   ========================================================================== */

.appearance-layout {
	display: grid;
	grid-template-columns: 1fr 400px;
	gap: 28px;
	margin-top: 20px;
	align-items: start;
}

.appearance-settings {
	min-width: 0;
}

.appearance-preview {
	position: sticky;
	top: 42px;
}

@media (max-width: 1200px) {
	.appearance-layout {
		grid-template-columns: 1fr;
	}

	.appearance-preview {
		position: relative;
		top: 0;
		order: -1;
	}
}

/* ==========================================================================
   Cards
   ========================================================================== */

.appearance-settings .agentorie-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 20px;
	overflow: visible;
}

.appearance-settings .card-header {
	padding: 14px 20px;
	border-bottom: 1px solid #e5e7eb;
	background: #f9fafb;
	border-radius: 10px 10px 0 0;
}

.appearance-settings .card-header h2 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	display: flex;
	align-items: center;
	gap: 8px;
}

.appearance-settings .card-header .dashicons {
	color: #6366f1;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.appearance-settings .card-body {
	padding: 20px;
}

/* ==========================================================================
   Identity Grid — compact 2-col layout
   ========================================================================== */

.identity-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
}

.identity-field label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 6px;
}

.identity-field .regular-text {
	width: 100%;
}

.identity-field .description {
	margin-top: 4px;
	font-size: 11px;
	color: #6b7280;
}

.identity-welcome-section {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f3f4f6;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
}

@media (max-width: 782px) {
	.identity-grid,
	.identity-welcome-section {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Preset Grid
   ========================================================================== */

.preset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 10px;
	margin-top: 12px;
}

.preset-button {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #ffffff;
	cursor: pointer;
	transition: all 0.15s ease;
}

.preset-button:hover {
	border-color: #6366f1;
	background: #f5f3ff;
}

.preset-button.active {
	border-color: #6366f1;
	background: #eef2ff;
}

.preset-swatch {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	flex-shrink: 0;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.preset-label {
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	white-space: nowrap;
}

/* ==========================================================================
   Color Grid
   ========================================================================== */

.color-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 20px;
}

.color-group h4 {
	margin: 0 0 10px 0;
	font-size: 11px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.color-field {
	margin-bottom: 12px;
}

.color-field:last-child {
	margin-bottom: 0;
}

.color-field label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #4b5563;
	margin-bottom: 5px;
}

.color-input-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}

.color-input-wrapper input[type="color"] {
	width: 40px;
	height: 34px;
	padding: 2px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	cursor: pointer;
	background: #ffffff;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 2px;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
	border-radius: 4px;
	border: none;
}

.color-input-wrapper .color-hex {
	width: 76px;
	padding: 6px 8px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-family: monospace;
	font-size: 12px;
	text-transform: uppercase;
}

.color-field .description {
	margin-top: 3px;
	font-size: 10px;
	color: #9ca3af;
}

/* ==========================================================================
   Button Settings Grid — compact 2x2
   ========================================================================== */

.btn-settings-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.btn-setting label:first-child {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.btn-extras {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f3f4f6;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.btn-extra-row > label:first-child {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 6px;
}

.btn-extra-row select {
	min-width: 90px;
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 12px;
}

/* Compact radio buttons (inline row) */
.button-group-row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.button-option-sm {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	padding: 5px 10px;
	border: 2px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
	background: #ffffff;
}

.button-option-sm:hover {
	border-color: #a5b4fc;
	background: #f5f3ff;
}

.button-option-sm.active {
	border-color: #6366f1;
	background: #eef2ff;
}

.button-option-sm input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.button-option-sm span {
	font-size: 11px;
	font-weight: 500;
	color: #374151;
}

.button-option-sm small {
	font-size: 9px;
	color: #9ca3af;
	margin-top: 1px;
}

@media (max-width: 782px) {
	.btn-settings-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Window Grid — 2 columns
   ========================================================================== */

.window-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 28px;
}

.window-col {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.window-field > label:first-child {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 5px;
}

.window-field select {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 12px;
}

@media (max-width: 782px) {
	.window-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

.agentorie-tooltip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	background: #e5e7eb;
	color: #4b5563;
	border-radius: 50%;
	font-size: 10px;
	font-weight: 700;
	cursor: help;
	margin-left: 4px;
	vertical-align: middle;
}

/* ==========================================================================
   Button Group (Radio styled as buttons)
   ========================================================================== */

.button-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.button-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
	background: #ffffff;
}

.button-option:hover {
	border-color: #a5b4fc;
	background: #f5f3ff;
}

.button-option.active {
	border-color: #6366f1;
	background: #eef2ff;
}

.button-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.button-option span {
	font-size: 12px;
	font-weight: 500;
	color: #374151;
}

.button-option small {
	font-size: 10px;
	color: #9ca3af;
	margin-top: 2px;
}

/* ==========================================================================
   Icon Selector
   ========================================================================== */

.icon-selector {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.icon-option {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
	background: #ffffff;
	font-size: 24px;
	line-height: 1;
}

.icon-option span {
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.icon-option:hover {
	border-color: #a5b4fc;
	background: #f5f3ff;
}

.icon-option.active {
	border-color: #6366f1;
	background: #eef2ff;
}

.icon-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* Size Inputs (removed — window-grid handles layout) */

/* ==========================================================================
   Form Table compact
   ========================================================================== */

.appearance-settings .form-table {
	margin: 0;
}

.appearance-settings .form-table th {
	width: 170px;
	padding: 12px 10px 12px 0;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
}

.appearance-settings .form-table td {
	padding: 12px 0;
}

.appearance-settings .form-table tr {
	border-bottom: 1px solid #f3f4f6;
}

.appearance-settings .form-table tr:last-child {
	border-bottom: none;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.agentorie-toggle {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.agentorie-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: #d1d5db;
	transition: 0.25s;
	border-radius: 24px;
}

.toggle-slider::before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: #ffffff;
	transition: 0.25s;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.agentorie-toggle input:checked + .toggle-slider {
	background-color: #6366f1;
}

.agentorie-toggle input:checked + .toggle-slider::before {
	transform: translateX(20px);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.appearance-settings .submit {
	margin-top: 0;
	padding-top: 0;
}

/* Voice intro */
.voice-features-intro {
	margin-bottom: 12px;
}

/* ==========================================================================
   PREVIEW PANEL
   ========================================================================== */

/* --- Toolbar --- */
.preview-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
}

.preview-toolbar h3 {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.preview-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* --- Stage (background container) --- */
.preview-stage {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 12px;
	padding: 28px 20px;
	display: flex;
	justify-content: center;
}

/* --- Device frame --- */
.preview-device {
	width: 330px;
	height: 600px;
	background: #111827;
	border-radius: 40px;
	padding: 10px;
	position: relative;
	box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
}

.preview-device-notch {
	width: 110px;
	height: 24px;
	background: #111827;
	border-radius: 0 0 14px 14px;
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
}

.preview-device-screen {
	width: 100%;
	height: 100%;
	background: #e5e7eb;
	border-radius: 32px;
	overflow: hidden;
	position: relative;
}

/* ==========================================================================
   PW — Preview Widget (faithful to real widget)
   Prefix: pw- to avoid any collision
   ========================================================================== */

.pw {
	position: absolute;
	bottom: 70px;
	left: 8px;
	right: 8px;
	top: 30px;
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	background: #ffffff;
	transition: border-radius 0.2s, box-shadow 0.2s;
}

/* --- Header --- */
.pw-header {
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	transition: background 0.2s;
	position: relative;
	overflow: hidden;
}

.pw-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.pw-avatar {
	width: 34px;
	height: 34px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	transition: opacity 0.2s;
	border: 2px solid rgba(255, 255, 255, 0.5);
	animation: pw-avatar-pulse 4s ease-in-out infinite;
}

@keyframes pw-avatar-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
	}
	50% {
		box-shadow: 0 0 0 4px rgba(255, 255, 255, 0);
	}
}

.pw-avatar.pw-hidden {
	display: none;
}

.pw-header-text {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.pw-header-name {
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pw-header-status {
	font-size: 10px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 1px;
}

.pw-status-dot {
	width: 6px;
	height: 6px;
	background: #22c55e;
	border-radius: 50%;
	flex-shrink: 0;
}

.pw-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.pw-lang-btn {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	height: 24px;
	padding: 0 7px;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 5px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.4px;
	cursor: default;
	transition: background 0.15s;
}

.pw-lang-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

.pw-lang-chevron {
	opacity: 0.7;
}

.pw-close-btn {
	width: 26px;
	height: 26px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	cursor: default;
	transition: background 0.15s;
}

.pw-close-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* --- Messages area --- */
.pw-messages {
	flex: 1;
	overflow-y: auto;
	position: relative;
	transition: background 0.2s;
}

/* Views toggle */
.pw-view {
	display: none;
	padding: 16px 14px;
	flex-direction: column;
	gap: 14px;
	min-height: 100%;
}

.pw-view.active {
	display: flex;
}

/* --- Welcome view --- */
.pw-welcome {
	text-align: center;
	padding: 16px 8px 8px;
}

.pw-welcome-title {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 6px;
	transition: color 0.2s;
}

.pw-welcome-text {
	font-size: 13px;
	line-height: 1.4;
	transition: color 0.2s;
}

/* Language selector in welcome */
.pw-lang-selector {
	padding: 4px 0;
}

.pw-lang-selector-title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 12px;
}

.pw-lang-globe {
	font-size: 18px;
}

.pw-lang-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.pw-lang-option {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 10px;
	border: 2px solid transparent;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	cursor: default;
	transition: all 0.15s;
}

.pw-lang-option.active {
	border-color: currentColor;
}

.pw-lang-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 20px;
	padding: 0 4px;
	border-radius: 4px;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.4px;
	flex-shrink: 0;
}

/* --- Compact welcome in conversation view --- */
.pw-welcome-compact {
	padding: 8px 8px 2px;
}

.pw-welcome-compact .pw-welcome-title {
	font-size: 15px;
	margin-bottom: 3px;
}

.pw-welcome-compact .pw-welcome-text {
	font-size: 11px;
}

.pw-lang-compact {
	padding: 0;
	transform: scale(0.88);
	transform-origin: top center;
	margin-bottom: -4px;
}

.pw-lang-compact .pw-lang-selector-title {
	font-size: 12px;
	margin-bottom: 8px;
}

.pw-lang-compact .pw-lang-grid {
	gap: 4px;
}

.pw-lang-compact .pw-lang-option {
	padding: 6px 8px;
	font-size: 11px;
}

/* --- Conversation view — messages --- */
.pw-msg {
	display: flex;
	gap: 8px;
	max-width: 90%;
}

.pw-msg-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.pw-msg-bot {
	align-self: flex-start;
}

.pw-msg-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	flex-shrink: 0;
}

.pw-avatar-bot {
	background: #e5e7eb;
}

.pw-avatar-user {
	transition: opacity 0.2s;
}

.pw-avatar-user.pw-hidden {
	display: none;
}

.pw-msg-content {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.pw-msg-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 12px;
	line-height: 1.45;
	word-break: break-word;
	transition: background 0.2s, color 0.2s;
}

.pw-bubble-user {
	border-bottom-right-radius: 4px;
}

.pw-bubble-bot {
	border-bottom-left-radius: 4px;
}

.pw-msg-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	color: #9ca3af;
	padding: 0 3px;
}

.pw-meta-right {
	justify-content: flex-end;
}

.pw-tts-btn {
	background: none;
	border: none;
	cursor: default;
	padding: 1px;
	color: #9ca3af;
	opacity: 0.6;
	display: inline-flex;
	align-items: center;
	transition: opacity 0.15s;
}

.pw-tts-btn:hover {
	opacity: 1;
	color: inherit;
}

.pw-tts-btn.pw-hidden {
	display: none;
}

/* --- Input footer --- */
.pw-input {
	padding: 10px 14px;
	border-top: 1px solid #e5e7eb;
	flex-shrink: 0;
	transition: background 0.2s;
}

.pw-input-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f3f4f6;
	border-radius: 22px;
	padding: 7px 7px 7px 14px;
}

.pw-mic-btn {
	width: 30px;
	height: 30px;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #6b7280;
	cursor: default;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: color 0.15s;
}

.pw-mic-btn:hover {
	color: inherit;
}

.pw-mic-btn.pw-hidden {
	display: none;
}

.pw-input-placeholder {
	flex: 1;
	font-size: 12px;
	color: #9ca3af;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pw-send-btn {
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 50%;
	cursor: default;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s;
}

/* --- Launcher button --- */
.pw-launcher {
	position: absolute;
	bottom: 14px;
	right: 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: default;
	transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.pw-launcher:hover {
	transform: scale(1.06);
}

.pw-launcher.pulse::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	opacity: 0;
	animation: pw-pulse 2s ease-out infinite;
}

@keyframes pw-pulse {
	0% {
		transform: scale(1);
		opacity: 0.4;
	}
	100% {
		transform: scale(1.5);
		opacity: 0;
	}
}

.pw-launcher-icon {
	z-index: 1;
	line-height: 1;
}

/* Launcher sizes */
.pw-launcher.size-small {
	width: 42px;
	height: 42px;
}

.pw-launcher.size-small .pw-launcher-icon {
	font-size: 18px;
}

.pw-launcher.size-medium {
	width: 50px;
	height: 50px;
}

.pw-launcher.size-medium .pw-launcher-icon {
	font-size: 22px;
}

.pw-launcher.size-large {
	width: 58px;
	height: 58px;
}

.pw-launcher.size-large .pw-launcher-icon {
	font-size: 26px;
}

/* Launcher styles */
.pw-launcher.style-outline {
	background: transparent !important;
	border: 2px solid;
	box-shadow: none !important;
}

.pw-launcher.style-outline::after {
	display: none;
}

/* --- Launcher Effects --- */
.pw-launcher.effect-glossy::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 100%);
	border-radius: inherit;
	pointer-events: none;
	z-index: 2;
}

.pw-launcher.effect-radiant::before {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: inherit;
	background: conic-gradient(from 0deg, rgba(255,255,255,0.4), transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%, rgba(255,255,255,0.4));
	z-index: -1;
	animation: pw-radiant-spin 3s linear infinite;
}

@keyframes pw-radiant-spin {
	to { transform: rotate(360deg); }
}

.pw-launcher.effect-glassmorphism {
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255,255,255,0.2);
}

.pw-launcher.effect-glassmorphism::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
	border-radius: inherit;
	pointer-events: none;
	z-index: 2;
}

/* --- Launcher Animations --- */
.pw-launcher.anim-pulse::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	opacity: 0;
	animation: pw-pulse 2s ease-out infinite;
}

.pw-launcher.anim-bounce {
	animation: pw-bounce 2s ease infinite;
}

@keyframes pw-bounce {
	0%, 100% { transform: translateY(0); }
	15% { transform: translateY(-8px); }
	30% { transform: translateY(0); }
	45% { transform: translateY(-4px); }
	60% { transform: translateY(0); }
}

.pw-launcher.anim-shake {
	animation: pw-shake 3s ease-in-out infinite;
}

@keyframes pw-shake {
	0%, 85%, 100% { transform: rotate(0); }
	88% { transform: rotate(-8deg); }
	91% { transform: rotate(8deg); }
	94% { transform: rotate(-6deg); }
	97% { transform: rotate(4deg); }
}

.pw-launcher.anim-rotate {
	animation: pw-rotate-hover 4s ease-in-out infinite;
}

@keyframes pw-rotate-hover {
	0%, 100% { transform: rotate(0deg) scale(1); }
	25% { transform: rotate(5deg) scale(1.03); }
	75% { transform: rotate(-5deg) scale(1.03); }
}

/* --- Header Effects --- */
.pw-header.effect-glossy::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
	pointer-events: none;
}

.pw-header.effect-glassmorphism {
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(255,255,255,0.15);
}

.pw-header.effect-glassmorphism::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
	pointer-events: none;
}

/* Header needs position:relative for effects — merged above */

/* ==========================================================================
   Utility
   ========================================================================== */

.pw-hidden {
	display: none !important;
}

.agentorie-hidden {
	display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 782px) {
	.color-grid {
		grid-template-columns: 1fr;
	}

	.button-group {
		flex-direction: column;
	}

	.button-option {
		width: 100%;
	}

	.size-inputs {
		flex-direction: column;
	}

	.preview-device {
		width: 290px;
		height: 520px;
	}

	.appearance-settings .form-table th {
		width: 100%;
		display: block;
		padding-bottom: 4px;
	}

	.appearance-settings .form-table td {
		display: block;
		padding-top: 0;
	}
}
