/**
 * Ausbia Search - Styles
 */

/* Search Form */
.ausbia-search-wrapper {
	position: relative;
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
}

.ausbia-search-form {
	display: flex;
	align-items: center;
	position: relative;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: border-color 0.3s ease;
}

.ausbia-search-form:focus-within {
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ausbia-search-input-wrapper {
	flex: 1;
	position: relative;
}

.ausbia-search-input {
	width: 100%;
	padding: 12px 16px;
	border: none;
	outline: none;
	font-size: 16px;
	background: transparent;
	color: #333;
}

.ausbia-search-input::placeholder {
	color: #999;
}

.ausbia-search-loader {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.ausbia-search-loader .spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

.ausbia-search-submit {
	padding: 12px 20px;
	border: none;
	background: #0073aa;
	color: #fff;
	cursor: pointer;
	transition: background 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ausbia-search-submit:hover {
	background: #005a87;
}

.ausbia-search-submit svg {
	width: 20px;
	height: 20px;
}

/* Dropdown Results */
.ausbia-search-results-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	max-height: 500px;
	overflow-y: auto;
	z-index: 1000;
	margin-top: 2px;
	display: none;
}

.ausbia-search-results-dropdown.show {
	display: block;
}

.dropdown-section {
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.dropdown-section:last-child {
	border-bottom: none;
}

.dropdown-section-title {
	padding: 8px 16px;
	font-weight: 600;
	font-size: 14px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.dropdown-items {
	max-height: 300px;
	overflow-y: auto;
}

.dropdown-item {
	border-bottom: 1px solid #f5f5f5;
	transition: background 0.2s ease;
}

.dropdown-item:last-child {
	border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.active {
	background: #f8f9fa;
}

.dropdown-item a {
	display: flex;
	align-items: flex-start;
	padding: 12px 16px;
	text-decoration: none;
	color: #333;
}

.dropdown-item .item-image {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	margin-right: 12px;
	flex-shrink: 0;
}

.dropdown-item .item-content {
	flex: 1;
	min-width: 0;
}

.dropdown-item .item-title {
	font-weight: 500;
	font-size: 14px;
	margin-bottom: 4px;
	color: #333;
	line-height: 1.4;
}

.dropdown-item .item-title mark {
	background: #fff3cd;
	color: #856404;
	padding: 0 2px;
	border-radius: 2px;
}

.dropdown-item .item-price {
	font-size: 16px;
	font-weight: 600;
	color: #0073aa;
	margin-top: 4px;
}

.dropdown-item .item-excerpt {
	font-size: 12px;
	color: #666;
	margin-top: 4px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dropdown-item .item-excerpt mark {
	background: #fff3cd;
	color: #856404;
	padding: 0 2px;
	border-radius: 2px;
}

.dropdown-item .item-meta {
	font-size: 12px;
	color: #999;
	margin-top: 4px;
}

.dropdown-item .item-meta a {
	display: inline;
	padding: 0;
	color: #0073aa;
	text-decoration: underline;
}

.dropdown-footer {
	padding: 12px 16px;
	text-align: center;
	border-top: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.view-all-link {
	display: inline-block;
	color: #0073aa;
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	transition: color 0.2s ease;
}

.view-all-link:hover {
	color: #005a87;
	text-decoration: underline;
}

.dropdown-no-results,
.dropdown-error {
	padding: 24px 16px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* Search Results Page */
.ausbia-search-results-page {
	padding: 40px 0;
	min-height: 60vh;
}

.ausbia-search-results-page .page-title {
	font-size: 28px;
	margin-bottom: 30px;
	color: #333;
}

.ausbia-search-results-page .page-title .keyword {
	color: #0073aa;
	font-weight: 600;
}

.ausbia-search-results {
	margin-top: 20px;
}

.ausbia-search-section {
	margin-bottom: 40px;
}

.ausbia-search-section .section-title {
	font-size: 22px;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e0e0e0;
	color: #333;
}

.ausbia-search-section .section-title .count {
	color: #999;
	font-weight: normal;
	font-size: 16px;
}

/* Grid Layout for Products */
.ausbia-search-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

/* List Layout for Courses and Lessons */
.ausbia-search-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ausbia-search-item {
	display: flex;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	transition: box-shadow 0.3s ease;
}

.ausbia-search-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ausbia-search-item .item-image {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
	margin-right: 16px;
	flex-shrink: 0;
}

.ausbia-search-item .item-content {
	flex: 1;
}

.ausbia-search-item .item-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
}

.ausbia-search-item .item-title a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ausbia-search-item .item-title a:hover {
	color: #0073aa;
}

.ausbia-search-item .item-price {
	font-size: 20px;
	font-weight: 600;
	color: #0073aa;
	margin-bottom: 8px;
}

.ausbia-search-item .item-tags {
	margin-bottom: 8px;
}

.ausbia-search-item .item-tags .tag {
	display: inline-block;
	padding: 4px 8px;
	background: #f0f0f0;
	border-radius: 4px;
	font-size: 12px;
	margin-right: 6px;
	color: #666;
}

.ausbia-search-item .item-excerpt {
	color: #666;
	line-height: 1.6;
	font-size: 14px;
}

.ausbia-search-item .item-excerpt mark {
	background: #fff3cd;
	color: #856404;
	padding: 0 2px;
	border-radius: 2px;
}

.ausbia-search-item .item-meta {
	font-size: 14px;
	color: #999;
	margin-bottom: 8px;
}

.ausbia-search-item .item-meta a {
	color: #0073aa;
	text-decoration: none;
}

.ausbia-search-item .item-meta a:hover {
	text-decoration: underline;
}

.ausbia-search-no-results {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 16px;
}

/* Icon Layout */
.ausbia-search-layout-icon .ausbia-search-form {
	border-radius: 50px;
}

.ausbia-search-layout-icon .ausbia-search-input {
	padding-left: 50px;
}

.ausbia-search-layout-icon .ausbia-search-submit {
	position: absolute;
	left: 0;
	background: transparent;
	padding: 12px 16px;
}

.ausbia-search-layout-icon .ausbia-search-submit:hover {
	background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
	.ausbia-search-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 16px;
	}
	
	.ausbia-search-item {
		flex-direction: column;
	}
	
	.ausbia-search-item .item-image {
		width: 100%;
		height: 200px;
		margin-right: 0;
		margin-bottom: 12px;
	}
}

