/* 
 * Halmstad Quiz Frontend Styles
 * Primary Color: #006eb6 (Halmstad Blå)
 */

.halmstad-quiz-container {
	max-width: 800px;
	margin: 0 auto;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	font-family: inherit;
	position: relative;
}

/* Progress Bar */
.hq-progress-bar {
	height: 6px;
	background: #e0e0e0;
	width: 100%;
}

.hq-progress-fill {
	height: 100%;
	background: #006eb6;
	width: 0%;
}

/* Steps */
.hq-step {
	display: flex;
	flex-direction: column;
	min-height: 400px;
}

/* Hero Image */
.hq-hero-image {
	width: 100%;
	height: 350px;
	object-fit: contain;
	background-color: #f8f9fa;
	display: block;
}

.hq-logo-brand {
	background-color: transparent;
	padding: 20px;
	box-sizing: border-box;
	max-width: 50%;
	margin: 0 auto;
}

.hq-hero-placeholder {
	height: 350px;
	background: linear-gradient(135deg, #006eb6 0%, #004d80 100%);
	position: relative;
}

.hq-hero-placeholder::after {
	content: "Halmstad Quiz";
	color: rgba(255, 255, 255, 0.2);
	font-size: 2rem;
	font-weight: bold;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.hq-content-inner {
	padding: 30px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.hq-step-indicator {
	font-size: 0.85rem;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
	display: block;
}

.hq-question-text {
	font-size: 1.4rem;
	color: #333;
	margin-top: 0;
	margin-bottom: 25px;
	line-height: 1.4;
	font-weight: 600;
}

/* ===== Start Screen ===== */
.hq-start-content {
	text-align: center;
	justify-content: center;
	align-items: center;
}

.hq-start-message {
	font-size: 1.15rem;
	color: #444;
	line-height: 1.6;
	margin-bottom: 30px;
	max-width: 500px;
}

.hq-start-btn {
	background: #006eb6;
	color: white;
	border: none;
	border-radius: 8px;
	padding: 18px 50px;
	font-size: 1.2rem;
	font-weight: bold;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
	letter-spacing: 0.5px;
}

.hq-start-btn:hover {
	background: #00568c;
	transform: translateY(-2px);
}

.hq-start-btn:active {
	transform: translateY(0);
}

/* ===== Start Screen — compact overrides ===== */
.hq-step:has(.hq-start-content) {
	min-height: auto;
}

.hq-step:has(.hq-start-content) .hq-logo-brand {
	max-width: 35%;
	max-height: 100px;
	padding: 10px;
}

.hq-step:has(.hq-start-content) .hq-content-inner {
	padding: 20px 30px;
}

.hq-step:has(.hq-start-content) .hq-start-message {
	margin-bottom: 20px;
}



/* ===== 1X2 Options Layout ===== */
.hq-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: auto;
}

.hq-options-1x2 {
	flex-direction: row;
	gap: 12px;
}

.hq-option-1x2 {
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding: 22px 14px;
	min-height: 90px;
}

.hq-option-1x2 .hq-opt-letter {
	margin-right: 0;
	margin-bottom: 10px;
	width: 44px;
	height: 44px;
	font-size: 1.2rem;
}

.hq-option-1x2 .hq-opt-text {
	font-size: 0.95rem;
	line-height: 1.4;
	word-break: break-word;
	color: #333;
	transition: color 0.2s ease;
}

/* ===== Option Cards (div elements to avoid theme button styling) ===== */
.halmstad-quiz-container .hq-option-btn {
	background: #f8f9fa !important;
	border: 2px solid #e9ecef !important;
	border-radius: 10px !important;
	padding: 15px 20px !important;
	font-size: 1.1rem !important;
	color: #333 !important;
	cursor: pointer !important;
	text-align: left !important;
	display: flex !important;
	align-items: center !important;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
	width: 100% !important;
	box-shadow: none !important;
	transform: none !important;
	outline: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	background-image: none !important;
	-webkit-tap-highlight-color: transparent !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
}

/* Hover — only on real mouse devices */
@media (hover: hover) {
	.halmstad-quiz-container .hq-option-btn:hover {
		background: #006eb6 !important;
		border-color: #006eb6 !important;
		transform: translateY(-2px) !important;
		color: #ffffff !important;
	}

	.halmstad-quiz-container .hq-option-btn:hover .hq-opt-text {
		color: #ffffff !important;
	}

	.halmstad-quiz-container .hq-option-btn:hover .hq-opt-letter {
		background: #ffffff !important;
		color: #006eb6 !important;
	}
}

/* Clicked / selected state */
.halmstad-quiz-container .hq-option-btn.hq-clicked,
.halmstad-quiz-container .hq-option-btn.hq-clicked:hover,
.halmstad-quiz-container .hq-option-btn.hq-clicked:focus,
.halmstad-quiz-container .hq-option-btn.hq-clicked:active {
	background: #006eb6 !important;
	border-color: #006eb6 !important;
	color: #ffffff !important;
	transform: none !important;
	box-shadow: none !important;
	outline: none !important;
}

.halmstad-quiz-container .hq-option-btn.hq-clicked .hq-opt-text {
	color: #ffffff !important;
}

.halmstad-quiz-container .hq-option-btn.hq-clicked .hq-opt-letter {
	background: #ffffff !important;
	color: #006eb6 !important;
}

/* Letter badge */
.hq-opt-letter {
	background: #006eb6;
	color: white;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	font-weight: bold;
	margin-right: 15px;
	flex-shrink: 0;
	transition: background 0.2s ease, color 0.2s ease;
}

/* Form Step */
.hq-form-group {
	margin-bottom: 20px;
}

.hq-form-group label {
	display: block;
	font-weight: 500;
	margin-bottom: 8px;
	color: #444;
}

.hq-input {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e9ecef;
	border-radius: 6px;
	font-size: 1rem;
	transition: border-color 0.2s;
}

.hq-input:focus {
	outline: none;
	border-color: #006eb6;
}

.hq-gdpr-group {
	font-size: 0.9rem;
	color: #666;
	display: flex;
	align-items: flex-start;
}

.hq-gdpr-group input {
	margin-top: 3px;
	margin-right: 10px;
}

.hq-submit-btn {
	background: #006eb6;
	color: white;
	border: none;
	border-radius: 8px;
	padding: 15px;
	font-size: 1.1rem;
	font-weight: bold;
	width: 100%;
	cursor: pointer;
	margin-top: 20px;
	transition: background 0.2s;
}

.hq-submit-btn:hover {
	background: #00568c;
}

/* Result Step */
.hq-result-step .hq-content-inner {
	text-align: center;
	justify-content: center;
}

.hq-success-icon {
	background: #28a745;
	color: white;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	margin: 0 auto 20px auto;
}

.hq-score-display {
	font-size: 1.5rem;
	font-weight: bold;
	color: #006eb6;
	margin: 20px 0;
}

.hq-outro-text {
	font-size: 1.1rem;
	color: #555;
}

/* Loading Overlay */
.hq-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.hq-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #006eb6;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: hq-spin 1s linear infinite;
	margin-bottom: 15px;
}

@keyframes hq-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ===================================================================
   CSS ANIMATIONS (used on mobile instead of GSAP)
   =================================================================== */

/* Fade in from below */
.hq-anim-fade-in {
	animation: hqFadeIn 0.7s ease-out both;
}

@keyframes hqFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Slide out to left */
.hq-anim-slide-out {
	animation: hqSlideOut 0.4s ease-in both;
}

@keyframes hqSlideOut {
	from {
		opacity: 1;
		transform: translateX(0);
	}
	to {
		opacity: 0;
		transform: translateX(-60px);
	}
}

/* Slide in from right */
.hq-anim-slide-in {
	animation: hqSlideIn 0.5s ease-out both;
}

@keyframes hqSlideIn {
	from {
		opacity: 0;
		transform: translateX(60px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Button appear (staggered via animation-delay in JS) */
.hq-anim-btn-appear {
	animation: hqBtnAppear 0.35s ease-out both;
}

@keyframes hqBtnAppear {
	from {
		opacity: 0;
		transform: translateY(15px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Quick pulse on tap (used instead of GSAP scale) */
.hq-anim-pulse {
	animation: hqPulse 0.3s ease-in-out;
}

@keyframes hqPulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

/* Pop in (for success icon) */
.hq-anim-pop {
	animation: hqPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes hqPop {
	from {
		opacity: 0;
		transform: scale(0) rotate(-180deg);
	}
	to {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
}

/* Shake (for error messages) */
.hq-anim-shake {
	animation: hqShake 0.4s ease-in-out;
}

@keyframes hqShake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-10px); }
	40% { transform: translateX(8px); }
	60% { transform: translateX(-6px); }
	80% { transform: translateX(4px); }
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 640px) {

	/* Stack 1X2 options vertically on mobile/tablet */
	.hq-options-1x2 {
		flex-direction: column;
		gap: 10px;
	}

	/* Switch from vertical card to horizontal row on mobile */
	.hq-option-1x2 {
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		text-align: left;
		padding: 16px 18px;
		min-height: auto;
	}

	.hq-option-1x2 .hq-opt-letter {
		margin-right: 14px;
		margin-bottom: 0;
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
	}

	.hq-option-1x2 .hq-opt-text {
		font-size: 0.95rem;
	}
}

/* ===== Responsive — Small phones ===== */
@media (max-width: 480px) {
	.hq-content-inner {
		padding: 20px;
	}

	.hq-question-text {
		font-size: 1.15rem;
	}

	.hq-option-btn {
		padding: 14px 16px;
		font-size: 1rem;
		border-radius: 8px;
	}

	.hq-option-1x2 {
		padding: 14px 14px;
	}

	.hq-option-1x2 .hq-opt-letter {
		width: 36px;
		height: 36px;
		font-size: 1rem;
		margin-right: 12px;
	}

	.hq-option-1x2 .hq-opt-text {
		font-size: 0.9rem;
	}

	.hq-start-btn {
		padding: 15px 35px;
		font-size: 1.1rem;
	}

	.hq-hero-image {
		height: 220px;
	}

	.hq-hero-placeholder {
		height: 220px;
	}

	.hq-step {
		min-height: 320px;
	}
}