/**
 * Pathways Directory - Provider Search
 * Following Durable Programming Design Standards
 */

/* CSS Variables - Design System */
:root {
	/* Base Typography */
	--pwp-base-font-size: 18px;
	--pwp-base-line-height: 1.5;
	--pwp-baseline-unit: 27px;

	/* Colors - Neutrals */
	--pwp-neutral-50: #f8fafc;
	--pwp-neutral-100: #f1f5f9;
	--pwp-neutral-200: #e2e8f0;
	--pwp-neutral-300: #cbd5e1;
	--pwp-neutral-400: #94a3b8;
	--pwp-neutral-500: #64748b;
	--pwp-neutral-600: #475569;
	--pwp-neutral-700: #334155;
	--pwp-neutral-800: #1e293b;
	--pwp-neutral-900: #0f172a;

	/* Colors - Primary (Teal/Blue Healthcare) */
	--pwp-primary-50: #ecfeff;
	--pwp-primary-100: #cffafe;
	--pwp-primary-200: #a5f3fc;
	--pwp-primary-300: #67e8f9;
	--pwp-primary-400: #22d3ee;
	--pwp-primary-500: #06b6d4;
	--pwp-primary-600: #0891b2;
	--pwp-primary-700: #0e7490;
	--pwp-primary-800: #155e75;
	--pwp-primary-900: #164e63;

	/* Colors - Accent (Professional Blue) */
	--pwp-accent-400: #38bdf8;
	--pwp-accent-500: #0ea5e9;
	--pwp-accent-600: #0284c7;
	--pwp-accent-700: #0369a1;

	/* Colors - Semantic */
	--pwp-success: #10b981;
	--pwp-error: #ef4444;
	--pwp-warning: #f59e0b;
	--pwp-info: #3b82f6;

	/* Spacing Scale (8px base) */
	--pwp-space-xs: 8px;
	--pwp-space-s: 16px;
	--pwp-space-m: 24px;
	--pwp-space-l: 32px;
	--pwp-space-xl: 48px;
	--pwp-space-xxl: 64px;

	/* Border Radius */
	--pwp-radius-s: 6px;
	--pwp-radius-m: 10px;
	--pwp-radius-l: 16px;
	--pwp-radius-xl: 20px;

	/* Shadows - Enhanced depth */
	--pwp-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
	--pwp-shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
	--pwp-shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
	--pwp-shadow-xl: 0 20px 32px -8px rgba(0, 0, 0, 0.15), 0 8px 16px -4px rgba(0, 0, 0, 0.1);

	/* Gradients */
	--pwp-gradient-primary: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
	--pwp-gradient-accent: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
	--pwp-gradient-subtle: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Base Container */
.pwp-provider-search {
	max-width: 1280px;
	margin: var(--pwp-space-xl) auto;
	padding: 0 var(--pwp-space-s);
	font-size: var(--pwp-base-font-size);
	line-height: var(--pwp-base-line-height);
	color: var(--pwp-neutral-900);
	position: relative;
}

/* Background accent for visual interest */
.pwp-provider-search::before {
	content: '';
	position: absolute;
	top: -100px;
	left: 0;
	right: 0;
	height: 400px;
	background: linear-gradient(180deg, var(--pwp-primary-50) 0%, transparent 100%);
	border-radius: var(--pwp-radius-xl);
	z-index: -1;
	opacity: 0.5;
}

/* Search Container */
.pwp-search-container {
	background: var(--pwp-gradient-subtle);
	border: 1px solid var(--pwp-neutral-200);
	border-radius: var(--pwp-radius-l);
	padding: var(--pwp-space-xl);
	margin-bottom: var(--pwp-space-xl);
	box-shadow: var(--pwp-shadow-lg);
	position: relative;
	overflow: hidden;
}

/* Subtle decorative element */
.pwp-search-container::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 200px;
	height: 200px;
	background: radial-gradient(circle, var(--pwp-primary-100) 0%, transparent 70%);
	border-radius: 50%;
	opacity: 0.3;
	pointer-events: none;
}

/* Form Styling */
.pwp-form-row {
	display: grid;
	gap: var(--pwp-space-s);
	margin-bottom: var(--pwp-space-m);
}

.pwp-form-row:last-child {
	margin-bottom: 0;
}

/* Form Group Widths */
.pwp-form-group-full {
	grid-column: 1 / -1;
}

.pwp-form-group-half {
	grid-column: span 1;
}

.pwp-form-group-third {
	grid-column: span 1;
}

@media (min-width: 640px) {
	.pwp-form-row {
		grid-template-columns: repeat(2, 1fr);
	}

	.pwp-form-group-third {
		grid-column: span 1;
	}
}

@media (min-width: 1024px) {
	.pwp-form-row {
		grid-template-columns: repeat(3, 1fr);
	}

	.pwp-form-group-half {
		grid-column: span 1;
	}
}

/* Labels */
.pwp-form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: var(--pwp-space-xs);
	color: var(--pwp-neutral-700);
	font-size: 16px;
}

.pwp-required {
	color: var(--pwp-error);
	margin-left: 2px;
}

/* Inputs and Selects */
.pwp-input,
.pwp-select {
	width: 100%;
	min-height: 52px;
	padding: 14px 18px;
	font-size: 16px;
	line-height: 1.5;
	border: 2px solid var(--pwp-neutral-300);
	border-radius: var(--pwp-radius-m);
	background: #fff;
	color: var(--pwp-neutral-900);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: inherit;
	box-shadow: var(--pwp-shadow-sm);
}

.pwp-input:hover,
.pwp-select:hover {
	border-color: var(--pwp-primary-400);
}

.pwp-input:focus,
.pwp-select:focus {
	outline: none;
	border-color: var(--pwp-primary-600);
	box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12), var(--pwp-shadow-md);
	transform: translateY(-1px);
}

.pwp-input::placeholder {
	color: var(--pwp-neutral-400);
}

.pwp-select {
	appearance: none;
	background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="gray"%3e%3cpath d="M7 7l3 3 3-3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/%3e%3c/svg%3e');
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 20px;
	padding-right: 40px;
}

/* ZIP Code Input */
#pwp-zip-code {
	max-width: 150px;
}

/* Radio Buttons */
.pwp-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pwp-space-s);
}

.pwp-radio-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-weight: 400;
	font-size: 16px;
}

.pwp-radio-label input[type="radio"] {
	margin-right: 8px;
	width: 20px;
	height: 20px;
	cursor: pointer;
}

/* Buttons */
.pwp-btn {
	min-height: 52px;
	padding: 14px 32px;
	font-size: 16px;
	font-weight: 600;
	border-radius: var(--pwp-radius-m);
	border: none;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	position: relative;
	overflow: hidden;
}

.pwp-btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.pwp-btn:hover::before {
	width: 300px;
	height: 300px;
}

.pwp-btn-primary {
	background: var(--pwp-gradient-primary);
	color: #fff;
	box-shadow: var(--pwp-shadow-md);
}

.pwp-btn-primary:hover {
	box-shadow: var(--pwp-shadow-lg);
	transform: translateY(-2px);
}

.pwp-btn-primary:active {
	transform: translateY(0);
	box-shadow: var(--pwp-shadow-sm);
}

.pwp-btn-secondary {
	background-color: transparent;
	color: var(--pwp-neutral-700);
	border: 2px solid var(--pwp-neutral-300);
}

.pwp-btn-secondary:hover {
	background-color: var(--pwp-neutral-50);
	border-color: var(--pwp-neutral-400);
}

/* Form Actions */
.pwp-form-actions {
	display: flex;
	gap: var(--pwp-space-s);
	margin-top: var(--pwp-space-l);
}

/* Results Container */
.pwp-results-container {
	margin-top: var(--pwp-space-l);
}

.pwp-results-header {
	margin-bottom: var(--pwp-space-m);
}

.pwp-results-title {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 var(--pwp-space-xs) 0;
	color: var(--pwp-neutral-900);
}

.pwp-results-count {
	font-size: 16px;
	color: var(--pwp-neutral-600);
	margin: 0;
}

/* Results Layout */
.pwp-results-layout {
	display: grid;
	gap: var(--pwp-space-l);
	grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
	.pwp-results-layout {
		grid-template-columns: 1fr 1fr;
	}
}

/* Results Map */
.pwp-results-map {
	height: 600px;
	min-height: 400px;
	background: var(--pwp-neutral-100);
	border-radius: var(--pwp-radius-l);
	border: 1px solid var(--pwp-neutral-200);
	overflow: hidden;
	box-shadow: var(--pwp-shadow-md);
}

.pwp-map-notice {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 400px;
	padding: var(--pwp-space-l);
	text-align: center;
}

.pwp-map-notice p {
	color: var(--pwp-neutral-600);
	margin: 0;
}

/* Results List */
.pwp-results-list {
	display: flex;
	flex-direction: column;
	gap: var(--pwp-space-s);
	height: 600px;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: var(--pwp-space-s);
}

/* Custom Scrollbar */
.pwp-results-list::-webkit-scrollbar {
	width: 12px;
}

.pwp-results-list::-webkit-scrollbar-track {
	background: var(--pwp-neutral-100);
	border-radius: 6px;
	margin: 4px 0;
}

.pwp-results-list::-webkit-scrollbar-thumb {
	background: var(--pwp-primary-400);
	border-radius: 6px;
	border: 2px solid var(--pwp-neutral-100);
}

.pwp-results-list::-webkit-scrollbar-thumb:hover {
	background: var(--pwp-primary-600);
}

/* Result Item */
.pwp-result-item {
	background: var(--pwp-gradient-subtle);
	border: 1px solid var(--pwp-neutral-200);
	border-radius: var(--pwp-radius-l);
	padding: var(--pwp-space-l);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	cursor: pointer;
	flex-shrink: 0;
}

.pwp-result-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--pwp-gradient-primary);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.pwp-result-item:hover {
	border-color: var(--pwp-primary-300);
	box-shadow: var(--pwp-shadow-lg);
	transform: translateY(-2px);
}

.pwp-result-item:hover::before {
	opacity: 1;
}

.pwp-result-item.pwp-result-highlighted {
	border-color: var(--pwp-primary-600);
	background: linear-gradient(180deg, #ffffff 0%, var(--pwp-primary-50) 100%);
	box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), var(--pwp-shadow-lg);
	transform: translateY(-2px);
}

.pwp-result-item.pwp-result-highlighted::before {
	opacity: 1;
}

.pwp-result-name {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 var(--pwp-space-xs) 0;
	color: var(--pwp-primary-900);
	transition: color 0.3s ease;
}

.pwp-result-item:hover .pwp-result-name {
	color: var(--pwp-primary-700);
}

.pwp-result-credentials {
	font-size: 14px;
	color: var(--pwp-neutral-600);
	margin: 0 0 var(--pwp-space-xs) 0;
}

.pwp-result-specialty {
	font-size: 16px;
	margin: 0 0 var(--pwp-space-s) 0;
}

.pwp-result-details {
	margin-top: var(--pwp-space-s);
	padding-top: var(--pwp-space-s);
	border-top: 1px solid var(--pwp-neutral-200);
}

.pwp-result-details p {
	margin: 0 0 var(--pwp-space-xs) 0;
	font-size: 16px;
	line-height: 1.5;
}

.pwp-result-details p:last-child {
	margin-bottom: 0;
}

.pwp-result-address {
	color: var(--pwp-neutral-700);
}

.pwp-result-phone,
.pwp-result-languages {
	font-size: 14px;
}

/* Providers List */
.pwp-result-providers {
	margin-top: var(--pwp-space-s);
	padding-top: var(--pwp-space-s);
	border-top: 1px solid var(--pwp-neutral-200);
}

.pwp-result-providers h5 {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 var(--pwp-space-xs) 0;
	color: var(--pwp-neutral-700);
}

.pwp-result-providers ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pwp-result-providers li {
	padding: 6px 0;
	font-size: 16px;
	line-height: 1.5;
}

.pwp-specialty {
	color: var(--pwp-neutral-600);
	font-size: 14px;
}

/* No Results */
.pwp-no-results {
	text-align: center;
	padding: var(--pwp-space-xl);
	background: var(--pwp-neutral-50);
	border-radius: var(--pwp-radius-m);
	border: 1px dashed var(--pwp-neutral-300);
}

.pwp-no-results p {
	margin: 0;
	color: var(--pwp-neutral-600);
	font-size: 16px;
}

/* Loading State */
.pwp-loading {
	text-align: center;
	padding: var(--pwp-space-xl);
	background: var(--pwp-gradient-subtle);
	border-radius: var(--pwp-radius-l);
}

.pwp-spinner {
	width: 56px;
	height: 56px;
	border: 5px solid var(--pwp-primary-100);
	border-top-color: var(--pwp-primary-600);
	border-bottom-color: var(--pwp-primary-600);
	border-radius: 50%;
	animation: pwp-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
	margin: 0 auto var(--pwp-space-s);
	box-shadow: var(--pwp-shadow-md);
}

@keyframes pwp-spin {
	to { transform: rotate(360deg); }
}

.pwp-loading p {
	margin: 0;
	color: var(--pwp-neutral-600);
}

/* Error State */
.pwp-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--pwp-radius-m);
	padding: var(--pwp-space-m);
	margin-top: var(--pwp-space-m);
}

.pwp-error-message {
	margin: 0;
	color: #991b1b;
	font-size: 16px;
}

/* Accessibility - Motion Preferences */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* Mobile Responsive Adjustments */
@media (max-width: 639px) {
	.pwp-provider-search {
		font-size: 16px;
	}

	.pwp-search-container {
		padding: var(--pwp-space-s);
	}

	.pwp-results-title {
		font-size: 23px;
	}

	.pwp-result-name {
		font-size: 18px;
	}

	.pwp-form-actions {
		flex-direction: column;
	}

	.pwp-btn {
		width: 100%;
	}

	.pwp-radio-group {
		flex-direction: column;
		gap: var(--pwp-space-xs);
	}

	.pwp-results-list {
		height: 400px;
	}

	.pwp-results-map {
		height: 400px;
	}
}