@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
	--bg-primary: #0a0a0f;
	--bg-secondary: #12121a;
	--bg-card: rgba(255, 255, 255, 0.03);
	--border-color: rgba(255, 255, 255, 0.08);
	--text-primary: #f0f0f5;
	--text-secondary: rgba(255, 255, 255, 0.5);
	--accent: #6366f1;
	--accent-glow: rgba(99, 102, 241, 0.3);
	--error: #ef4444;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: hidden;
}

/* Ambient background gradient */
body::before {
	content: "";
	position: fixed;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(ellipse at 50% 0%,
			rgba(99, 102, 241, 0.08) 0%,
			transparent 50%);
	pointer-events: none;
	z-index: 0;
}

.flex-center {
	display: flex;
	justify-content: center;
	position: relative;
	z-index: 1;
}

.header-center {
	align-items: center;
	flex-direction: column;
	margin-top: 12vh;
	padding: 0 24px;
}

.logo-wrapper {
	text-align: center;
	margin-bottom: 12px;
}

.logo-wrapper h1 {
	font-size: 2.8rem;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
	margin-bottom: 4px;
	background: linear-gradient(135deg, #f0f0f5 0%, #6366f1 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.logo-wrapper .text {
	font-size: 1.1rem;
	font-weight: 400;
	color: var(--text-secondary);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.desc p {
	max-width: 480px;
	color: var(--text-secondary);
	font-size: 0.95rem;
	line-height: 1.6;
	text-align: center;
	margin-top: 8px;
}

/* Search input */
#sj-form {
	margin-top: 32px;
	width: 100%;
	max-width: 520px;
}

#sj-address {
	width: 100%;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem;
	padding: 14px 20px;
	border-radius: 12px;
	outline: none;
	transition: all 0.25s ease;
	backdrop-filter: blur(12px);
}

.country-input {
	width: 80px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem;
	padding: 14px 12px;
	border-radius: 12px;
	outline: none;
	text-align: center;
	transition: all 0.25s ease;
	backdrop-filter: blur(12px);
}

.input-row {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}

#sj-address:focus,
.country-input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.proxy-btn {
	width: 100%;
	padding: 14px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	box-shadow: 0 4px 12px var(--accent-glow);
	transition: transform 0.2s, box-shadow 0.2s;
}

.proxy-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px var(--accent-glow);
}

.proxy-btn:active {
	transform: translateY(0);
}

.btn-row {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.refresh-btn {
	flex: 1;
	padding: 12px;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text-secondary);
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.25s ease;
	backdrop-filter: blur(12px);
}

.refresh-btn:hover {
	color: var(--text-primary);
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow);
	transform: translateY(-1px);
}

.refresh-btn:active {
	transform: translateY(0);
}

.refresh-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.status-msg {
	text-align: center;
	font-size: 0.85rem;
	margin-top: 12px;
	min-height: 1.2em;
	transition: opacity 0.3s ease;
}

.status-msg.success {
	color: #22c55e;
}

.status-msg.error {
	color: var(--error);
}

/* Error display */
#sj-error {
	color: var(--error) !important;
	white-space: pre-wrap;
	margin-top: 24px;
	font-size: 0.9rem;
	text-align: center;
}

#sj-error-code {
	font-size: 0.75rem;
	color: var(--text-secondary);
	font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
	margin-top: 8px;
	text-align: center;
}

/* Proxied frame */
#sj-frame {
	border: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 9999;
	opacity: 0;
	transition: opacity 0.4s ease;
}

#sj-frame.visible {
	opacity: 1;
	background-color: #fff;
}

/* Top progress bar */
.progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	background: linear-gradient(90deg, var(--accent), #818cf8, var(--accent));
	background-size: 200% 100%;
	z-index: 10001;
	transition: width 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 0 8px var(--accent-glow);
	animation: shimmer 1.5s ease-in-out infinite;
}

.progress-bar.active {
	opacity: 1;
}

@keyframes shimmer {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* Loading overlay */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: var(--bg-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease;
}

.loading-overlay.active {
	opacity: 1;
	pointer-events: all;
}

.loading-content {
	text-align: center;
}

.loading-spinner {
	width: 48px;
	height: 48px;
	border: 3px solid var(--border-color);
	border-top-color: var(--accent);
	border-radius: 50%;
	margin: 0 auto 20px;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	color: var(--text-primary);
	font-size: 1.1rem;
	font-weight: 500;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

.loading-url {
	color: var(--text-secondary);
	font-size: 0.85rem;
	margin-top: 8px;
	max-width: 400px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Footer */
footer {
	margin-top: auto;
	padding: 24px;
	text-align: center;
	position: relative;
	z-index: 1;
}

footer span {
	color: var(--text-secondary);
	font-size: 0.8rem;
}

/* Subtle animations */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.header-center {
	animation: fadeIn 0.6s ease-out;
}

/* Mobile responsive */
@media (max-width: 600px) {
	.header-center {
		margin-top: 8vh;
	}

	.logo-wrapper h1 {
		font-size: 2rem;
	}

	.logo-wrapper .text {
		font-size: 0.9rem;
	}

	#sj-address {
		font-size: 0.95rem;
		padding: 12px 16px;
	}

	.country-input {
		width: 70px;
		padding: 12px;
	}
}

/* Blocked overlay */
.blocked-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: var(--bg-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	animation: fadeIn 0.5s ease-out;
}

.blocked-content {
	text-align: center;
	padding: 48px 40px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 24px;
	backdrop-filter: blur(20px);
	max-width: 480px;
	width: 90%;
	box-shadow: 0 0 60px rgba(239, 68, 68, 0.08);
}

.blocked-icon {
	font-size: 4rem;
	margin-bottom: 16px;
	animation: pulse 2s ease-in-out infinite;
}

.blocked-content h1 {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 16px;
	background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.blocked-reason {
	color: var(--text-primary);
	font-size: 1.05rem;
	line-height: 1.6;
	margin-bottom: 12px;
}

.blocked-detail {
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.6;
}