:root {
	--bg: #172229;
	--panel: #1f4e57;
	--panel-soft: #235a64;
	--text: #e4eef7;
	--muted: #c1d4e8;
	--accent: #5b8cff;
	--accent-2: #4f7de2;
	--line: rgba(197, 226, 255, 0.2);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
	min-height: 100vh;
	background-color: var(--bg);
	color: var(--text);
}

.app {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.card1 {
	background: linear-gradient(180deg, #6f7bc7, #5468b6);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 18px;
	box-shadow: 0 10px 26px rgba(8, 12, 28, 0.28);
	
}
.card2 {
	background: linear-gradient(180deg, var(--panel), var(--panel-soft));
	border: 1px solid rgba(169, 219, 255, 0.25);
	border-radius: 14px;
	padding: clamp(18px, 2.4vw, 30px);
	min-height: clamp(240px, 32vh, 360px);
	box-shadow:
		0 14px 34px rgba(7, 11, 23, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	
}

.top-bar h1 {
	margin: 0 0 14px;
	font-size: clamp(1.7rem, 2.5vw, 2.2rem);
	color: #eef3ff;
	letter-spacing: 0.2px;
}

.search-row {
	display: flex;
	gap: 10px;
}

.status-pill {
	margin: 10px 0 0;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.82rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(214, 232, 255, 0.34);
	color: #e7f1ff;
	background: rgba(8, 29, 43, 0.3);
}

.status-pill.loading {
	border-color: rgba(255, 214, 125, 0.45);
	color: #fff2cf;
	background: rgba(67, 46, 10, 0.35);
}

.status-pill.success {
	border-color: rgba(157, 241, 194, 0.42);
	color: #d8ffe9;
	background: rgba(13, 64, 36, 0.35);
}

.status-pill.error {
	border-color: rgba(255, 164, 164, 0.42);
	color: #ffdede;
	background: rgba(79, 22, 22, 0.35);
}

.search-field {
	position: relative;
	flex: 1;
}

input,
select,
button {
	border-radius: 12px;
	border: 1px solid rgba(188, 220, 247, 0.32);
	background: #13343d;
	color: #e5edf7;
	padding: 11px 12px;
	font-size: 0.96rem;
}

#searchInput {
	flex: 1;
}

#queryInput {
	flex: 1;
	width: 100%;
	padding-right: 46px;
	background: #163841;
	border-color: rgba(189, 221, 244, 0.24);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
	border-radius: 999px;
}

#queryInput::placeholder {
	color: rgba(229, 237, 247, 0.6);
}

#searchBtn {
	background: linear-gradient(180deg, #7eb6ee, #679ee0);
	border: 1px solid rgba(90, 134, 208, 0.95);
	color: #0e1722;
	padding-inline: 18px;
	border-radius: 999px;
	box-shadow: 0 6px 14px rgba(14, 28, 44, 0.18);
}

#searchBtn:hover {
	filter: brightness(1.03);
}

.clear-search-btn {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #c7d7ef;
	font-size: 1.25rem;
	line-height: 1;
	display: grid;
	place-items: center;
	opacity: 0.75;
	box-shadow: none;
}

.clear-search-btn.is-hidden {
	display: none;
}

.clear-search-btn:hover {
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.14);
	opacity: 1;
}

.clear-search-btn:active {
	transform: translateY(-50%);
}

button {
	cursor: pointer;
	background: linear-gradient(180deg, var(--accent), var(--accent-2));
	border: 1px solid #1e40af;
	font-weight: 600;
	transition: transform 0.14s ease, opacity 0.14s ease;
	color: #f8fbff;
}

button:hover {
	transform: translateY(-1px);
}

button:active {
	transform: translateY(1px);
}

button.secondary {
	background: rgba(229, 239, 255, 0.12);
	border: 1px solid rgba(174, 205, 244, 0.35);
	color: #e2ecff;
}

input:focus-visible,
button:focus-visible,
input[type="checkbox"]:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.24);
	outline-offset: 1px;
}

.layout {
	margin-top: 16px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.filters {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: fit-content;
}

.filters-wide {
	width: 100%;
}

.filters-hint {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: 0.96rem;
}

.filters-hint.notice {
	margin-bottom: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid rgba(133, 187, 255, 0.36);
	background: rgba(14, 28, 44, 0.35);
	color: #dfebff;
	font-weight: 600;
}

.filters h2 {
	margin: 0 0 8px;
	font-size: clamp(1.45rem, 2vw, 1.9rem);
	letter-spacing: 0.2px;
	color: #eaf2ff;
}

.filters label {
	color: #d1e1f4;
	font-size: 0.95rem;
	margin-top: 5px;
}

.filter-groups {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
}

.filter-group {
	flex: 1 1 calc(50% - 10px);
	min-width: 280px;
	border: 1px solid rgba(186, 221, 255, 0.22);
	border-radius: 12px;
	background: rgba(10, 34, 42, 0.22);
	padding: 8px 10px;
}

.filter-group summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.2px;
	color: #d8e8ff;
	list-style: none;
	padding: 2px 2px 6px;
}

.filter-group summary::-webkit-details-marker {
	display: none;
}

.filter-group summary::after {
	content: "▾";
	float: right;
	font-size: 0.8rem;
	opacity: 0.8;
	transform: translateY(1px);
}

.filter-group:not([open]) summary::after {
	content: "▸";
}

.filter-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4px;
	margin-top: 2px;
}

.filter-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1rem;
	color: #d4e2f4;
	padding: 6px 8px;
	border-radius: 10px;
	transition: background-color 0.14s ease;
}

.filter-item:hover {
	background: rgba(111, 194, 255, 0.14);
}

.filter-count {
	font-size: 0.75rem;
	line-height: 1;
	padding: 3px 7px;
	border-radius: 999px;
	border: 1px solid rgba(163, 204, 255, 0.5);
	background: rgba(224, 239, 255, 0.12);
	color: #dbe9ff;
	margin-left: 4px;
	font-weight: 600;
}

.priority-filter span {
	color: #b3635e;
	font-weight: bolder;
}

.filter-item input[type="checkbox"] {
	width: auto;
	margin: 0;
	padding: 0;
	accent-color: #2563eb;
	transform: scale(1.12);
}

.card2 #clearBtn {
	margin-top: 0;
	padding: 10px 20px;
	border-radius: 12px;
	background: rgba(229, 238, 247, 0.16);
	border: 1px solid rgba(190, 216, 241, 0.34);
	color: #e4eef9;
}

.filter-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin-top: 10px;
}

.card2 #filterSearchBtn {
	margin-left: auto;
	padding: 10px 20px;
	border-radius: 12px;
	background: linear-gradient(180deg, #2563eb, #1d4ed8);
	border: 1px solid #1e40af;
	color: #f8fbff;
}

.results-area {
	display: grid;
	gap: 12px;
}

.active-filters-bar {
	display: grid;
	gap: 8px;
	margin: 0 0 12px;
	padding: 10px;
	border-radius: 12px;
	border: 1px solid rgba(178, 214, 255, 0.3);
	background: rgba(12, 39, 49, 0.38);
}

.active-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.active-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgba(174, 205, 244, 0.4);
	background: rgba(229, 239, 255, 0.13);
	color: #e8f1ff;
	font-size: 0.82rem;
	line-height: 1;
	font-weight: 600;
}

.active-chip span {
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(91, 140, 255, 0.3);
	font-size: 0.75rem;
	color: #dfeaff;
}

.result-breakdown {
	margin: 0;
	font-size: 0.9rem;
	color: #d2e3f7;
}

#clearAllQuickBtn {
	justify-self: start;
	padding: 8px 12px;
	border-radius: 10px;
}

.card {
	background: linear-gradient(180deg, #1f4e57, #214c56);
	border: 1px solid rgba(169, 219, 255, 0.25);
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 10px 24px rgba(7, 11, 23, 0.28);
}

.result-header p {
	margin: 0;
	color: var(--muted);
}

.result-group h3 {
	margin: 0 0 12px;
	color: #eaf2ff;
}

.analytics-text {
	margin: -4px 0 10px;
	font-size: 0.84rem;
	color: #b7cfe8;
}

.result-group {
	scroll-margin-top: 96px;
}

.is-hidden {
	display: none;
}

.cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 12px;
}

.website-card {
	background: #123640;
	border: 1px solid rgba(188, 221, 246, 0.24);
	border-radius: 12px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	animation: fadeIn 0.28s ease;
	transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.website-card:hover {
	transform: translateY(-2px);
	border-color: rgba(176, 214, 244, 0.45);
	box-shadow: 0 10px 24px rgba(6, 10, 22, 0.28);
}

.website-card h4 {
	margin: 0;
	color: #ecf4ff;
}

#resultsList .website-card p {
	margin: 0;
	color: #c0d3e9;
	line-height: 1.4;
}

.tag-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag {
	font-size: 0.75rem;
	padding: 4px 8px;
	border-radius: 999px;
	border: 1px solid rgba(179, 217, 255, 0.34);
	background: rgba(225, 240, 255, 0.1);
	color: #d3e6fb;
}

.meta {
	color: var(--muted);
	font-size: 0.82rem;
}

.why {
	color: #c9d7ff;
	font-size: 0.9rem;
}

.open-link {
	text-decoration: none;
	text-align: center;
	padding: 10px 12px;
	border-radius: 9px;
	background: linear-gradient(180deg, #2563eb, #1d4ed8);
	border: 1px solid #1e40af;
	color: white;
	font-weight: 600;
}

.scroll-results-btn {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 46px;
	height: 46px;
	padding: 0;
	border-radius: 50%;
	font-size: 1.35rem;
	line-height: 1;
	display: grid;
	place-items: center;
	background: linear-gradient(180deg, #dce8ff, #bccff2);
	color: #173164;
	border: 1px solid #b8cdef;
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
	z-index: 30;
}

.scroll-results-btn.is-hidden {
	display: none !important;
}

.scroll-results-btn:hover {
	background: linear-gradient(180deg, #eaf2ff, #cadcf7);
	transform: translateY(-6px);
}

.scroll-results-btn:active {
	transform: translateY(0);
}

mark {
	background: rgba(167, 198, 255, 0.42);
	color: #eef4ff;
	padding: 0 2px;
	border-radius: 4px;
}

.empty {
	color: #c0d3e8;
	font-style: italic;
}

.no-results-panel {
	border: 1px solid rgba(178, 214, 255, 0.28);
	border-radius: 12px;
	background: rgba(12, 39, 49, 0.35);
	padding: 16px;
	color: #d7e8fb;
	display: grid;
	gap: 10px;
	width: 100%;
	max-width: none;
}

.cards-grid > .no-results-panel {
	grid-column: 1 / -1;
}

.no-results-panel h4,
.no-results-panel h5 {
	margin: 0;
	color: #ecf4ff;
}

.no-results-panel p {
	margin: 0;
	color: #c6d8ee;
}

.no-results-panel ul {
	margin: 0;
	padding-left: 18px;
	display: grid;
	gap: 4px;
}

.no-results-actions,
.suggested-filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.suggested-filter-chip {
	padding: 7px 10px;
	border-radius: 999px;
	border: 1px solid rgba(174, 205, 244, 0.4);
	background: rgba(229, 239, 255, 0.14);
	color: #e7f0ff;
	font-size: 0.84rem;
	line-height: 1;
}

.nearest-matches-wrap {
	display: grid;
	gap: 8px;
}

.nearest-matches-wrap .cards-grid {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 12px;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 860px) {
	.layout {
		grid-template-columns: 1fr;
	}

	.filter-groups {
		flex-direction: column;
	}

	.filter-group {
		min-width: 0;
		width: 100%;
	}

	.filter-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.app {
		padding: 12px 12px 18px;
	}

	.top-bar {
		position: sticky;
		top: 8px;
		z-index: 40;
		backdrop-filter: blur(6px);
	}

	.card1,
	.card2 {
		padding: 14px;
		border-radius: 14px;
	}

	.search-row {
		flex-direction: column;
		gap: 8px;
	}

	.search-field {
		width: 100%;
	}

	#queryInput,
	#searchBtn,
	#clearBtn,
	#filterSearchBtn {
		min-height: 44px;
	}

	.clear-search-btn {
		top: 50%;
	}

	#searchInput,
	#searchBtn,
	.filters select,
	#clearBtn,
	#filterSearchBtn {
		width: 100%;
	}

	.filter-item {
		min-height: 42px;
		padding: 8px 10px;
	}

	.active-filters-bar {
		padding: 10px;
	}

	.active-chip {
		width: 100%;
		justify-content: space-between;
	}

	.filter-item input[type="checkbox"] {
		transform: scale(1.22);
	}

	.filter-actions {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 8px;
	}

	.cards-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.open-link {
		min-height: 42px;
		display: grid;
		place-items: center;
	}

	.scroll-results-btn {
		right: 14px;
		bottom: 14px;
		width: 48px;
		height: 48px;
	}
}
