:root {
	font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
	line-height: 1.5;
	font-weight: 400;
	color-scheme: light dark;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-text-size-adjust: 100%;
}

html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
}

* {
	box-sizing: border-box;
}
.app {
	min-height: 100vh;
	background: linear-gradient(135deg, #f0f9ff 0%, #f3e8ff 100%);
	color: #111827;
	transition: all 0.3s ease;
}
.button {
	font-family: inherit;
	font-size: inherit;
}
.input,
.textarea {
	font-family: inherit;
}
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem;
}
.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 2rem;
}
.title-section {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.title-section:hover {
	opacity: 0.8;
}
.logo {
	padding: 0.75rem;
	background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
	border-radius: 50%;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
}

.title-section h1 {
	font-size: 1.875rem;
	font-weight: bold;
	background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin: 0;
}
.title-section p {
	font-size: 0.875rem;
	opacity: 0.7;
	margin: 0;
}

.controls-section {
	display: grid;
	gap: 1.5rem;
	margin-bottom: 1rem;
	padding: 1.5rem;
	border-radius: 1rem;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(10px);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	grid-template-columns: 1fr;
	grid-template-areas:
		"settings"
		"items"
		"print";
}
@media (min-width: 768px) {
	.controls-section {
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"settings items"
			"print print";
	}
}
.settings-column {
	grid-area: settings;
}
.section-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.section-header svg {
	color: #d53369;
}
.input-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
	.input-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
.input-grid label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
}
.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.input-wrapper input[type="number"] {
	/* fix up/down arrows in Chrome/Safari */
	appearance: none;
	-webkit-appearance: none; /* fix up/down arrows in Chrome/Safari */
	width: 100%;
	padding: 0.5rem 2.5rem 0.5rem 0.75rem;
	border-radius: 0.5rem;
	border: 1px solid #d1d5db;
	background: white;
	color: #111827;
	transition: all 0.2s ease;
}
/* Fix firefox adding up/down arrows */
.input-wrapper input[type="number"] {
	-moz-appearance: textfield;
}

.input-wrapper select {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border-radius: 0.5rem;
	border: 1px solid #d1d5db;
	background: white;
	color: #111827;
	transition: all 0.2s ease;
	cursor: pointer;
}

.input-wrapper input[type="number"]::-webkit-outer-spin-button,
.input-wrapper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.input-arrows {
	position: absolute;
	right: 0.25rem;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.input-arrow {
	width: 14px;
	height: 12px;
	background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
	border: 1px solid #d1d5db;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	user-select: none;
	font-size: 10px;
	font-weight: bold;
	color: #6b7280;
}
.input-arrow:first-child {
	border-radius: 0.25rem 0.25rem 0 0;
}
.input-arrow:last-child {
	border-radius: 0 0 0.25rem 0.25rem;
	border-top: none;
}
.input-arrow:hover {
	background: linear-gradient(135deg, #d53369, #daae51);
	color: white;
	transform: scale(1.05);
}
.input-arrow:active {
	transform: scale(0.95);
}
.items-column {
	grid-area: items;
}

.items-actions {
	margin-top: 0.75rem;
	display: flex;
	justify-content: flex-end;
}

.btn-restore {
	background: rgba(34, 197, 94, 0.1);
	color: #629677;
	border: 1px solid rgba(34, 197, 94, 0.3);
	font-size: 0.875rem;
	padding: 0.375rem 0.75rem;
}

.btn-restore:hover {
	background: rgba(34, 197, 94, 0.2);
	border-color: rgba(34, 197, 94, 0.5);
	transform: translateY(-1px);
}
/* Textarea styling */
textarea {
	width: 100%;
	padding: 0.75rem;
	border-radius: 0.5rem;
	border: 1px solid #d1d5db;
	background: white;
	color: #111827;
	resize: none;
	transition: all 0.2s ease;
	font-family: inherit;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db #f9fafb;
	min-height: 200px;
}

textarea::-webkit-scrollbar {
	width: 8px;
}

textarea::-webkit-scrollbar-track {
	background: #f9fafb;
	border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #d1d5db, #9ca3af);
	border-radius: 4px;
	transition: all 0.2s ease;
}

textarea::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(135deg, #9ca3af, #6b7280);
}
textarea:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
	border-color: #8b5cf6;
}

textarea:focus::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #d53369, #daae51);
}
textarea:hover {
	border-color: #9ca3af;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 0.5rem;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 500;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.button-group {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.btn-primary {
	background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
	color: white;
}

.btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 25px -8px rgba(213, 51, 105, 0.5);
}

.btn-secondary {
	background: linear-gradient(135deg, #d53369, #daae51);
	color: white;
}

.btn-secondary:hover:not(.disabled) {
	transform: translateY(-1px);
	box-shadow: 0 8px 25px -8px rgba(59, 130, 246, 0.5);
}

.btn-secondary.disabled {
	background: #9ca3af;
	cursor: not-allowed;
	opacity: 0.6;
}

.btn-tertiary {
	background: rgba(107, 114, 128, 0.1);
	color: #374151;
	border: 1px solid #d1d5db;
}

.btn-tertiary:hover {
	background: rgba(107, 114, 128, 0.2);
	transform: translateY(-1px);
}

/* Card display styles */
.card-container {
	position: relative;
	z-index: 1;
	width: 100%;
	margin: 0;
	padding: 2rem;
	min-height: 100vh;
}

.card-container > * {
	max-width: none;
	margin: 0;
}

.card-header {
	text-align: center;
	margin-bottom: 2rem;
}
.card-header h2 {
	background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
	background-size: 100% 100%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin: 0;
	display: inline-block;
}

.page-wrapper {
	margin-bottom: 3rem;
}

.card-wrapper {
	margin-bottom: 2rem;
	display: block;
	width: 100%;
}

.card-number {
	text-align: center;
	margin-bottom: 1rem;
}

.banko-card {
	margin: 0 auto;
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	background: white;
	width: 100%;
	max-width: min(95vw, 1200px);
}

.banko-card table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.banko-cell {
	border: 2px solid #e5e7eb;
	padding: 1rem;
	text-align: center;
	vertical-align: middle;
	background: white;
	color: #000000; /* Ensure black text */
	font-weight: 500;
	font-size: clamp(0.875rem, 1.5vw, 1.25rem);
	line-height: 1.25;
	min-height: 60px;
	overflow: hidden;
}

.banko-cell:hover {
	background: rgba(213, 51, 105, 0.05);
}

.banko-cell div {
	word-wrap: normal;
	hyphens: auto;
	color: #000000; /* Ensure black text in content div */
	position: relative;
}

.card-id {
	position: absolute;
	font-size: 10px;
	font-weight: bold;
	color: #666;
	background: rgba(255, 255, 255, 0.8);
	padding: 1px 3px;
	border-radius: 2px;
	border: 1px solid #ccc;
}

.card-id-top-right {
	top: 2px;
	right: 2px;
}

.card-id-top-left {
	top: 2px;
	left: 2px;
}

.card-id-bottom-right {
	bottom: 2px;
	right: 2px;
}

.card-id-bottom-left {
	bottom: 2px;
	left: 2px;
}

/* Print styles */
@media print {
	html,
	body,
	#root,
	.app,
	.card-container {
		height: 100%;
	}
	@page {
		size: A4 landscape;
		margin: 10mm;
		background: white;
	}

	.no-print {
		display: none !important;
	}

	body {
		margin: 0;
		padding: 0;
		width: 100%;
		height: 100%;
		background: white !important;
	}

	.app {
		background: white !important;
	}

	.card-container {
		margin: 0;
		padding: 0;
		width: 100%;
		height: 100%;
		background: white !important;
	}

	.page-wrapper {
		page-break-after: always;
		margin: 0;
		width: 100%;
		height: 100%;
		/* padding: 5mm; */
		/* gap: 10mm; */
		display: flex;
		box-sizing: border-box;
		flex-direction: column;
		align-items: stretch;
		justify-content: center;
	}

	.page-wrapper:last-child {
		page-break-after: avoid;
	}

	.card-wrapper {
		margin: 0;
		padding: 0;
		width: 100%;
		height: var(--card-height, 80mm);
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.banko-card {
		box-shadow: none;
		border: 2px solid #000;
		border-radius: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		display: flex;
		flex-direction: column;
	}

	.banko-card table {
		width: 100%;
		height: 100%;
		flex: 1;
	}

	.banko-cell {
		border: 1px solid #000 !important;
		padding: 4px !important;
		font-size: clamp(12px, calc(277mm / var(--cols, 5) / 10), 20px) !important;
		line-height: 1.2 !important;
		background: white !important;
		color: #000000 !important;
		height: calc(100% / var(--rows, 5));
		width: calc(100% / var(--cols, 5));
		vertical-align: middle;
		text-align: center;
	}

	.banko-cell div {
		color: #000000 !important;
		font-weight: 500;
		word-break: break-word;
		hyphens: auto;
		overflow: hidden;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		position: relative;
	}

	.card-id {
		position: absolute !important;
		font-size: 12px !important;
		font-weight: bold !important;
		color: #333 !important;
		background: rgba(255, 255, 255, 0.9) !important;
		padding: 1px 2px !important;
		border-radius: 1px !important;
		border: 0.5px solid #666 !important;
	}

	.card-id-top-right {
		top: 1px !important;
		right: 1px !important;
	}

	.card-id-top-left {
		top: 1px !important;
		left: 1px !important;
	}

	.card-id-bottom-right {
		bottom: 1px !important;
		right: 1px !important;
	}

	.card-id-bottom-left {
		bottom: 1px !important;
		left: 1px !important;
	}

	/* Adjust for different grid sizes */
	.banko-card table tr {
		height: calc(100% / var(--rows, 5));
	}

	.banko-card table td {
		height: calc(100% / var(--rows, 5));
	}
}
