/**
 * Cross Site Search — Stylesheet
 *
 * @package Cross_Site_Search
 */

/* ------------------------------------------------------------------ */
/* Form layout                                                          */
/* ------------------------------------------------------------------ */

.css-cross-site-search-widget {
	position: relative;
	width: 100%;
}

.css-search-form {
	display: flex;
	gap: 8px;
	width: 100%;
}

.css-search-form-inline {
	flex-direction: row;
	align-items: center;
}

.css-search-form-stacked {
	flex-direction: column;
}

.css-search-input {
	flex: 1;
	padding: 10px 14px;
	font-size: 15px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	background: #fff;
	color: #101828;
}

.css-search-input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.css-search-button {
	padding: 10px 20px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	transition: background 0.2s, transform 0.1s;
	white-space: nowrap;
}

.css-search-button:hover {
	background: #1d4ed8;
}

.css-search-button:active {
	transform: scale(0.97);
}

.css-search-form-no-button .css-search-input {
	width: 100%;
}

/* ------------------------------------------------------------------ */
/* Results dropdown                                                     */
/* ------------------------------------------------------------------ */

.css-search-results {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
	max-height: 420px;
	overflow-y: auto;
}

.css-search-results.is-visible {
	display: block;
}

/* ------------------------------------------------------------------ */
/* Results list                                                         */
/* ------------------------------------------------------------------ */

.css-search-results-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.css-result-item {
	margin: 0;
	padding: 0;
}

.css-result-item a {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	padding: 10px 16px;
	text-decoration: none;
	color: inherit;
	transition: background 0.15s;
}

.css-result-item a:hover {
	background: #f5f8ff;
}

.css-result-title {
	flex: 1 1 auto;
	font-size: 14px;
	font-weight: 600;
	color: #101828;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.css-result-excerpt {
	flex: 0 0 100%;
	font-size: 12px;
	color: #667085;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ */
/* Source badges                                                        */
/* ------------------------------------------------------------------ */

.css-badge {
	display: inline-block;
	padding: 2px 7px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 100px;
	letter-spacing: 0.3px;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Local — green */
.css-badge--local {
	background: #dcfce7;
	color: #15803d;
}

/* Google — blue */
.css-badge--google {
	background: #dbeafe;
	color: #1d4ed8;
}

/* External domain — grey */
.css-badge--external {
	background: #f2f4f7;
	color: #667085;
}

/* ------------------------------------------------------------------ */
/* Loading state                                                        */
/* ------------------------------------------------------------------ */

.css-search-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	font-size: 14px;
	color: #667085;
}

/* Spinner */
.css-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #d0d5dd;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: css-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

/* ------------------------------------------------------------------ */
/* No results / error states                                            */
/* ------------------------------------------------------------------ */

.css-search-no-results,
.css-search-error {
	padding: 14px 16px;
	font-size: 14px;
}

.css-search-no-results p {
	margin: 0;
	color: #667085;
}

.css-search-error p {
	margin: 0;
	color: #b91c1c;
}

/* ------------------------------------------------------------------ */
/* Google PSE footer link                                               */
/* ------------------------------------------------------------------ */

.css-google-link {
	padding: 8px 16px 10px;
	border-top: 1px solid #f2f4f7;
	text-align: right;
}

.css-google-link a {
	font-size: 12px;
	color: #2563eb;
	text-decoration: none;
	font-weight: 500;
	opacity: 0.85;
	transition: opacity 0.15s;
}

.css-google-link a:hover {
	opacity: 1;
	text-decoration: underline;
}
