/* Geospatial Toolbox stylesheet. Plain CSS (also valid SCSS), driven by custom properties. */

:root {
	--ink: #0b1220;
	--ink-2: #162033;
	--bg: #f3f6fb;
	--surface: #ffffff;
	--text: #1e293b;
	--muted: #64748b;
	--border: #e2e8f0;
	--accent: #0d9488;
	--accent-strong: #0f766e;
	--accent-soft: #ccfbf1;
	--accent-on-dark: #2dd4bf;
	--danger: #dc2626;
	--success: #15803d;
	--radius: 16px;
	--radius-sm: 10px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
	--shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img {
	border: 0;
	max-width: 100%;
}

a {
	color: var(--accent-strong);
	text-underline-offset: 3px;
}

a:hover {
	color: var(--accent);
}

:focus-visible {
	outline: 3px solid rgba(13, 148, 136, 0.45);
	outline-offset: 2px;
}

.hidden {
	display: none !important;
}

.clearfix::after {
	clear: both;
	content: "";
	display: block;
}

/* ---------- Forms ---------- */

label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
	width: 100%;
	padding: 0 14px;
	height: 46px;
	margin-bottom: 16px;
	border: 1px solid #cbd5e1;
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	box-shadow: var(--shadow-sm);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
	height: auto;
	padding: 12px 14px;
	line-height: 1.5;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
select:hover,
textarea:hover {
	border-color: #94a3b8;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
	outline: none;
}

input[type="file"] {
	display: block;
	width: 100%;
	padding: 18px;
	margin-bottom: 16px;
	border: 2px dashed #cbd5e1;
	border-radius: var(--radius-sm);
	background: #f8fafc;
	color: var(--muted);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="file"]:hover {
	border-color: var(--accent);
	background: #f0fdfa;
}

input[type="file"]::file-selector-button {
	margin-right: 14px;
	padding: 8px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--ink-2);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
	background: var(--accent-strong);
}

label + br {
	display: none;
}

#toolbox #converter-container h1 {
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1.2;
}

.input-field {
	margin-bottom: 4px;
}

.input-field p {
	margin: -8px 0 16px;
	font-size: 0.8rem;
	color: var(--muted);
}

/* ---------- Buttons ---------- */

.convert_btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 160px;
	padding: 12px 28px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
	color: #fff;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 8px 20px -8px rgba(13, 148, 136, 0.7);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.convert_btn:hover {
	color: #fff;
	transform: translateY(-1px);
	filter: brightness(1.06);
	box-shadow: 0 12px 24px -8px rgba(13, 148, 136, 0.8);
}

.convert_btn:active {
	transform: translateY(0);
}

.convert_btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

/* ---------- Header and navigation ---------- */

#header {
	position: sticky;
	top: 0;
	z-index: 1020;
	min-height: 0;
	padding: 12px 0;
	background: rgba(11, 18, 32, 0.92);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#header .logo {
	margin: 0 24px 0 0;
}

#header .logo a {
	display: block;
	width: 80px;
	height: 56px;
	background: url(../images/logo.png) no-repeat center center;
	background-size: contain;
}

#header .navbar-toggler {
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 10px;
}

#header .navbar-toggler:focus {
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.4);
}

#header .navbar-toggler-icon {
	--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='white' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#navigation {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 4px;
	line-height: 1.4;
}

#navigation li {
	text-align: left;
}

#navigation > li > a {
	display: block;
	padding: 8px 16px;
	border-radius: 999px;
	color: #cbd5e1;
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

#navigation > li > a:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

#navigation > li > a.active {
	background: rgba(45, 212, 191, 0.14);
	color: var(--accent-on-dark);
}

#navigation .dropdown-toggle::after {
	margin-left: 8px;
}

#navigation .dropdown-menu {
	display: none;
	min-width: 240px;
	margin-top: 10px;
	padding: 8px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	background: var(--ink-2);
	box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

#navigation .dropdown-menu.show {
	display: block;
}

#navigation .dropdown-menu li {
	float: none;
}

#navigation .dropdown-menu .dropdown-header {
	padding: 8px 12px 4px;
	color: #7c8aa5;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#navigation .dropdown-menu .dropdown-divider {
	margin: 8px 4px;
	border-top-color: rgba(255, 255, 255, 0.1);
}

#navigation .dropdown-menu .dropdown-item {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	background: none;
	color: #dbe4f0;
	font-size: 0.93rem;
}

#navigation .dropdown-menu .dropdown-item:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

#navigation .dropdown-menu .dropdown-item.active {
	background: rgba(45, 212, 191, 0.14);
	color: var(--accent-on-dark);
}

@media (max-width: 1199.98px) {
	#navigation {
		flex-direction: column;
		padding: 12px 0;
	}

	#navigation .dropdown-menu {
		margin-top: 4px;
	}
}

/* ---------- Page layout ---------- */

#contents {
	min-height: 60vh;
	margin: 0 auto;
	padding: 48px 12px 64px;
}

#contents::after {
	clear: both;
	content: "";
	display: block;
}

#contents h1 {
	margin: 0 0 16px;
	color: var(--ink);
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

#contents h2 {
	margin: 0 0 12px;
	color: var(--ink);
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1.3;
}

#contents p {
	margin: 0 0 16px;
	color: #475569;
}

/* Hero area: description beside the tool */

#toolbox {
	padding: 24px 0 40px;
}

#toolbox #tool {
	padding-right: 48px;
}

#toolbox h1 {
	margin: 0 0 16px;
	color: var(--ink);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-transform: none;
}

#toolbox h3 {
	margin: 20px 0 8px;
	color: var(--ink);
	font-size: 1.05rem;
	font-weight: 600;
}

#toolbox .subtitle {
	margin: 0 0 16px;
	color: var(--accent-strong);
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.4;
}

#toolbox p {
	margin: 10px 0;
	font-size: 1.05rem;
	line-height: 1.7;
}

/* Tool panel */

#converter-container {
	padding: 28px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

#toolbox > #converter-container {
	max-width: calc(100% - 24px);
}

#converter-container > h1:first-child {
	margin-bottom: 8px;
}

#converter-container p {
	margin-bottom: 16px;
}

#converter-container form > p b {
	font-weight: 500;
	color: var(--muted);
	font-size: 0.85rem;
}

#converter-container button.convert_btn {
	margin-top: 8px;
}

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

#result-box {
	margin: 0 0 32px;
	padding: 28px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

#result-box.hidden {
	display: none;
}

#result-box h2 {
	margin-bottom: 16px;
}

#result-box table {
	width: 100%;
	margin-bottom: 24px;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

#result-box th,
#result-box td {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

#result-box tr:last-child th,
#result-box tr:last-child td {
	border-bottom: 0;
}

#result-box th {
	width: 28%;
	background: #f8fafc;
	color: var(--muted);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

#result-box td {
	font-family: var(--mono);
	font-size: 0.9rem;
	word-break: break-word;
}

#result-box textarea {
	margin-bottom: 20px;
	font-family: var(--mono);
	font-size: 0.9rem;
}

#result-box #map,
#map {
	height: 380px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	z-index: 0;
}

#result-box #validation-errors {
	padding-left: 1.2rem;
	font-family: var(--mono);
	font-size: 0.9rem;
	color: var(--danger);
}

#error-message {
	margin: 0 0 16px;
	padding: 10px 14px;
	border: 1px solid #fecaca;
	border-radius: var(--radius-sm);
	background: #fef2f2;
	color: var(--danger) !important;
}

#geojson-result {
	background: #0f172a;
	color: #e2e8f0;
	border: 1px solid #1e293b;
	border-radius: var(--radius-sm);
	padding: 16px;
	font-family: var(--mono);
	font-size: 0.9rem;
	line-height: 1.5;
	tab-size: 2;
	resize: vertical;
}

#geojson-result:focus {
	background: #0f172a;
	color: #e2e8f0;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
	outline: none;
}

#geojson-result::selection {
	background: #134e4a;
}

/* Line numbered textarea */

.line-numbered {
	position: relative;
	width: 100%;
	max-width: 1100px;
	margin-bottom: 16px;
	border: 1px solid #cbd5e1;
	border-radius: var(--radius-sm);
	background: var(--surface);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

.line-numbered .line-numbers,
.line-numbered textarea {
	font-family: var(--mono);
	font-size: 14px;
	line-height: 20px;
	padding-top: 12px;
	padding-bottom: 12px;
	margin: 0;
}

.line-numbered .line-numbers {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4em;
	padding-right: 10px;
	overflow: hidden;
	text-align: right;
	white-space: pre;
	color: #94a3b8;
	background: #f1f5f9;
	border-right: 1px solid var(--border);
	user-select: none;
}

.line-numbered textarea {
	display: block;
	height: auto;
	margin: 0;
	padding-left: calc(4em + 12px);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	resize: vertical;
	overflow: auto;
	white-space: pre;
}

.line-numbered textarea:focus {
	box-shadow: none;
}

.line-numbered:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
}

/* ---------- Feedback ---------- */

.spinner {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spinner-rotation 0.75s linear infinite;
	vertical-align: middle;
}

@keyframes spinner-rotation {
	to {
		transform: rotate(360deg);
	}
}

#contact-result {
	margin-top: 1rem;
	font-size: 0.95rem;
}

#contact-result.success {
	color: var(--success);
}

#contact-result.error {
	color: var(--danger);
}

.alert {
	border-radius: var(--radius-sm);
}

/* Bootstrap cards (pricing and profile) */

.card {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card.h-100:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}

.card.border-primary {
	border-color: var(--accent) !important;
}

.card-header.text-bg-primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-strong)) !important;
	color: #fff !important;
}

.btn {
	border-radius: 999px;
	font-weight: 600;
}

/* ---------- Info section below each tool ---------- */

#tagline {
	margin: 24px 0 0;
	padding: 36px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

#tagline h1,
#tagline .tagline-title {
	margin: 0 0 12px;
	font-size: 1.5rem;
}

#tagline h1:not(:first-child),
#tagline .tagline-title:not(:first-child) {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
}

#tagline h2,
#tagline h3 {
	color: var(--accent-strong);
	font-size: 1.1rem;
}

#tagline .tagline-title {
	color: var(--ink);
	font-size: 1.5rem;
}

#tagline > div {
	max-width: 75ch;
}

#tagline ul {
	padding-left: 1.2rem;
	color: #475569;
}

#tagline .faq h3 {
	margin: 18px 0 4px;
	color: var(--ink);
	font-size: 1.05rem;
	font-weight: 600;
}

#tagline .faq p {
	margin: 0;
}

#tagline .related-tools {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#tagline .related-tools li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: #f8fafc;
}

#tagline .related-tools a {
	font-weight: 600;
	text-decoration: none;
}

#tagline .related-tools span {
	color: var(--muted);
	font-size: 0.9rem;
	line-height: 1.4;
}

.cta-link {
	display: inline-block;
	margin: 4px 8px 4px 0;
	padding: 10px 24px;
	border-radius: 999px;
	background: var(--ink);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.15s ease;
}

.cta-link:hover {
	background: var(--accent-strong);
	color: #fff;
	transform: translateY(-1px);
}

.cta-link.cta-secondary {
	border: 1px solid var(--border);
	background: transparent;
	color: var(--ink);
}

.cta-link.cta-secondary:hover {
	border-color: var(--accent-strong);
	background: transparent;
	color: var(--accent-strong);
}

/* ---------- Footer ---------- */

#footer {
	margin: 0;
	padding: 40px 12px 32px;
	background: var(--ink);
	color: #94a3b8;
}

#footer .footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 32px 56px;
	margin-bottom: 28px;
	padding-bottom: 28px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#footer .footer-links h2 {
	margin: 0 0 10px;
	color: #e2e8f0;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#footer .footer-links ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

#footer .footer-links li {
	margin-bottom: 6px;
}

#footer .footer-links a {
	margin: 0;
	font-size: 0.93rem;
	text-decoration: none;
}

#footer p {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.6;
	color: #94a3b8;
}

#footer a {
	margin-left: 12px;
	color: var(--accent-on-dark);
}

#footer a:hover {
	color: #fff;
}

@media (max-width: 991.98px) {
	#toolbox #tool {
		padding-right: 12px;
		margin-bottom: 24px;
	}

	#tagline,
	#converter-container,
	#result-box {
		padding: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
