/* ===== RESET & BASE STYLES ===== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary-bg: #1a1a2e;
	--secondary-bg: #16213e;
	--card-bg: #0f3460;
	--accent-primary: #e94560;
	--accent-secondary: #533483;
	--text-primary: #ffffff;
	--text-secondary: #b8b8b8;
	--success-color: #00d4aa;
	--warning-color: #ffa726;
	--shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
	--shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
	--shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);
	--border-radius: 12px;
	--border-radius-large: 20px;
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		sans-serif;
	background: linear-gradient(
		135deg,
		var(--primary-bg) 0%,
		var(--secondary-bg) 100%
	);
	color: var(--text-primary);
	line-height: 1.6;
	overflow-x: hidden;
}

/* ===== MAIN LAYOUT ===== */
main {
	height: 100vh;
	min-height: 700px;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	padding: 20px;
}

.container {
	width: 100%;
	max-width: 480px;
	text-align: center;
	background: var(--card-bg);
	border-radius: var(--border-radius-large);
	box-shadow: var(--shadow-heavy);
	padding: 40px 30px;
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.container::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(
		90deg,
		var(--accent-primary),
		var(--accent-secondary)
	);
}

/* ===== SERIAL NUMBER DISPLAY ===== */
.serial {
	font-size: 1rem;
	font-weight: 500;
	background: rgba(255, 255, 255, 0.05);
	padding: 24px;
	border-radius: var(--border-radius);
	text-align: left;
	border: 1px solid rgba(255, 255, 255, 0.1);
	transition: var(--transition);
	position: relative;
	margin-bottom: 24px;
	backdrop-filter: blur(10px);
}

.serial:focus-within {
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.serial::before {
	content: "🔐";
	position: absolute;
	top: -12px;
	left: 16px;
	background: var(--card-bg);
	padding: 0 8px;
	font-size: 0.9rem;
}

.serial span {
	color: var(--success-color);
	font-size: 1.1rem;
	margin-left: 8px;
	font-weight: 600;
	font-family: "JetBrains Mono", "Fira Code", monospace;
	letter-spacing: 1.5px;
	text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

/* ===== COPY BUTTON ===== */
.copy {
	padding: 14px 24px;
	font-size: 0.9rem;
	background: linear-gradient(
		135deg,
		var(--accent-secondary) 0%,
		#6a4c93 100%
	);
	color: white;
	width: fit-content;
	margin: 0 auto 32px;
	border-radius: 25px;
	cursor: pointer;
	user-select: none;
	visibility: hidden;
	transition: var(--transition);
	border: none;
	font-weight: 600;
	box-shadow: var(--shadow-medium);
	position: relative;
	overflow: hidden;
}

.copy::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.6s;
}

.copy:hover::before {
	left: 100%;
}

.copy:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(83, 52, 131, 0.3);
}

.show-copy {
	visibility: visible;
	animation: slideInUp 0.5s ease-out;
}

.copy:hover,
.copy:focus {
	background: linear-gradient(
		135deg,
		#6a4c93 0%,
		var(--accent-secondary) 100%
	);
	transform: translateY(-2px);
	box-shadow: var(--shadow-heavy);
}

.copy i {
	margin-left: 8px;
	font-size: 0.85rem;
}

/* ===== GENERATE BUTTON ===== */
button {
	padding: 16px 32px;
	font-size: 1rem;
	background: linear-gradient(135deg, var(--accent-primary) 0%, #d63384 100%);
	color: white;
	border: none;
	border-radius: 25px;
	cursor: pointer;
	transition: var(--transition);
	font-weight: 600;
	box-shadow: var(--shadow-medium);
	position: relative;
	overflow: hidden;
	margin-bottom: 32px;
}

button::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.6s;
}

button:hover::before {
	left: 100%;
}

button:hover,
button:focus {
	background: linear-gradient(135deg, #d63384 0%, var(--accent-primary) 100%);
	transform: translateY(-3px);
	box-shadow: var(--shadow-heavy);
}

button:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.3);
}

button i {
	font-size: 0.9rem;
	margin-left: 8px;
	transition: transform 0.4s ease;
}

button:hover i {
	transform: rotate(180deg);
}

/* ===== COLOR PICKER ===== */
.color {
	position: absolute;
	left: 50%;
	bottom: 30px;
	transform: translateX(-50%);
	display: flex;
	gap: 12px;
	align-items: center;
	background: rgba(15, 52, 96, 0.9);
	backdrop-filter: blur(15px);
	padding: 14px 20px;
	border-radius: 25px;
	box-shadow: var(--shadow-medium);
	border: 1px solid rgba(255, 255, 255, 0.1);
	min-width: 225px;
}

.color label {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-secondary);
}

.color input[type="color"] {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: var(--shadow-light);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border: 1.5px solid #fff;
}

.color input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
	border-radius: 50%;
}

.color input[type="color"]::-webkit-color-swatch {
	border: none;
	border-radius: 50%;
}

.color input[type="color"]::-moz-color-swatch {
	border: none;
	border-radius: 50%;
}

.color input[type="color"]:hover {
	transform: scale(1.1);
	box-shadow: var(--shadow-medium);
}

.color input[type="color"]:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.3);
}

/* ===== FOOTER ===== */
footer {
	background: rgba(15, 52, 96, 0.95);
	backdrop-filter: blur(15px);
	padding: 20px;
	text-align: center;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
	margin-bottom: 8px;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--text-secondary);
}

footer a {
	color: var(--accent-primary);
	text-decoration: none;
	font-weight: 600;
	transition: var(--transition);
	position: relative;
}

footer a::after {
	content: "";
	position: absolute;
	width: 0;
	height: 2px;
	bottom: -2px;
	left: 0;
	background: var(--accent-primary);
	transition: width 0.3s ease;
}

footer a:hover::after,
footer a:focus::after {
	width: 100%;
}

footer a:hover,
footer a:focus {
	color: #ff6b9d;
}

footer a:focus {
	outline: none;
}

footer span {
	font-size: 0.75rem;
	opacity: 0.7;
	font-style: italic;
	color: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.container {
	animation: fadeIn 0.8s ease-out;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
	main {
		padding: 15px;
	}

	.container {
		padding: 30px 20px;
		border-radius: 16px;
	}

	.serial {
		font-size: 0.95rem;
		padding: 20px;
	}

	.serial span {
		font-size: 1rem;
	}

	.copy {
		font-size: 0.85rem;
		padding: 12px 20px;
	}

	button {
		font-size: 0.95rem;
		padding: 14px 28px;
	}

	.color {
		bottom: 20px;
		padding: 12px 16px;
		gap: 10px;
	}

	.color label {
		font-size: 0.8rem;
	}

	.color input[type="color"] {
		width: 28px;
		height: 28px;
	}

	footer {
		padding: 15px 10px;
	}

	footer p {
		font-size: 0.8rem;
	}

	footer span {
		font-size: 0.7rem;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 25px 15px;
	}

	.serial {
		padding: 18px;
		font-size: 0.9rem;
	}

	.serial span {
		font-size: 0.95rem;
	}

	button {
		padding: 12px 24px;
		font-size: 0.9rem;
	}
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	:root {
		--text-primary: #ffffff;
		--text-secondary: #cccccc;
		--card-bg: #000000;
	}

	.serial,
	.copy,
	button,
	footer {
		border: 2px solid #ffffff;
	}

	.serial span {
		color: #00ff00;
		font-weight: 700;
	}
}
