/**
 * Front-end "add word from selection" — trigger button + modal.
 *
 * Playful, modern language-learning styling (no third-party branding/assets):
 * a rounded green floating trigger and a friendly white modal with a prominent
 * green save button. Mobile-first; only size/position are set inline by the JS
 * (everything visual lives here). Respects prefers-reduced-motion.
 */

/* ---- selection trigger: rounded green floating button --------------- */
.ays-pd-add-word-from-front-icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	background: #58cc02;
	border: none;
	border-radius: 50%;
	box-shadow: 0 4px 10px rgba(88, 204, 2, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
	color: #ffffff;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	z-index: 9998;
	transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.ays-pd-add-word-from-front-icon:hover {
	background: #61e002;
	transform: translateY(-1px) scale(1.06);
	box-shadow: 0 6px 14px rgba(88, 204, 2, 0.45), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.ays-pd-add-word-from-front-icon:active {
	transform: scale(0.92);
}

.ays-pd-add-word-from-front-icon:focus-visible {
	outline: 3px solid rgba(88, 204, 2, 0.55);
	outline-offset: 2px;
}

.ays-pd-add-word-from-front-icon svg {
	width: 58%;
	height: 58%;
}

/* ---- modal ----------------------------------------------------------- */
.ays-pd-add-word-modal-content {
	position: absolute;
	box-sizing: border-box;
	width: min(324px, calc(100vw - 16px));
	padding: 18px;
	background: #ffffff;
	border: 2px solid #e8ecf3;
	border-radius: 18px;
	box-shadow: 0 14px 36px rgba(34, 60, 80, 0.2);
	z-index: 9999;
	font-family: inherit;
	color: #3c4257;
	line-height: 1.5;
}

.ays-pd-add-word-modal-content * {
	box-sizing: border-box;
}

.ays-pd-awm-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 1.02rem;
	font-weight: 800;
	color: #3c4257;
}

.ays-pd-awm-close {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	color: #9aa4b2;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 8px;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.ays-pd-awm-close:hover {
	background: #f1f3f7;
	color: #3c4257;
}

.ays-pd-awm-close:focus-visible {
	outline: 3px solid rgba(28, 176, 246, 0.45);
	outline-offset: 2px;
}

.ays-pd-add-word-modal-content .ays-pd-awm-input,
.ays-pd-add-word-modal-content .ays-pd-awm-select {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0 0 12px;
	padding: 12px 14px;
	border: 2px solid #e8ecf3;
	border-radius: 12px;
	background: #ffffff;
	color: #3c4257;
	font-size: 1rem;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ays-pd-add-word-modal-content .ays-pd-awm-input:focus,
.ays-pd-add-word-modal-content .ays-pd-awm-select:focus {
	outline: none;
	border-color: #1cb0f6;
	box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
}

.ays-pd-awm-status {
	min-height: 1.2em;
	margin: 0 0 12px;
	font-size: 0.9rem;
	font-weight: 700;
}

.ays-pd-awm-status:empty {
	margin: 0;
	min-height: 0;
}

.ays-pd-awm-status.is-error {
	color: #e02f2f;
}

.ays-pd-awm-status.is-success {
	color: #3a8a00;
}

.ays-pd-awm-save {
	display: block;
	width: 100%;
	min-height: 52px;
	border: 0;
	border-radius: 14px;
	background: #58cc02;
	color: #ffffff;
	font-size: 1.05rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 4px 0 #46a302;
	transition: background-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.ays-pd-awm-save:hover:not(:disabled) {
	background: #61e002;
}

.ays-pd-awm-save:active:not(:disabled) {
	transform: translateY(2px);
	box-shadow: 0 2px 0 #46a302;
}

.ays-pd-awm-save:focus-visible {
	outline: 3px solid rgba(88, 204, 2, 0.55);
	outline-offset: 2px;
}

.ays-pd-awm-save:disabled {
	background: #cfe9b5;
	box-shadow: 0 4px 0 #b6d99a;
	cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
	.ays-pd-add-word-from-front-icon,
	.ays-pd-awm-save,
	.ays-pd-awm-close {
		transition: none;
	}
	.ays-pd-add-word-from-front-icon:hover,
	.ays-pd-add-word-from-front-icon:active,
	.ays-pd-awm-save:active {
		transform: none;
	}
}

/* ---- dark mode ------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
	.ays-pd-add-word-modal-content { background: #1e2128; border-color: #333a46; color: #e8edf4; box-shadow: 0 14px 36px rgba(0,0,0,.6); }
	.ays-pd-awm-title { color: #e8edf4; }
	.ays-pd-awm-close { color: #aab4c2; }
	.ays-pd-awm-close:hover { background: #262a33; color: #e8edf4; }
	.ays-pd-add-word-modal-content .ays-pd-awm-input,
	.ays-pd-add-word-modal-content .ays-pd-awm-select { background: #262a33; border-color: #333a46; color: #e8edf4; }
	.ays-pd-add-word-modal-content .ays-pd-awm-input::placeholder { color: #aab4c2; }
	.ays-pd-awm-save:disabled { background: #2f3a25; box-shadow: 0 4px 0 #25301c; }
}
