/**
 * Boot Diagnostic Tool Styles
 *
 * Minimal custom CSS — most styling uses Tailwind utility classes.
 * This file handles animations, interactive states, and components
 * that are easier to express in CSS than utility classes.
 *
 * @package WP_Wayfinder
 */

/* =========================================================================
   Hero Gradient (reuse from flex-calculator)
   ========================================================================= */

.hero-gradient-bg {
	background: linear-gradient(
		135deg,
		rgba(245, 189, 30, 0.08),
		rgba(255, 101, 1, 0.06),
		rgba(237, 28, 36, 0.04),
		rgba(255, 255, 255, 1)
	);
}

/* =========================================================================
   Step Transitions
   ========================================================================= */

.diagnostic-step {
	animation: fadeInUp 0.4s ease-out;
}

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

/* =========================================================================
   Pain Category Buttons
   ========================================================================= */

.pain-category-btn {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border: 2px solid #e5e7eb;
	border-radius: 1rem;
	background: white;
	text-align: left;
	cursor: pointer;
	transition: all 0.15s ease;
}

.pain-category-btn:hover {
	border-color: #f5bd1e;
	background-color: rgba(245, 189, 30, 0.04);
}

.pain-category-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 101, 1, 0.4);
}

.pain-category-btn {
	min-height: 48px;
}

.pain-icon {
	font-size: 2rem;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border-radius: 12px;
}

.pain-info {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.pain-title {
	font-weight: 600;
	color: #1f2937;
	font-size: 0.95rem;
}

.pain-desc {
	font-size: 0.8rem;
	color: #6b7280;
}

/* =========================================================================
   Answer Option Buttons
   ========================================================================= */

.answer-option-btn {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border: 2px solid #e5e7eb;
	border-radius: 1rem;
	background: white;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s ease;
	width: 100%;
	min-height: 48px;
}

.answer-option-btn:hover {
	border-color: #f5bd1e;
	background-color: rgba(245, 189, 30, 0.04);
}

.answer-option-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 101, 1, 0.4);
}

.answer-option-btn.selected {
	border-color: #f5bd1e;
	background-color: rgba(245, 189, 30, 0.08);
}

.answer-letter {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border-radius: 50%;
	font-weight: 600;
	font-size: 0.875rem;
	color: #6b7280;
}

.answer-option-btn:hover .answer-letter,
.answer-option-btn.selected .answer-letter {
	background: linear-gradient(90deg, #f5bd1e, #ff6501);
	color: white;
}

.answer-text {
	flex: 1;
	font-size: 0.95rem;
	color: #374151;
	line-height: 1.5;
}

/* =========================================================================
   Diagnosis Result Card
   ========================================================================= */

.diagnosis-result-card {
	border-left-width: 4px;
	border-left-style: solid;
	transition: border-color 0.3s ease;
}

/* Fit Issue - Green */
.diagnosis-result-card.diagnosis-fit {
	border-left-color: #16a34a;
}

/* Boot Selection Issue - Amber */
.diagnosis-result-card.diagnosis-selection {
	border-left-color: #f59e0b;
}

/* Mixed/Either - Blue */
.diagnosis-result-card.diagnosis-mixed {
	border-left-color: #0074D9;
}

/* Technique Issue - Purple */
.diagnosis-result-card.diagnosis-technique {
	border-left-color: #9b59b6;
}

/* Equipment Issue - Gray */
.diagnosis-result-card.diagnosis-equipment {
	border-left-color: #6b7280;
}

/* Medical Issue - Red */
.diagnosis-result-card.diagnosis-medical {
	border-left-color: #dc2626;
}

/* =========================================================================
   Diagnosis Badge
   ========================================================================= */

#diagnosis-badge.badge-fit {
	background-color: rgba(22, 163, 74, 0.1);
	color: #16a34a;
}

#diagnosis-badge.badge-selection {
	background-color: rgba(245, 158, 11, 0.1);
	color: #d97706;
}

#diagnosis-badge.badge-mixed {
	background-color: rgba(0, 116, 217, 0.1);
	color: #0074D9;
}

#diagnosis-badge.badge-technique {
	background-color: rgba(155, 89, 182, 0.1);
	color: #9b59b6;
}

#diagnosis-badge.badge-equipment {
	background-color: rgba(107, 114, 128, 0.1);
	color: #6b7280;
}

#diagnosis-badge.badge-medical {
	background-color: rgba(220, 38, 38, 0.1);
	color: #dc2626;
}

/* =========================================================================
   Fixability Badges
   ========================================================================= */

#fixability-badge.fixability-fixable {
	background-color: rgba(22, 163, 74, 0.1);
	color: #16a34a;
}

#fixability-badge.fixability-maybe {
	background-color: rgba(245, 158, 11, 0.1);
	color: #d97706;
}

#fixability-badge.fixability-new-boots {
	background-color: rgba(239, 68, 68, 0.1);
	color: #dc2626;
}

/* =========================================================================
   FAQ Accordion (shared with flex-calculator)
   ========================================================================= */

.faq-item details > summary,
#diagnosis-details > summary {
	cursor: pointer;
	list-style: none;
}

.faq-item details > summary::-webkit-details-marker,
#diagnosis-details > summary::-webkit-details-marker {
	display: none;
}

.faq-item details[open] .faq-chevron,
#diagnosis-details[open] .details-chevron {
	transform: rotate(180deg);
}

.faq-chevron,
.details-chevron {
	transition: transform 0.2s ease;
}

.faq-item details > summary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 101, 1, 0.4);
	border-radius: 12px;
}

/* =========================================================================
   Loading Spinner
   ========================================================================= */

.diagnostic-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #f3f4f6;
	border-bottom-color: #f5bd1e;
	border-radius: 50%;
	display: inline-block;
	animation: spin 1s linear infinite;
}

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

/* =========================================================================
   Interactive Boot Image with Hotspots
   ========================================================================= */

.boot-image-container {
	position: relative;
	max-width: 320px;
	margin: 0 auto 1.5rem;
	padding: 1.5rem;
	background: white;
	border-radius: 1rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.boot-image {
	width: 100%;
	height: auto;
	display: block;
}

/* =========================================================================
   Hotspot Buttons (positioned over the boot image)
   ========================================================================= */

.hotspot {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	outline: none;
	z-index: 10;
}

.hotspot-dot {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(245, 189, 30, 0.9);
	border: 2px solid white;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: all 0.2s ease;
}

.hotspot-label {
	position: relative;
	font-size: 0.875rem;
	font-weight: 500;
	color: #6b7280;
	background: white;
	padding: 0.75rem 1.25rem;
	border-radius: 2rem;
	white-space: nowrap;
	transition: all 0.2s ease;
	min-height: 44px;
	display: flex;
	align-items: center;
}

.hotspot-label::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 2rem;
	padding: 1.5px;
	background: linear-gradient(135deg, rgba(245, 189, 30, 0.4), rgba(255, 101, 1, 0.3), rgba(237, 28, 36, 0.2));
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

/* Firefox fallback for mask-composite */
@supports not (mask-composite: exclude) {
	.hotspot-label::before {
		mask-composite: subtract;
	}
}

/* Hotspot positions (tuned for the Salomon boot image) */
.hotspot-shin {
	top: 33%;
	left: 48%;
}

.hotspot-instep {
	top: 63%;
	left: 55%;
}

.hotspot-heel {
	top: 80%;
	left: -6%;
}
.hotspot-heel .hotspot-label {
	order: -1; /* Label on left side */
}

.hotspot-toes {
	top: 86%;
	right: 5%;
	left: auto;
}

/* Hover & Focus States */
.hotspot:hover .hotspot-dot,
.hotspot:focus .hotspot-dot {
	background: linear-gradient(135deg, #f5bd1e, #ff6501);
	transform: scale(1.2);
	box-shadow: 0 0 0 4px rgba(245, 189, 30, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hotspot:hover .hotspot-label,
.hotspot:focus .hotspot-label {
	color: #374151;
	background: white;
}

.hotspot:hover .hotspot-label::before,
.hotspot:focus .hotspot-label::before {
	background: linear-gradient(135deg, #f5bd1e, #ff6501, #ed1c24);
}

.hotspot:focus-visible {
	outline: none;
}

.hotspot:focus-visible .hotspot-dot {
	box-shadow: 0 0 0 4px rgba(255, 101, 1, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Subtle pulse animation */
@keyframes hotspotPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.hotspot-dot {
	animation: hotspotPulse 2s ease-in-out infinite;
}

.hotspot:nth-child(2) .hotspot-dot { animation-delay: 0s; }
.hotspot:nth-child(3) .hotspot-dot { animation-delay: 0.5s; }
.hotspot:nth-child(4) .hotspot-dot { animation-delay: 1s; }
.hotspot:nth-child(5) .hotspot-dot { animation-delay: 1.5s; }

.hotspot:hover .hotspot-dot,
.hotspot:focus .hotspot-dot {
	animation: none;
}

/* =========================================================================
   Other Options (pill buttons below the boot)
   ========================================================================= */

.other-options {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	max-width: 400px;
	margin: 0 auto;
}

.option-btn {
	position: relative;
	padding: 0.75rem 1.25rem;
	border: 1.5px solid transparent;
	border-radius: 2rem;
	background: white;
	font-size: 0.875rem;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	transition: all 0.2s ease;
	/* Gradient border effect */
	background-clip: padding-box;
	min-height: 44px;
}

.option-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 999px;
	padding: 1.5px;
	background: linear-gradient(135deg, rgba(245, 189, 30, 0.4), rgba(255, 101, 1, 0.3), rgba(237, 28, 36, 0.2));
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

/* Firefox fallback for mask-composite */
@supports not (mask-composite: exclude) {
	.option-btn::before {
		mask-composite: subtract;
	}
}

.option-btn:hover {
	color: #374151;
	background: white;
}

.option-btn:hover::before {
	background: linear-gradient(135deg, #f5bd1e, #ff6501, #ed1c24);
}

.option-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 101, 1, 0.4);
}

.option-btn:active {
	transform: scale(0.97);
}

/* =========================================================================
   Mobile Responsive Adjustments
   ========================================================================= */

@media (max-width: 480px) {
	.boot-image-container {
		max-width: 280px;
	}

	.hotspot-label {
		font-size: 0.8rem;
		padding: 0.625rem 1rem;
		min-height: 40px;
	}

	.hotspot-dot {
		width: 16px;
		height: 16px;
	}

	.other-options {
		gap: 0.375rem;
	}

	.option-btn {
		padding: 0.5rem 0.75rem;
		font-size: 0.75rem;
	}
}
