:root {
  --darkest: #020617;
  --darker: #020826;
  --dark: #020b32;
  --highlight: #fbbf24;
  --light: #213555;
}

:root {
  --darkest: #1a1a2e;
  --darker: #16213e;
  --dark: #0f3460;
  --highlight: #fbbf24;
  --light: #213555;
}

/* ===== Base layout ===== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	height: 100%;
}

body {
	background: var(--darkest) !important; /* very dark blue/black */
	color: #e5e7eb;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
		sans-serif;
}

/* Wrapper */

#app {
	min-height: 100vh;
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 1.5rem 3rem;
	display: flex;
	flex-direction: column;
}

/* ===== Header & title ===== */

header {
	text-align: center;
	margin-bottom: 2rem;
}

#title {
	margin: 0 0 1rem;
	font-size: 2.25rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #f9fafb;
}

/* ===== Inputs layout ===== */

.inputs {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	align-items: stretch;
	background: var(--darker);
	border-radius: 1rem;
	padding: 1.5rem;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(148, 163, 184, 0.2);
}

@media (min-width: 900px) {
	.inputs {
		flex-direction: row;
		align-items: flex-start;
		justify-content: space-between;
	}
}

/* ===== OCR panel ===== */

#ocr {
	flex: 1 1 55%;
	background: var(--dark);
	border-radius: 0.75rem;
	padding: 1.25rem;
	border: 1px solid rgba(148, 163, 184, 0.3);
	text-align: left;
}

#ocr label {
	font-weight: 600;
	color: #e5e7eb;
}

#upload {
	display: block;
	width: 100%;
	margin-bottom: 0.75rem;
	color: #e5e7eb;
}

/* Paste area */

#pasteArea {
	margin-top: 0.25rem;
	margin-bottom: 1rem;
	min-height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0.75rem;
	border-radius: 0.75rem;
	border: 2px dashed rgba(148, 163, 184, 0.6);
	background: rgba(15, 23, 42, 0.85);
	color: #cbd5f5;
	font-size: 0.9rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease,
		box-shadow 0.15s ease;
}

#pasteArea:focus {
	outline: none;
	border-color: var(--highlight);
  background: rgba(0,0,0, 0.45);
	box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.5);
}

#pasteArea:hover {
	background: rgba(15, 23, 42, 0.95);
	border-color: var(--highlight);
}

/* Preview / OCR text */

#previewImage img {
	display: block;
	max-width: 100%;
	border-radius: 0.5rem;
	margin: 0.5rem auto 0.75rem;
}

#extractedText {
	margin-top: 0.5rem;
	padding: 0.75rem;
	border-radius: 0.5rem;
	background: rgba(15, 23, 42, 0.9);
	color: #e5e7eb;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	font-size: 0.85rem;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid rgba(148, 163, 184, 0.35);
}

/* ===== Form panel ===== */

form {
	flex: 1 1 40%;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	text-align: left;
}

form > div {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

label, #ocr-finish {
	font-size: 0.9rem;
	font-weight: 600;
	color: #e5e7eb;
}

#ocr-finish {
  text-align: center;
}

#autofill {
	margin: 0;
	font-size: 0.78rem;
	color: #9ca3af;
	cursor: pointer;
}

#autofill:hover {
	color: var(--highlight);
}

/* Inputs & selects */

input[type="text"],
select,
input[type="file"] {
	background: var(--darkest);
	border-radius: 0.5rem;
	border: 1px solid rgba(148, 163, 184, 0.6);
	color: #e5e7eb;
	padding: 0.55rem 0.75rem;
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease,
		background 0.15s ease;
}

input[type="text"]::placeholder {
	color: #6b7280;
}

input[type="text"]:focus,
select:focus {
	border-color: var(--highlight);
	box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
	background: #02081e;
}

/* Buttons */

button {
	border: none;
	border-radius: 999px;
	padding: 0.6rem 1.4rem;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	background: var(--highlight);
	color: var(--darkest);
	transition: transform 0.1s ease, box-shadow 0.1s ease,
		background 0.1s ease;
}

button:hover {
	background: #f59e0b;
	box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
	transform: translateY(-1px);
}

button:active {
	transform: translateY(0);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Make submit button full width in its container */
form > div:last-child button[type="submit"] {
	width: 100%;
}

/* ===== Output area ===== */

#output {
	margin-top: 2rem;
	background: var(--darkest);
	border-radius: 0.75rem;
	padding: 1rem 1.25rem;
	color: #e5e7eb;
	border: 1px solid rgba(148, 163, 184, 0.4);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	font-size: 0.85rem;
	white-space: pre-wrap;
	overflow-x: auto;
}

/* ===== Copy-to-clipboard widget ===== */

#copy {
	margin: 1.25rem auto 0;
	padding: 0.75rem 1rem;
	display: none; /* script toggles to block */
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	border: none;
	border-radius: 999px;
	padding: 0.6rem 1.4rem;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	background: var(--highlight);
	color: #111827;
}

#copy p {
	margin: 0;
}

#copy button {
	padding: 0.3rem 0.9rem;
}

#copy:hover {
	transform: translateY(-1px);
}
#copy button:hover {
	transform: translateY(0px);
}

/* ===== Notify button & notifications ===== */

#notif {
	position: fixed;
	left: 0.75rem;
	bottom: 0.75rem;
	z-index: 50;
	padding: 0.5rem 1rem;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
}

#notifs {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

#notifs > div {
	background: var(--darker);
	border-radius: 0.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid rgba(148, 163, 184, 0.3);
	font-size: 0.8rem;
}

/* ===== Small screens tweaks ===== */

@media (max-width: 600px) {
	#title {
		font-size: 1.7rem;
	}

	.inputs {
		padding: 1.25rem;
	}

	#notif {
		left: 50%;
		transform: translateX(-50%);
	}
}

.keyword {
  text-decoration: underline;
}

@keyframes submit-gradient {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

.submit-highlight {
	background-image: linear-gradient( 120deg, #f97316, var(--highlight), #37b3c8, #f97316);
	background-size: 250% 250%;
	color: #111827;

	animation: submit-gradient 2.4s ease-in-out infinite;
}

.submit-highlight:hover,
.submit-highlight:active {
	animation-play-state: paused;
}

#pasteArea.drag-over {
	border-color: var(--highlight);
	background: rgba(15, 23, 42, 0.98);
	box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4);
}

