/**
 * KR Elements: KR Live Search Widget Styles
 *
 * Designed with a modern, elegant, and responsive UI structure.
 */

.kr-search-box {
	position: relative;
	width: 100%;
	font-family: inherit;
}

.kr-search-box__input-container {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
}

.kr-search-box__input {
	width: 100%;
	padding: 12px 40px 12px 16px;
	font-size: 14px;
	line-height: 1.5;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #fff;
	color: #333;
	outline: none;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.kr-search-box__input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.kr-search-box__icon {
	position: absolute;
	right: 14px;
	color: #888;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.kr-search-box__icon svg {
	width: 16px;
	height: 16px;
}

/* Spinner Animation */
.kr-search-box__spinner {
	position: absolute;
	right: 14px;
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: kr-spin 0.6s linear infinite;
}

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

.kr-search-box__spinner.hidden {
	display: none;
}

/* Results Dropdown */
.kr-result-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 999;
	width: 100%;
	margin: 6px 0 0 0;
	padding: 8px 0;
	background-color: #ffffff;
	border: 1px solid #eaeaea;
	border-radius: 6px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	max-height: 380px;
	overflow-y: auto;
	box-sizing: border-box;
}

.kr-result-panel.hidden {
	display: none;
}

.kr-result-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kr-result-panel__item {
	margin: 0;
	padding: 0;
}

.kr-result-panel__link {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	text-decoration: none;
	color: #222222;
	transition: background-color 0.2s ease;
	border-bottom: 1px solid #f9f9f9;
}

.kr-result-panel__item:last-child .kr-result-panel__link {
	border-bottom: none;
}

.kr-result-panel__link:hover {
	background-color: #f5f8ff;
}

/* Thumbnail */
.kr-result-panel__img {
	width: 44px;
	height: 44px;
	border-radius: 4px;
	object-fit: cover;
	margin-right: 12px;
	background-color: #eee;
	flex-shrink: 0;
}

.kr-result-panel__info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex-grow: 1;
	min-width: 0;
}

.kr-result-panel__title {
	font-weight: 500;
	font-size: 14px;
	color: #1f2937;
	margin: 0 0 2px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kr-result-panel__excerpt {
	font-size: 12px;
	color: #6b7280;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kr-result-panel__date {
	font-size: 11px;
	color: #9ca3af;
	margin-top: 2px;
}

.kr-result-panel__no-results {
	padding: 16px;
	text-align: center;
	color: #6b7280;
	font-size: 13px;
}

.kr-result-panel__error {
	padding: 12px 16px;
	color: #ef4444;
	font-size: 13px;
	text-align: center;
}
