@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
	--bg: #07080b;
	--bg-2: #0c0e13;
	--surface: #111319;
	--surface-2: #161922;
	--border: rgba(255, 255, 255, 0.07);
	--border-strong: rgba(0, 255, 136, 0.22);
	--glow: #00ff88;
	--glow-2: #00ccff;
	--glow-dim: rgba(0, 255, 136, 0.3);
	--text: #e9ecf1;
	--text-dim: rgba(255, 255, 255, 0.48);
	--danger: #ff4d6a;
	--chrome-h: 96px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 60% at 20% 0%, rgba(0, 255, 136, 0.06) 0%, transparent 60%),
		radial-gradient(ellipse 70% 60% at 80% 100%, rgba(0, 180, 255, 0.05) 0%, transparent 60%),
		linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
	z-index: 0;
	pointer-events: none;
}

button { font-family: inherit; cursor: pointer; }

/* ─────────────────────────── Landing ─────────────────────────── */

.landing {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	padding: 0 24px 32px;
}

.hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 16vh;
}

.logo-icon {
	font-size: 4rem;
	margin-bottom: 12px;
	filter: drop-shadow(0 0 30px var(--glow-dim));
	animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
	0%, 100% { filter: drop-shadow(0 0 20px var(--glow-dim)); }
	50% { filter: drop-shadow(0 0 40px var(--glow)); }
}

.hero h1 {
	font-size: 2.8rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: -1px;
}

.hero h1 span {
	background: linear-gradient(135deg, var(--glow), var(--glow-2));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.hero .tagline {
	color: var(--text-dim);
	font-size: 1rem;
	margin-top: 8px;
	letter-spacing: 0.5px;
}

.search-wrapper {
	position: relative;
	margin-top: 44px;
	width: 560px;
	max-width: 92vw;
}

#nx-landing-input {
	width: 100%;
	height: 60px;
	background: rgba(20, 22, 28, 0.6);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid var(--border);
	border-radius: 18px;
	padding: 0 64px 0 24px;
	font-size: 15px;
	font-family: inherit;
	color: #fff;
	outline: none;
	transition: all 0.25s ease;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#nx-landing-input::placeholder { color: var(--text-dim); }

#nx-landing-input:focus {
	border-color: var(--glow);
	box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.12), 0 12px 40px rgba(0, 0, 0, 0.5);
	background: rgba(20, 22, 28, 0.85);
}

.search-go {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: none;
	color: #07080b;
	background: linear-gradient(135deg, var(--glow), var(--glow-2));
	font-size: 20px;
	font-weight: 700;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.search-go:hover { filter: brightness(1.1); transform: translateY(-50%) scale(1.04); }
.search-go:active { transform: translateY(-50%) scale(0.96); }

.features {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 56px;
	flex-wrap: wrap;
}

.feature {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 18px 20px;
	width: 150px;
	text-align: center;
	transition: all 0.25s ease;
}

.feature:hover {
	border-color: var(--border-strong);
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(0, 255, 136, 0.08);
}

.feature .icon { font-size: 1.6rem; margin-bottom: 8px; }
.feature .label { color: var(--text); font-size: 13px; font-weight: 500; }

.error-box { text-align: center; margin-top: 24px; min-height: 24px; }
#nx-error { color: var(--danger); font-size: 14px; white-space: pre-wrap; }
#nx-error-code { font-size: 11px; color: var(--text-dim); font-family: "Courier New", monospace; }

footer {
	margin-top: auto;
	padding-top: 40px;
	text-align: center;
}
footer span {
	color: var(--text-dim);
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

/* ─────────────────────────── Chrome ─────────────────────────── */

.chrome {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: rgba(10, 11, 14, 0.92);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border);
	user-select: none;
}

.chrome.open { display: flex; flex-direction: column; }

.chrome-top {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
}

.nav-buttons { display: flex; gap: 4px; }

.nav-btn {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--text);
	font-size: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
}

.nav-btn:hover { background: var(--surface-2); border-color: var(--border); }
.nav-btn:active { transform: scale(0.94); }

.urlbar-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	height: 38px;
	padding: 0 6px 0 14px;
	transition: all 0.2s ease;
}

.urlbar-wrap:focus-within {
	border-color: var(--glow);
	box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.urlbar {
	flex: 1;
	height: 100%;
	background: transparent;
	border: none;
	outline: none;
	color: #fff;
	font-family: inherit;
	font-size: 13.5px;
}

.urlbar::placeholder { color: var(--text-dim); }

.urlbar-star {
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: var(--text-dim);
	font-size: 17px;
	border-radius: 8px;
	transition: all 0.15s ease;
}
.urlbar-star:hover { background: var(--surface-2); color: var(--glow); }

.chrome-actions { display: flex; gap: 4px; }

.action-btn {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--text);
	font-size: 15px;
	transition: all 0.15s ease;
}
.action-btn:hover { background: var(--surface-2); border-color: var(--border); }

/* Tabs */
.tabs {
	display: flex;
	gap: 4px;
	padding: 0 10px 8px;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nx-tab {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 8px 0 12px;
	height: 32px;
	min-width: 140px;
	max-width: 220px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	font-size: 12.5px;
	color: var(--text-dim);
	cursor: pointer;
	transition: all 0.15s ease;
}
.nx-tab:hover { color: var(--text); background: var(--surface-2); }
.nx-tab.active {
	color: var(--text);
	background: var(--surface-2);
	border-color: var(--border-strong);
	box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.08);
}

.nx-tab-title {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nx-tab-close {
	width: 18px;
	height: 18px;
	border: none;
	background: transparent;
	color: var(--text-dim);
	border-radius: 6px;
	font-size: 14px;
	line-height: 1;
	transition: all 0.12s ease;
}
.nx-tab-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Bookmarks bar */
.bkbar {
	display: none;
	gap: 4px;
	padding: 0 12px 8px;
	overflow-x: auto;
	scrollbar-width: thin;
}
.bkbar.open { display: flex; }

.bkbar-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 8px;
	background: transparent;
	color: var(--text-dim);
	font-size: 12px;
	white-space: nowrap;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.15s ease;
}
.bkbar-item:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.bki-icon { font-size: 11px; }
.bki-js {
	font-size: 9px;
	color: var(--glow);
	border: 1px solid var(--border-strong);
	padding: 0 4px;
	border-radius: 4px;
	letter-spacing: 0.5px;
}

/* Panels */
.panel {
	position: fixed;
	top: var(--chrome-h);
	right: 16px;
	width: 340px;
	max-height: 60vh;
	background: rgba(15, 17, 22, 0.96);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
	z-index: 2000;
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.panel.open { display: flex; }

.panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: 0.3px;
}

.panel-add {
	background: var(--surface-2);
	color: var(--glow);
	border: 1px solid var(--border-strong);
	padding: 4px 10px;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 600;
}
.panel-add:hover { background: rgba(0, 255, 136, 0.12); }

.panel-list {
	overflow-y: auto;
	padding: 6px 8px 10px;
	scrollbar-width: thin;
}

.nx-panel-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	font-size: 12.5px;
	color: var(--text);
	transition: background 0.12s ease;
}
.nx-panel-item:hover { background: var(--surface-2); }

.nx-panel-item-url {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.bk-js-badge {
	font-size: 9px;
	color: var(--glow);
	border: 1px solid var(--border-strong);
	padding: 1px 5px;
	border-radius: 4px;
	letter-spacing: 0.5px;
}

.nx-panel-item-del {
	width: 20px;
	height: 20px;
	border: none;
	background: transparent;
	color: var(--text-dim);
	border-radius: 5px;
	font-size: 12px;
}
.nx-panel-item-del:hover { background: rgba(255,77,106,0.15); color: var(--danger); }

/* Modal */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(6px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 5000;
}
.modal.open { display: flex; }

.modal-card {
	width: 380px;
	max-width: 92vw;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 22px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.modal-card h3 { font-size: 1.05rem; margin-bottom: 16px; color: #fff; }
.modal-card label {
	display: block;
	font-size: 11.5px;
	color: var(--text-dim);
	margin: 12px 0 6px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}
.modal-card input {
	width: 100%;
	height: 38px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 0 12px;
	font-family: inherit;
	font-size: 13px;
	color: var(--text);
	outline: none;
}
.modal-card input:focus { border-color: var(--glow); }
.modal-card code {
	font-size: 11px;
	color: var(--glow);
	background: rgba(0, 255, 136, 0.08);
	padding: 1px 4px;
	border-radius: 3px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 20px;
}
.btn-primary, .btn-secondary {
	padding: 8px 16px;
	border-radius: 9px;
	font-size: 12.5px;
	font-weight: 600;
	border: 1px solid var(--border);
}
.btn-primary {
	background: var(--glow);
	color: #07080b;
	border-color: var(--glow);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }

/* Tabs/frames take the rest of the screen */
.nx-frame {
	position: fixed;
	top: var(--chrome-h);
	left: 0;
	width: 100%;
	height: calc(100% - var(--chrome-h));
	border: none;
	background: #fff;
	z-index: 500;
}

@media (max-width: 700px) {
	:root { --chrome-h: 90px; }
	.hero { padding-top: 12vh; }
	.hero h1 { font-size: 2rem; }
	.features { gap: 10px; }
	.feature { width: 130px; padding: 14px; }
	.chrome-actions .action-btn:last-child { display: none; }
	.panel { right: 8px; left: 8px; width: auto; }
}
