/**
 * Brand Mascot Styles
 *
 * Two distinct mascot systems:
 * 1. Static in-page mascot sections (Kids Capsule, 404)
 * 2. Skyy — living mascot widget (cinematic walk-on, speech bubbles, choice chips)
 *
 * @package SkyyRose_Flagship
 * @since   4.0.0
 */

/* ===================================================================
   KIDS CAPSULE — Mascot Section
   =================================================================== */

.collection-mascot {
	padding: 5rem 2rem;
	background: linear-gradient(135deg, rgba(255, 182, 193, 0.05) 0%, rgba(230, 230, 250, 0.05) 100%);
	position: relative;
	overflow: hidden;
}

.collection-mascot::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -20%;
	width: 60%;
	height: 200%;
	background: radial-gradient(circle, rgba(255, 182, 193, 0.08) 0%, transparent 70%);
	pointer-events: none;
}

.collection-mascot__inner {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 4rem;
}

.collection-mascot__image-wrap {
	flex-shrink: 0;
	position: relative;
}

.collection-mascot__image {
	width: 320px;
	height: auto;
	border-radius: 2rem;
	box-shadow:
		0 25px 50px -12px rgba(0, 0, 0, 0.3),
		0 0 60px rgba(255, 182, 193, 0.15);
	animation: mascot-float 4s ease-in-out infinite;
}

.collection-mascot__placeholder {
	width: 320px;
	height: 400px;
	border-radius: 2rem;
	background: linear-gradient(135deg, rgba(255, 182, 193, 0.1) 0%, rgba(230, 230, 250, 0.1) 100%);
	border: 2px dashed rgba(255, 182, 193, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
}

@keyframes mascot-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-12px); }
}

.collection-mascot__content {
	flex: 1;
}

.collection-mascot__heading {
	font-size: 2.5rem;
	font-weight: 800;
	background: linear-gradient(135deg, #FFB6C1, #E6E6FA, #FFB6C1);
	background-size: 200% 200%;
	animation: gradient-shift 4s ease infinite;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 1rem;
	line-height: 1.2;
}

@keyframes gradient-shift {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

.collection-mascot__text {
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.7);
	line-height: 1.7;
	margin-bottom: 2rem;
	max-width: 500px;
}

.collection-mascot__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 2rem;
	background: linear-gradient(135deg, #FFB6C1, #E6E6FA);
	color: #1a1a1a;
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	border-radius: 999px;
	transition: all 0.3s ease;
	box-shadow: 0 4px 20px rgba(255, 182, 193, 0.3);
}

.collection-mascot__cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(255, 182, 193, 0.5);
}

/* ===================================================================
   404 PAGE — Mascot Error State
   =================================================================== */

.error-404-mascot {
	text-align: center;
	padding: 2rem 0 3rem;
	animation: fadeInUp 0.8s ease 0.4s both;
}

.error-404-mascot__image {
	width: 180px;
	height: auto;
	border-radius: 1.5rem;
	margin: 0 auto 1.5rem;
	display: block;
	animation: mascot-wiggle 3s ease-in-out infinite;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.error-404-mascot__placeholder {
	width: 120px;
	height: 120px;
	margin: 0 auto 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(183, 110, 121, 0.1);
	border: 2px dashed rgba(183, 110, 121, 0.3);
	animation: mascot-wiggle 3s ease-in-out infinite;
}

@keyframes mascot-wiggle {
	0%, 100% { transform: rotate(0deg); }
	25% { transform: rotate(-3deg) scale(1.02); }
	75% { transform: rotate(3deg) scale(1.02); }
}

.error-404-mascot__speech {
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.8);
	font-style: italic;
	max-width: 400px;
	margin: 0 auto;
	padding: 1rem 1.5rem;
	background: rgba(183, 110, 121, 0.1);
	border-radius: 1rem;
	border: 1px solid rgba(183, 110, 121, 0.2);
	position: relative;
}

.error-404-mascot__speech::before {
	content: '';
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 16px;
	height: 16px;
	background: rgba(183, 110, 121, 0.1);
	border-top: 1px solid rgba(183, 110, 121, 0.2);
	border-left: 1px solid rgba(183, 110, 121, 0.2);
}

/* ===================================================================
   Responsive — Kids Capsule + 404
   =================================================================== */

@media (max-width: 768px) {
	.collection-mascot__inner {
		flex-direction: column;
		text-align: center;
		gap: 2rem;
	}

	.collection-mascot__image {
		width: 240px;
	}

	.collection-mascot__heading {
		font-size: 1.8rem;
	}

	.collection-mascot__text {
		font-size: 1rem;
		max-width: 100%;
	}

	.collection-mascot {
		padding: 3rem 1.5rem;
	}

	.error-404-mascot__image {
		width: 140px;
	}
}

/* ===================================================================
   SKYY — Living Mascot Widget
   Cinematic walk-on · speech bubbles · choice chips
   =================================================================== */

/* --- Keyframes --- */

@keyframes skyy-walk-on {
	0%   { transform: translateX(120%) scale(0.35) translateY(40px); opacity: 0; }
	40%  { opacity: 1; }
	70%  { transform: translateX(8%) scale(1.04) translateY(-4px); }
	100% { transform: translateX(0) scale(1) translateY(0); }
}

@keyframes skyy-walk-off {
	0%   { transform: translateX(0) scale(1); opacity: 1; }
	100% { transform: translateX(140%) scale(0.45); opacity: 0; }
}

@keyframes skyy-breathe {
	0%, 100% {
		transform: translateY(0);
		filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
	}
	50% {
		transform: translateY(-6px);
		filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.5));
	}
}

@keyframes skyy-speak-pulse {
	0%, 100% { transform: scale(1.0); }
	50%       { transform: scale(1.025); }
}

@keyframes skyy-excited {
	0%   { transform: translateY(0) rotate(0deg); }
	25%  { transform: translateY(-10px) rotate(-4deg); }
	50%  { transform: translateY(-14px) rotate(3deg); }
	75%  { transform: translateY(-8px) rotate(-2deg); }
	100% { transform: translateY(0) rotate(0deg); }
}

/* --- Widget Container --- */

.skyyrose-mascot {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9990;
	display: flex;
	flex-direction: row-reverse;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
	transform: translateX(140%);
	opacity: 0;
}

.skyyrose-mascot--entering {
	animation: skyy-walk-on 1.4s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
	pointer-events: auto;
}

.skyyrose-mascot--idle {
	transform: translateX(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

.skyyrose-mascot--exiting {
	animation: skyy-walk-off 0.6s ease-in forwards;
	pointer-events: none;
}

.skyyrose-mascot--hidden {
	display: none !important;
}

/* --- Character Button --- */

.skyyrose-mascot__character {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	position: relative;
	flex-shrink: 0;
}

/* --- Character Image — full body, never cropped --- */

.skyyrose-mascot__image {
	width: 220px;
	height: auto;
	object-fit: contain;
	display: block;
	filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
}

.skyyrose-mascot--idle .skyyrose-mascot__image {
	animation: skyy-breathe 3.5s ease-in-out infinite;
}

.skyy--speaking .skyyrose-mascot__image {
	animation: skyy-speak-pulse 0.8s ease-in-out infinite;
}

.skyy--excited .skyyrose-mascot__image {
	animation: skyy-excited 0.65s ease-out;
}

.skyy--glancing .skyyrose-mascot__image {
	filter: drop-shadow(0 12px 32px rgba(183, 110, 121, 0.55));
}

/* --- Speech Bubble (left of character via flex row-reverse) --- */

.skyy-bubble {
	position: relative;
	background: rgba(14, 14, 14, 0.97);
	border: 1.5px solid rgba(183, 110, 121, 0.5);
	border-radius: 1rem;
	padding: 0.875rem 1rem 0.75rem;
	max-width: 240px;
	min-width: 160px;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.5),
		0 0 24px rgba(183, 110, 121, 0.08);
	opacity: 0;
	transform: translateX(12px) scale(0.95);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
	align-self: flex-end;
	margin-bottom: 48px;
}

.skyy-bubble--visible {
	opacity: 1;
	transform: translateX(0) scale(1);
	pointer-events: auto;
}

/* Right-pointing tail */
.skyy-bubble::after {
	content: '';
	position: absolute;
	right: -8px;
	bottom: 24px;
	width: 14px;
	height: 14px;
	background: rgba(14, 14, 14, 0.97);
	border-top: 1.5px solid rgba(183, 110, 121, 0.5);
	border-right: 1.5px solid rgba(183, 110, 121, 0.5);
	transform: rotate(45deg);
	border-radius: 0 2px 0 0;
}

.skyy-bubble__text {
	font-size: 0.85rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
	margin: 0;
	font-family: inherit;
}

/* --- Choice Chips --- */

.skyy-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin-top: 0.625rem;
}

.skyy-chip {
	background: rgba(183, 110, 121, 0.12);
	border: 1px solid rgba(183, 110, 121, 0.35);
	color: #c08090;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
	font-family: inherit;
	line-height: 1.4;
}

.skyy-chip:hover,
.skyy-chip:focus-visible {
	background: rgba(183, 110, 121, 0.28);
	border-color: #B76E79;
	color: #fff;
	outline: none;
}

/* --- Minimize Button (× at top-right of character) --- */

.skyyrose-mascot__minimize {
	position: absolute;
	top: 0;
	right: -8px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(30, 30, 30, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.55);
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
	z-index: 2;
}

.skyyrose-mascot--idle .skyyrose-mascot__minimize,
.skyy--speaking .skyyrose-mascot__minimize {
	opacity: 1;
}

.skyyrose-mascot__minimize:hover {
	background: rgba(200, 40, 40, 0.85);
	color: #fff;
}

/* --- Recall Pill (bottom-right when minimized) --- */

.skyyrose-mascot__recall {
	position: fixed;
	bottom: 20px;
	right: 20px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px 7px 7px;
	background: linear-gradient(135deg, rgba(20, 20, 20, 0.97), rgba(32, 32, 32, 0.97));
	border: 1px solid rgba(183, 110, 121, 0.4);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
	z-index: 9990;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font-family: inherit;
}

.skyyrose-mascot__recall img {
	border-radius: 50%;
	width: 32px;
	height: 32px;
	object-fit: cover;
}

.skyyrose-mascot__recall:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 28px rgba(183, 110, 121, 0.4);
}

/* ===================================================================
   Responsive — Skyy Widget
   =================================================================== */

@media (max-width: 768px) {
	.skyyrose-mascot {
		bottom: 16px;
		right: 16px;
		flex-direction: column;
		align-items: flex-end;
		gap: 8px;
	}

	.skyyrose-mascot__image {
		width: 140px;
	}

	.skyy-bubble {
		max-width: 210px;
		margin-bottom: 0;
		align-self: flex-end;
	}

	/* On mobile, tail points downward (bubble is above character) */
	.skyy-bubble::after {
		right: 24px;
		bottom: -8px;
		top: auto;
		transform: rotate(135deg);
	}

	.skyy-chips {
		flex-direction: column;
	}

	.skyy-chip {
		text-align: center;
	}
}

/* ===================================================================
   Reduced Motion — All Sections
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
	.collection-mascot__image,
	.error-404-mascot__image,
	.error-404-mascot__placeholder {
		animation: none !important;
	}

	.collection-mascot__heading {
		animation: none;
		background-size: 100% 100%;
	}

	.collection-mascot__cta {
		transition: none;
	}

	/* Skyy widget — skip all animations, appear instantly */
	.skyyrose-mascot {
		transition: none !important;
	}

	.skyyrose-mascot--entering {
		animation: none !important;
		transform: translateX(0) scale(1) !important;
		opacity: 1 !important;
	}

	.skyyrose-mascot--exiting {
		animation: none !important;
	}

	.skyyrose-mascot__image,
	.skyy--speaking .skyyrose-mascot__image,
	.skyy--excited .skyyrose-mascot__image,
	.skyyrose-mascot--idle .skyyrose-mascot__image {
		animation: none !important;
		filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
	}

	.skyy-bubble {
		transition: none !important;
	}
}
