/**
 * Interactive Quiz Styles v5 (Optimized)
 * - Uses clamp() for fluid typography.
 * - Simplified and consolidated media queries.
 * - Improved mobile layout for answers and icons.
 */

/* --- BASE SETUP --- */
#interactive-quiz-container {
	position: relative;
    width: 100%;
    height: fit-content;
    min-height: 100vh;
	color: var(--wp--preset--color--cream);
	font-family: sans-serif; /* A fallback font */
	background: url("../images/background.png") center/cover no-repeat;
	overflow: hidden;
}

/* --- HEADER --- */
.quiz-header {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%; /* Use 100% instead of -webkit-fill-available */
	padding: 20px 40px;
	z-index: 200;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-sizing: border-box;
}

.quiz-logo img {
	height: 40px;
	width: auto;
}

.quiz-exit-button a {
	text-decoration: none;
}

.quiz-exit-button img {
	height: 30px;
	width: auto;
}

.quiz-exit-button .mobile-icon {
	display: none;
}

/* --- SLIDE STRUCTURE & ANIMATIONS --- */
.quiz-slide-wrapper {
	display: none;
	width: 100%;
	height: 100vh;
}

.made-for-you-logo {
	position: absolute;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	max-width: 300px;
	height: auto;
	z-index: 1;
	pointer-events: none;
}

.quiz-slide {
	width: 100%;
	height: 100%;
	padding: 40px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.4s ease-out 0.3s, transform 0.4s ease-out 0.3s;
}

.quiz-slide.active {
	opacity: 1;
	transform: translateY(0);
}

/* --- TRANSITION OVERLAY --- */
#quiz-transition-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: url("../images/transition.png") bottom center/cover no-repeat;
	transform: translateY(91%);
	border-radius: 8rem;
	transition: transform 0.5s cubic-bezier(0.86, 0, 0.07, 1);
	z-index: 100;
	pointer-events: none;
}

#quiz-transition-overlay.active {
	transform: translateY(30%);
}

/* --- CONTENT STYLING --- */
.quiz-content {
	max-width: 90%;
	margin: 0 auto;
	position: relative;
	z-index: 10;
}

.quiz-content h2 {
	/* ✨ FLUID TYPOGRAPHY: Scales font size smoothly between 28px and 40px */
	font-size: clamp(1.75rem, 4vw + 1rem, 2.5rem);
	margin-bottom: 20px;
	font-family: var(--wp--preset--font-family--header);
	color: var(--wp--preset--color--cream);
}

.quiz-content p {
	/* ✨ FLUID TYPOGRAPHY: Scales font size smoothly between 15px and 18px */
	font-size: clamp(0.9375rem, 1vw + 0.5rem, 1.125rem);
	line-height: 1.6;
	max-width: 600px;
	margin: 0 auto 20px;
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--body);
}

/* --- ANSWER CHOICES --- */
.quiz-answers {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 40px;
}

.quiz-answer {
	cursor: pointer;
	padding: 20px;
	border: 2px solid transparent;
	border-radius: 12px;
	text-align: center;
	transition: transform 0.2s ease, border-color 0.2s ease;
	width: 150px;
}

.quiz-answer:hover {
	transform: scale(1.05);
	border-color: #ff52f3;
}

.quiz-answer img {
	max-width: 80px;
	height: auto;
	margin-bottom: 15px;
	transition: opacity 0.3s ease-in-out;
}

.quiz-answer span {
	display: block;
	font-weight: bold;
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--body);
}

/* --- HOVER ICON LOGIC (Corrected) --- */
.quiz-answer .hover-icon {
	opacity: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.icon-container {
	position: relative;
	width: 80px;
	height: 80px;
	margin: 0 auto 15px; /* Use auto margin for centering */
}

.quiz-answer:hover .regular-icon {
	opacity: 0; /* Hide regular icon on hover */
}

.quiz-answer:hover .hover-icon {
	opacity: 1; /* Show hover icon on hover */
}

/* --- BUTTONS & FORMS --- */
.quiz-button {
	background-color: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: transform 0.2s ease;
	text-decoration: none;
	display: inline-block;
	margin-top: 20px;
}

.quiz-button:hover {
	transform: scale(1.05);
}

.quiz-button img {
	height: 50px;
	width: auto;
}

#quiz-lead-form {
	display: flex;
	flex-direction: column;
	gap: 15px;
	max-width: 400px;
	margin: 30px auto 0;
}

#quiz-lead-form label {
	text-align: left;
	font-size: 1rem;
	font-weight: 700;
}

#quiz-lead-form input {
	padding: 15px;
	border-radius: 8px;
	border: 1px solid #555;
	background-color: white;
	color: var(--wp--preset--color--black);
	font-size: 1rem;
	font-weight: 600;
}

#quiz-lead-form .quiz-form-submit-button {
	background-color: var(--wp--preset--color--yellow);
    color: var(--wp--preset--color--black);
    text-transform: uppercase;
    border-radius: 10px;
    padding: 1rem 2rem;
    border: none;
    font-family: var(--wp--preset--font-family--body) !important;
    font-weight: 600;
    width: fit-content;
    align-self: center;
    font-size: 1.2rem;
    margin-top: 1rem;
    cursor: pointer;
}

/* --- PROGRESS CIRCLE --- */
.quiz-progress-container {
	position: absolute;
	bottom: -60px;
	right: 75px;
	z-index: 110;
}

.quiz-progress-circle {
	width: 200px;
	height: 200px;
}

.quiz-progress-circle img {
	max-width: 100%;
	height: auto;
}

/* --- FLOATING ANIMATIONS (No changes, kept as is) --- */
.floating-animations {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
}
.floating-anim {
	position: absolute;
	animation: 5s ease-in-out infinite;
}
.floating-anim.anim-1 {
	top: 15%;
	left: 10%;
	width: 80px;
	animation-name: float1;
}
.floating-anim.anim-2 {
	top: 20%;
	right: 12%;
	width: 100px;
	animation-name: float2;
	animation-delay: 1.5s;
}
.floating-anim.anim-3 {
	top: 10%;
	left: 20%;
	width: 60px;
	animation-name: float2;
	animation-delay: 0.5s;
}
.floating-anim.anim-4 {
	top: 15%;
	right: 18%;
	width: 90px;
	animation-name: float1;
	animation-delay: 2s;
}
@keyframes float1 {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-20px);
	}
}
@keyframes float2 {
	0%,
	100% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(15px) rotate(15deg);
	}
}

/*
=================================================================
MEDIA QUERIES (Mobile and Tablet)
=================================================================
*/

/* --- TABLETS & SMALLER DESKTOPS (<= 1024px) --- */
@media (max-width: 1024px) {
	.quiz-content {
		max-width: 100%;
        padding: 0 2%;
        box-sizing: border-box;
        margin: 11rem 0 7rem 0;
	}

	.quiz-answers {
		gap: 15px;
		margin-top: 30px;
	}

	.quiz-slide {
		padding: 20px;
	}

	.quiz-slide-wrapper {
		height: fit-content;
        min-height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
	}
}

/* --- MOBILE DEVICES (<= 768px) --- */
@media (max-width: 768px) {

	#interactive-quiz-container {
		width: 100%;
		height: fit-content;
		min-height: 100vh;
	}

	.quiz-header {
		padding: 15px;
	}

	.smaller-mobile-header {
		font-size: 28px;
	}

	.quiz-logo img {
		height: 30px;
	}

	.made-for-you-logo {
		position: absolute;
		top: 10%;
		left: 50%;
		transform: translateX(-50%);
		max-width: 240px;
		height: auto;
		z-index: 1;
		pointer-events: none;
	}

	@media (max-height: 900px) and (min-width: 769px) {
		.made-for-you-logo {
			top: 5%;
		}
	}

	.quiz-exit-button .desktop-icon {
		display: none;
	}

	.quiz-exit-button .mobile-icon {
		display: block;
	}

	/* Adjust quiz answers for small screens */
	.quiz-answers {
		gap: 10px;
	}

	.quiz-answer img {
		max-width: 60px;
	}

	.quiz-slide {
		padding: 15px;
	}

	.quiz-answer {
		padding: 5px;
		flex: 1 1 25%;
		max-width: 140px;
	}

	.quiz-answer span {
		font-size: 0.8rem;
	}

	#quiz-lead-form input {
		padding: 8px;
	}

	#quiz-lead-form .quiz-form-submit-button {
        padding: 0.75rem 3rem;
        margin-top: 0.5rem;
        color: white;
        font-family: var(--wp--preset--font-family--header) !important;
    }

	.icon-container {
		width: 60px;
		height: 60px;
		margin-bottom: 8px;
	}

	.quiz-button img {
		height: 45px;
	}

	#quiz-lead-form {
		gap: 10px;
	}

	/* Progress circle positioning */
	.quiz-progress-container {
		left: 30px;
		bottom: -20px;
	}

	.quiz-progress-circle {
		width: 120px;
		height: 90px;
	}

	/* Hide some floating animations on mobile */
	.floating-anim {
		transform: scale(0.6);
	}
	.floating-anim.anim-1 {
		top: 10%;
		left: 0%;
	}
	.floating-anim.anim-2 {
		top: 10%;
		right: 0%;
	}
	.floating-anim.anim-3,
	.floating-anim.anim-4 {
		display: none;
	}
}

/* --- SMALLER LAPTOPS (13-inch MacBooks and similar) --- */
@media (min-width: 769px) and (max-width: 1440px) and (max-height: 900px) {
	.quiz-slide-wrapper {
		height: fit-content;
		min-height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
	}

	.quiz-progress-container {
		right: 20px;
		bottom: -30px;
	}

	.quiz-progress-circle {
		width: 150px;
		height: 150px;
	}

	.quiz-content {
		margin: 6rem 0 4rem 0;
	}

	.made-for-you-logo {
		top: 5%;
		max-width: 260px;
	}

	#quiz-lead-form {
		gap: 8px;
		margin: 15px auto 0;
	}

	#quiz-lead-form input {
		padding: 12px;
	}
}

/* --- SHORT SCREENS (height <= 1000px) --- */
@media (max-height: 1000px) {
	#quiz-lead-form {
		gap: 10px;
		margin: 20px auto 0;
	}

	.quiz-content {
		margin: 8rem 0 5rem 0;
	}

	.quiz-slide {
		padding: 30px;
	}

	.quiz-answers {
		margin-top: 30px;
		gap: 15px;
	}

	.made-for-you-logo {
		top: 8%;
		max-width: 280px;
	}
}
