/**
 * ACT Advanced Search - Styles
 *
 * @package ACT_Advanced_Search
 */

/* ===========================
   CSS Reset for Plugin Elements
   =========================== */
.act-search-wrapper,
.act-search-wrapper *,
.act-search-wrapper *::before,
.act-search-wrapper *::after {
	box-sizing: border-box !important;
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
}

.act-search-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	line-height: 1.5 !important;
	color: #111827 !important;
	background: none !important;
	border: none !important;
	text-align: left !important;
}

/* Reset common inherited styles */
.act-search-wrapper p,
.act-search-wrapper h1,
.act-search-wrapper h2,
.act-search-wrapper h3,
.act-search-wrapper h4,
.act-search-wrapper h5,
.act-search-wrapper h6,
.act-search-wrapper span,
.act-search-wrapper div {
	margin: 0 !important;
	padding: 0 !important;
}

.act-search-wrapper input[type="text"],
.act-search-wrapper input[type="number"],
.act-search-wrapper select,
.act-search-wrapper button {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
}

/* Keep checkbox appearance for functionality */
.act-search-wrapper input[type="checkbox"] {
	-webkit-appearance: checkbox !important;
	-moz-appearance: checkbox !important;
	appearance: checkbox !important;
}

/* ===========================
   Main Wrapper
   =========================== */
.act-search-wrapper {
	max-width: 800px !important;
	margin: 0 auto !important;
	padding: 20px !important;
	clear: both !important;
	display: block !important;
	position: relative !important;
}

/* ===========================
   Search Container
   =========================== */
.act-search-wrapper .act-search-container {
	position: relative !important;
	margin-bottom: 30px !important;
	margin-top: 0 !important;
	display: block !important;
	clear: both !important;
}

/* ===========================
   Search Bar (Roundish Design)
   =========================== */
.act-search-wrapper .act-search-bar {
	position: relative !important;
	display: flex !important;
	align-items: center !important;
	background: #ffffff !important;
	border-radius: 50px !important;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
	transition: box-shadow 0.3s ease !important;
	margin: 0 !important;
	border: none !important;
	width: 100% !important;
}

.act-search-wrapper .act-search-bar:hover,
.act-search-wrapper .act-search-bar:focus-within {
	box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12) !important;
}

.act-search-wrapper .act-search-input {
	flex: 1 !important;
	padding: 16px 24px !important;
	padding-right: 60px !important;
	border: 2px solid transparent !important;
	border-radius: 50px !important;
	font-size: 16px !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	outline: none !important;
	background: transparent !important;
	transition: border-color 0.3s ease !important;
	line-height: 1.5 !important;
	height: auto !important;
	min-height: auto !important;
	max-width: none !important;
	width: 100% !important;
	color: #111827 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.act-search-wrapper .act-search-input:focus {
	border-color: #4f46e5 !important;
	box-shadow: none !important;
}

.act-search-wrapper .act-search-input::placeholder {
	color: #9ca3af !important;
	opacity: 1 !important;
}

.act-search-wrapper .act-search-button {
	position: absolute !important;
	right: 6px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 48px !important;
	height: 48px !important;
	min-width: 48px !important;
	min-height: 48px !important;
	max-width: 48px !important;
	max-height: 48px !important;
	border: none !important;
	border-radius: 50% !important;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: #ffffff !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.3s ease !important;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 16px !important;
	line-height: 1 !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: normal !important;
}

.act-search-wrapper .act-search-button:hover {
	transform: translateY(-50%) scale(1.05) !important;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: #ffffff !important;
}

.act-search-wrapper .act-search-button:active {
	transform: translateY(-50%) scale(0.95) !important;
}

.act-search-wrapper .act-search-button svg {
	width: 20px !important;
	height: 20px !important;
	display: block !important;
	fill: none !important;
	stroke: currentColor !important;
}

/* ===========================
   Results Drawer
   =========================== */
.act-search-wrapper .act-search-drawer {
	position: absolute !important;
	top: calc(100% + 10px) !important;
	left: 0 !important;
	right: 0 !important;
	bottom: auto !important;
	background: #ffffff !important;
	border-radius: 16px !important;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12) !important;
	max-height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	transform: translateY(-10px) !important;
	transition: all 0.3s ease !important;
	z-index: 1000 !important;
	border: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important;
	width: 100% !important;
}

.act-search-wrapper .act-search-drawer.is-open {
	max-height: 500px !important;
	opacity: 1 !important;
	transform: translateY(0) !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
}

.act-search-wrapper .act-search-results {
	padding: 12px !important;
	margin: 0 !important;
	display: block !important;
	background: transparent !important;
	border: none !important;
	width: 100% !important;
}

/* Reset any child spacing */
.act-search-wrapper .act-search-results > * {
	margin: 0 0 8px 0 !important;
}

.act-search-wrapper .act-search-results > *:last-child {
	margin-bottom: 0 !important;
}

/* ===========================
   Result Items
   =========================== */
.act-search-wrapper .act-result-item {
	display: block !important;
	padding: 16px !important;
	border-radius: 12px !important;
	text-decoration: none !important;
	color: #111827 !important;
	transition: all 0.2s ease !important;
	margin: 0 0 4px 0 !important;
	background: transparent !important;
	border: none !important;
	width: 100% !important;
	cursor: pointer !important;
}

.act-search-wrapper .act-result-item:hover {
	background: #f3f4f6 !important;
	transform: translateX(4px) !important;
	text-decoration: none !important;
}

.act-search-wrapper .act-result-meta {
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	margin: 0 0 8px 0 !important;
	padding: 0 !important;
	flex-wrap: wrap !important;
}

.act-search-wrapper .act-result-badge {
	display: inline-block !important;
	padding: 4px 12px !important;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: #ffffff !important;
	border-radius: 20px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
	margin: 0 !important;
	line-height: 1.3 !important;
	white-space: nowrap !important;
}

.act-search-wrapper .act-result-date {
	font-size: 13px !important;
	color: #6b7280 !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.3 !important;
}

.act-search-wrapper .act-result-title {
	margin: 0 0 8px 0 !important;
	padding: 0 !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	color: #111827 !important;
	line-height: 1.4 !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.act-search-wrapper .act-result-excerpt {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	color: #6b7280 !important;
	line-height: 1.6 !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.act-search-wrapper .act-result-title mark,
.act-search-wrapper .act-result-excerpt mark {
	background: #fef3c7 !important;
	color: #92400e !important;
	padding: 2px 4px !important;
	border-radius: 3px !important;
	font-weight: 600 !important;
	margin: 0 !important;
}

/* ===========================
   Loading and Messages
   =========================== */
.act-search-wrapper .act-result-loading,
.act-search-wrapper .act-result-message {
	padding: 24px !important;
	margin: 0 !important;
	text-align: center !important;
	color: #6b7280 !important;
	display: block !important;
	width: 100% !important;
	background: transparent !important;
	border: none !important;
}

.act-search-wrapper .act-result-loading p,
.act-search-wrapper .act-result-message p {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	color: inherit !important;
}

.act-search-wrapper .act-loading-spinner {
	width: 40px !important;
	height: 40px !important;
	margin: 0 auto 16px !important;
	padding: 0 !important;
	border: 4px solid #f3f4f6 !important;
	border-top-color: #667eea !important;
	border-radius: 50% !important;
	animation: act-spin 0.8s linear infinite !important;
	display: block !important;
}

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

.act-result-validation {
	color: #d97706;
}

.act-result-error {
	color: #dc2626;
}

/* ===========================
   Filter Controls
   =========================== */
.act-search-wrapper .act-search-filters {
	background: #f9fafb !important;
	border-radius: 16px !important;
	padding: 24px !important;
	border: 1px solid #e5e7eb !important;
	margin: 0 !important;
	display: block !important;
	clear: both !important;
}

.act-search-wrapper .act-filters-title {
	margin: 0 0 20px 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #111827 !important;
	line-height: 1.5 !important;
	padding: 0 !important;
	border: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.act-search-wrapper .act-filters-row {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
	gap: 20px !important;
	margin-bottom: 20px !important;
	margin-top: 0 !important;
	padding: 0 !important;
	border: none !important;
}

.act-search-wrapper .act-filter-group {
	display: flex !important;
	flex-direction: column !important;
	gap: 8px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
}

.act-search-wrapper .act-filter-group label,
.act-search-wrapper .act-filter-label {
	font-size: 14px !important;
	font-weight: 500 !important;
	color: #374151 !important;
	line-height: 1.5 !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.act-search-wrapper .act-filter-input,
.act-search-wrapper .act-filter-select {
	padding: 10px 14px !important;
	border: 2px solid #e5e7eb !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	outline: none !important;
	transition: border-color 0.2s ease !important;
	background: #ffffff !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	height: auto !important;
	min-height: auto !important;
	line-height: 1.5 !important;
	color: #111827 !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: normal !important;
	display: block !important;
}

.act-search-wrapper .act-filter-input:focus,
.act-search-wrapper .act-filter-select:focus {
	border-color: #667eea !important;
	box-shadow: none !important;
	outline: none !important;
}

.act-search-wrapper .act-filter-select {
	cursor: pointer !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	padding-right: 36px !important;
}

/* ===========================
   Post Types Selection
   =========================== */
.act-search-wrapper .act-post-types-group {
	margin-bottom: 16px !important;
	margin-top: 0 !important;
	padding: 0 !important;
}

.act-search-wrapper .act-post-types-list {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
	margin: 8px 0 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
}

/* Reset any list item styles if labels are in li tags */
.act-search-wrapper .act-post-types-list > * {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.act-search-wrapper .act-checkbox-label {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 8px !important;
	padding: 8px 16px !important;
	background: #ffffff !important;
	border: 2px solid #e5e7eb !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	font-size: 14px !important;
	color: #374151 !important;
	margin: 0 !important;
	line-height: 1.5 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: normal !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	white-space: nowrap !important;
	vertical-align: top !important;
}

.act-search-wrapper .act-checkbox-label:hover {
	border-color: #667eea !important;
	background: #f0f4ff !important;
}

.act-search-wrapper .act-post-type-checkbox {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	cursor: pointer !important;
	accent-color: #667eea !important;
	margin: 0 !important;
	padding: 0 !important;
	flex-shrink: 0 !important;
	vertical-align: middle !important;
	position: relative !important;
	display: inline-block !important;
}

/* Ensure checkbox is visible and clickable */
.act-search-wrapper .act-post-type-checkbox::-webkit-appearance {
	display: block !important;
}

.act-search-wrapper .act-post-type-checkbox::-moz-appearance {
	display: block !important;
}

.act-search-wrapper .act-checkbox-label input[type="checkbox"]:checked + span {
	font-weight: 600 !important;
	color: #667eea !important;
}

.act-search-wrapper .act-checkbox-label span {
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.5 !important;
	display: inline-block !important;
	vertical-align: middle !important;
	flex-shrink: 0 !important;
	font-size: 14px !important;
	color: inherit !important;
}

/* ===========================
   Fulltext Search Group
   =========================== */
.act-search-wrapper .act-fulltext-group {
	margin-top: 8px !important;
	margin-bottom: 8px !important;
	padding-top: 16px !important;
	border-top: 1px solid #e5e7eb !important;
}

.act-search-wrapper .act-fulltext-label {
	width: 100% !important;
	background: #f0f9ff !important;
	border-color: #3b82f6 !important;
}

.act-search-wrapper .act-fulltext-label:hover {
	background: #e0f2fe !important;
	border-color: #2563eb !important;
}

.act-search-wrapper .act-fulltext-label span {
	font-size: 13px !important;
	white-space: normal !important;
	word-wrap: break-word !important;
}

/* ===========================
   Exact Match Group
   =========================== */
.act-search-wrapper .act-exact-match-group {
	margin-top: 0 !important;
	margin-bottom: 8px !important;
}

.act-search-wrapper .act-exact-match-label {
	width: 100% !important;
	background: #fef3c7 !important;
	border-color: #f59e0b !important;
}

.act-search-wrapper .act-exact-match-label:hover {
	background: #fde68a !important;
	border-color: #d97706 !important;
}

.act-search-wrapper .act-exact-match-label span {
	font-size: 13px !important;
	white-space: normal !important;
	word-wrap: break-word !important;
}

/* ===========================
   Filter Info Box
   =========================== */
.act-search-wrapper .act-filter-info {
	margin-top: 16px !important;
	margin-bottom: 0 !important;
	padding: 12px 16px !important;
	background: #eff6ff !important;
	border-left: 4px solid #3b82f6 !important;
	border-radius: 8px !important;
	border-top: none !important;
	border-right: none !important;
	border-bottom: none !important;
	display: block !important;
}

.act-search-wrapper .act-info-text {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13px !important;
	color: #1e40af !important;
	line-height: 1.6 !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	font-weight: normal !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
	.act-search-wrapper {
		padding: 16px;
	}

	.act-search-input {
		font-size: 16px; /* Prevents zoom on iOS */
		padding: 14px 20px;
		padding-right: 56px;
	}

	.act-search-button {
		width: 44px;
		height: 44px;
	}

	.act-filters-row {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.act-search-drawer.is-open {
		max-height: 400px;
	}

	.act-result-title {
		font-size: 16px;
	}

	.act-result-excerpt {
		font-size: 13px;
	}

	.act-post-types-list {
		flex-direction: column;
	}

	.act-checkbox-label {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.act-search-filters {
		padding: 16px;
	}

	.act-result-item {
		padding: 12px;
	}
}

/* ===========================
   Accessibility
   =========================== */
.act-search-input:focus,
.act-search-button:focus,
.act-filter-input:focus,
.act-post-type-checkbox:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.act-result-item:focus {
	outline: 2px solid #667eea;
	outline-offset: -2px;
}

/* ===========================
   Smooth Scrolling for Drawer
   =========================== */
.act-search-drawer::-webkit-scrollbar {
	width: 8px;
}

.act-search-drawer::-webkit-scrollbar-track {
	background: #f3f4f6;
	border-radius: 8px;
}

.act-search-drawer::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 8px;
}

.act-search-drawer::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

