/* Header actions right */
.header-actions-right {
	display: flex;
	align-items: center;
	gap: 15px;
	justify-self: end;
}

/* Search Component Styles */
.search-wrapper {
	position: relative;
	width: auto;
	max-width: 100%;
	display: flex;
	align-items: center;
}

/* Search Icon Button (always visible) */
.search-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	cursor: pointer;
	border-radius: 50%;
	transition: all 0.3s ease;
	padding: 0;
	z-index: 10;
	flex-shrink: 0;
}

.search-icon-btn:hover {
	background: rgba(0, 0, 0, 0.05);
}

html.dark .search-icon-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.search-icon-svg {
	color: currentColor;
	transition: transform 0.3s ease;
}

.search-wrapper.expanded .search-icon-svg {
	transform: scale(0.9);
}

/* Search Form (hidden by default, expands on click) */
.search-form {
	position: absolute;
	left: 100%;
	margin-left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	overflow: hidden;
	opacity: 0;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
	white-space: nowrap;
}

.search-wrapper.expanded .search-form {
	width: 300px;
	opacity: 1;
	pointer-events: all;
}

.search-input-container {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

@media (max-width: 1200px) {
	.search-wrapper.expanded .search-form {
		width: 250px;
	}
}

@media (max-width: 768px) {
	.search-wrapper.expanded .search-form {
		width: 200px;
	}
}

@media (max-width: 640px) {
	.search-wrapper.expanded .search-form {
		width: 180px;
	}
}

.search-input {
	width: 100%;
	padding: 8px 40px 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.9);
	color: #0a0a0a;
	font-size: 14px;
	transition: all 0.3s ease;
	outline: none;
}

.search-input:focus {
	border-color: rgba(0, 0, 0, 0.3);
	background: rgba(255, 255, 255, 1);
}

.search-input::placeholder {
	color: rgba(0, 0, 0, 0.4);
}

.search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: rgba(0, 0, 0, 0.4);
	pointer-events: none;
}

.search-results-dropdown {
	position: absolute;
    top: calc(100% + 8px);
    left: 0;
    transform: translateX(-20%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    width: fit-content;
}

.search-result-item {
	display: flex;
	gap: 12px;
	padding: 12px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	text-decoration: none;
	color: #0a0a0a;
	transition: background-color 0.2s ease;
	cursor: pointer;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-item:hover {
	background-color: rgba(0, 0, 0, 0.04);
}

.search-result-image {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}

.search-result-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-result-content {
	flex: 1;
	min-width: 0;
}

.search-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.search-result-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	color: #0a0a0a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
}

.search-result-type {
	font-size: 11px;
	padding: 2px 8px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	color: rgba(0, 0, 0, 0.65);
	white-space: nowrap;
	flex-shrink: 0;
}

.search-result-preview {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.55);
	margin: 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.search-no-results {
	padding: 20px;
	text-align: center;
	color: rgba(0, 0, 0, 0.45);
	font-size: 14px;
}

/* Dark mode support for search */
html.dark .search-input {
	background: var(--bg, #1a1a1a);
	color: var(--fg, #fff);
	border-color: rgba(255, 255, 255, 0.2);
}

html.dark .search-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

html.dark .search-icon {
	color: rgba(255, 255, 255, 0.5);
}

html.dark .search-icon-svg {
	color: rgba(255, 255, 255, 0.8);
}

html.dark .search-results-dropdown {
	background: var(--bg, #1a1a1a);
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html.dark .search-result-item {
	border-bottom-color: rgba(255, 255, 255, 0.05);
	color: var(--fg, #fff);
}

html.dark .search-result-item:hover {
	background-color: rgba(255, 255, 255, 0.05);
}

html.dark .search-result-title {
	color: var(--fg, #fff);
}

html.dark .search-result-type {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.7);
}

html.dark .search-result-preview {
	color: rgba(255, 255, 255, 0.6);
}

html.dark .search-no-results {
	color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
	.search-icon-btn {
		width: 36px;
		height: 36px;
	}

	.search-icon-svg {
		width: 18px;
		height: 18px;
	}

	.header-actions-right {
		flex-wrap: wrap;
		gap: 8px;
	}
}

@media (max-width: 640px) {
	.search-icon-btn {
		width: 32px;
		height: 32px;
	}

	.search-icon-svg {
		width: 16px;
		height: 16px;
	}

	.header-actions-right {
		flex-wrap: wrap;
		gap: 8px;
	}
}

/* Search Page Styles */
.search-page-section {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.search-page-header {
	text-align: center;
	margin-bottom: 2rem;
}

.search-page-title {
	font-size: 2rem;
	font-weight: 700;
	color: var(--fg, #0a0a0a);
	margin-bottom: 0.5rem;
}

.search-page-subtitle {
	font-size: 1rem;
	color: rgba(0, 0, 0, 0.6);
	margin: 0;
}

.search-page-subtitle strong {
	color: var(--fg, #0a0a0a);
}

.search-results-count {
	color: rgba(0, 0, 0, 0.5);
	font-size: 0.9rem;
}

.search-page-form-container {
	margin-bottom: 2rem;
}

.search-page-form {
	max-width: 600px;
	margin: 0 auto;
}

.search-page-input-wrapper {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.search-page-input {
	flex: 1;
	padding: 12px 20px;
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 25px;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
	color: #0a0a0a;
	font-size: 16px;
	transition: all 0.3s ease;
	outline: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-page-input:focus {
	border-color: rgba(0, 0, 0, 0.3);
	background: rgba(255, 255, 255, 1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-page-input::placeholder {
	color: rgba(0, 0, 0, 0.4);
}

.search-page-submit-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #000;
	color: #fff;
	border: none;
	border-radius: 25px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.search-page-submit-btn:hover {
	background: #333;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.search-results-group {
	margin-bottom: 3rem;
}

.search-results-group-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--fg, #0a0a0a);
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.search-results-group-count {
	font-size: 1rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.5);
}

.search-results-list {
	display: grid;
	gap: 1rem;
}

.search-result-card {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 12px;
	overflow: hidden;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-result-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border-color: rgba(0, 0, 0, 0.1);
}

.search-result-card-link {
	display: flex;
	gap: 1rem;
	padding: 1rem;
	text-decoration: none;
	color: inherit;
}

.search-result-card-image {
	width: 120px;
	height: 120px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}

.search-result-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-result-card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.search-result-card-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--fg, #0a0a0a);
	margin: 0;
	line-height: 1.4;
}

.search-result-card-preview {
	font-size: 0.95rem;
	color: rgba(0, 0, 0, 0.6);
	margin: 0;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.search-result-card-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: auto;
}

.search-result-card-type {
	font-size: 0.85rem;
	padding: 4px 12px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	color: rgba(0, 0, 0, 0.65);
}

.search-no-results-page,
.search-empty-state {
	text-align: center;
	padding: 4rem 2rem;
}

.search-no-results-icon,
.search-empty-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 1.5rem;
	color: rgba(0, 0, 0, 0.3);
}

.search-no-results-page h2,
.search-empty-state h2 {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--fg, #0a0a0a);
	margin-bottom: 1rem;
}

.search-no-results-page p,
.search-empty-state p {
	font-size: 1rem;
	color: rgba(0, 0, 0, 0.6);
	margin-bottom: 0.5rem;
	line-height: 1.6;
}

.search-no-results-page p strong {
	color: var(--fg, #0a0a0a);
}

/* Dark mode for search page */
html.dark .search-page-title {
	color: var(--fg, #fff);
}

html.dark .search-page-subtitle {
	color: rgba(255, 255, 255, 0.6);
}

html.dark .search-page-subtitle strong {
	color: var(--fg, #fff);
}

html.dark .search-results-count {
	color: rgba(255, 255, 255, 0.5);
}

html.dark .search-page-input {
	background: rgba(26, 26, 26, 0.9);
	color: var(--fg, #fff);
	border-color: rgba(255, 255, 255, 0.2);
}

html.dark .search-page-input:focus {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(26, 26, 26, 1);
}

html.dark .search-page-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

html.dark .search-results-group-title {
	color: var(--fg, #fff);
	border-bottom-color: rgba(255, 255, 255, 0.1);
}

html.dark .search-results-group-count {
	color: rgba(255, 255, 255, 0.5);
}

html.dark .search-result-card {
	background: rgba(26, 26, 26, 0.9);
	border-color: rgba(255, 255, 255, 0.1);
}

html.dark .search-result-card:hover {
	border-color: rgba(255, 255, 255, 0.2);
}

html.dark .search-result-card-title {
	color: var(--fg, #fff);
}

html.dark .search-result-card-preview {
	color: rgba(255, 255, 255, 0.6);
}

html.dark .search-result-card-type {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.7);
}

html.dark .search-no-results-icon,
html.dark .search-empty-icon {
	color: rgba(255, 255, 255, 0.3);
}

html.dark .search-no-results-page h2,
html.dark .search-empty-state h2 {
	color: var(--fg, #fff);
}

html.dark .search-no-results-page p,
html.dark .search-empty-state p {
	color: rgba(255, 255, 255, 0.6);
}

html.dark .search-no-results-page p strong {
	color: var(--fg, #fff);
}

/* Responsive search page */
@media (max-width: 768px) {
	.search-result-card-link {
		flex-direction: column;
	}

	.search-result-card-image {
		width: 100%;
		height: 200px;
	}

	.search-page-input-wrapper {
		flex-direction: column;
	}

	.search-page-submit-btn {
		width: 100%;
		justify-content: center;
	}
}
