/* PIN Generator — Teal & Navy theme */

.pgn-app {
	--pgn-navy-950: #0a1120;
	--pgn-navy-900: #0f172a;
	--pgn-navy-850: #131f36;
	--pgn-navy-800: #16223b;
	--pgn-navy-700: #1e2c4a;
	--pgn-teal-300: #5eead4;
	--pgn-teal-400: #2dd4bf;
	--pgn-teal-500: #14b8a6;
	--pgn-teal-600: #0d9488;
	--pgn-text-soft: #94a3b8;
	--pgn-text-faint: #4c5c7a;
	--pgn-red-400: #f87171;

	max-width: 1020px;
	margin: 2rem auto;
	border-radius: 22px;
	overflow: hidden;
	background: var(--pgn-navy-900);
	box-shadow:
		0 25px 55px -15px rgba(10, 17, 32, 0.6),
		0 0 0 1px rgba(45, 212, 191, 0.12);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

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

/* ---------- Header ---------- */

.pgn-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.75rem 2rem;
	background: linear-gradient(120deg, var(--pgn-navy-900) 0%, var(--pgn-teal-600) 160%);
	border-bottom: 2px solid rgba(45, 212, 191, 0.4);
}

.pgn-header-icon {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--pgn-teal-400), var(--pgn-teal-600));
	color: var(--pgn-navy-950);
	font-size: 1.6rem;
	font-weight: 800;
	box-shadow: 0 8px 20px -6px rgba(20, 184, 166, 0.6);
}

.pgn-header-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 800;
	color: #f8fafc;
	letter-spacing: -0.01em;
}

.pgn-header-subtitle {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--pgn-teal-300);
}

/* ---------- Columns ---------- */

.pgn-columns {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
}

.pgn-main {
	padding: 1.75rem 2rem;
	border-right: 1px solid rgba(94, 234, 212, 0.1);
}

.pgn-sidebar {
	padding: 1.75rem 1.5rem;
	background: rgba(15, 23, 42, 0.4);
	display: flex;
	flex-direction: column;
}

/* ---------- Field basics ---------- */

.pgn-field-label,
.pgn-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--pgn-teal-300);
	margin-bottom: 0.5rem;
}

.pgn-field {
	margin-bottom: 1.1rem;
}

.pgn-input {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border-radius: 12px;
	border: 1px solid rgba(94, 234, 212, 0.18);
	background: var(--pgn-navy-800);
	color: #f1f5f9;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pgn-input::placeholder {
	color: #506080;
	font-weight: 500;
}

.pgn-input:focus {
	border-color: var(--pgn-teal-400);
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

/* ---------- Length chips ---------- */

.pgn-length-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.1rem;
}

.pgn-chip {
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	border: 1px solid rgba(94, 234, 212, 0.2);
	background: var(--pgn-navy-800);
	color: var(--pgn-text-soft);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pgn-chip:hover {
	border-color: rgba(94, 234, 212, 0.5);
	color: #e2e8f0;
}

.pgn-chip.is-active {
	background: linear-gradient(135deg, var(--pgn-teal-400), var(--pgn-teal-600));
	color: var(--pgn-navy-950);
	border-color: transparent;
	box-shadow: 0 6px 16px -6px rgba(20, 184, 166, 0.6);
}

/* ---------- Options ---------- */

.pgn-options {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-bottom: 1.1rem;
}

.pgn-checkbox {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 0.85rem;
	color: var(--pgn-text-soft);
	cursor: pointer;
	user-select: none;
}

.pgn-checkbox input {
	width: 17px;
	height: 17px;
	accent-color: var(--pgn-teal-500);
	cursor: pointer;
	flex-shrink: 0;
}

/* ---------- Error ---------- */

.pgn-error {
	margin-bottom: 1.1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 10px;
	background: rgba(220, 38, 38, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.3);
	color: #fca5a5;
	font-size: 0.85rem;
	line-height: 1.5;
}

/* ---------- Generate button ---------- */

.pgn-generate-btn {
	display: block;
	width: 100%;
	padding: 0.85rem;
	border: none;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--pgn-teal-400), var(--pgn-teal-600));
	color: var(--pgn-navy-950);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 10px 24px -8px rgba(20, 184, 166, 0.6);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	margin-bottom: 1.25rem;
}

.pgn-generate-btn:hover {
	box-shadow: 0 12px 28px -8px rgba(20, 184, 166, 0.75);
}

.pgn-generate-btn:active {
	transform: scale(0.98);
}

/* ---------- Result panel ---------- */

.pgn-result-panel {
	padding: 1.25rem;
	border-radius: 16px;
	background: rgba(30, 44, 74, 0.4);
	border: 1px solid rgba(94, 234, 212, 0.3);
}

.pgn-result-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.pgn-result-badge {
	display: inline-block;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: rgba(45, 212, 191, 0.15);
	border: 1px solid rgba(94, 234, 212, 0.3);
	color: var(--pgn-teal-300);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.05em;
}

.pgn-copy-btn {
	padding: 0.4rem 0.85rem;
	border-radius: 9px;
	border: 1px solid rgba(94, 234, 212, 0.3);
	background: transparent;
	color: var(--pgn-teal-300);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pgn-copy-btn:hover {
	background: rgba(45, 212, 191, 0.1);
}

.pgn-copy-btn.is-copied {
	background: rgba(45, 212, 191, 0.22);
}

.pgn-result-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	max-height: 260px;
	overflow-y: auto;
}

.pgn-result-single {
	font-size: 2.1rem;
	font-weight: 800;
	color: var(--pgn-teal-300);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.05em;
	text-shadow: 0 0 18px rgba(45, 212, 191, 0.25);
}

.pgn-pin-chip {
	padding: 0.5rem 0.85rem;
	border-radius: 9px;
	background: var(--pgn-navy-800);
	border: 1px solid rgba(94, 234, 212, 0.15);
	color: #f1f5f9;
	font-size: 1rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

/* ---------- Sidebar: history ---------- */

.pgn-sidebar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.9rem;
}

.pgn-sidebar-title {
	font-size: 1.05rem;
	font-weight: 800;
	color: #f1f5f9;
}

.pgn-history-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: rgba(45, 212, 191, 0.15);
	border: 1px solid rgba(94, 234, 212, 0.3);
	color: var(--pgn-teal-300);
	font-size: 0.75rem;
	font-weight: 800;
}

.pgn-search {
	width: 100%;
	padding: 0.6rem 0.8rem;
	margin-bottom: 0.55rem;
	border-radius: 10px;
	border: 1px solid rgba(94, 234, 212, 0.15);
	background: var(--pgn-navy-800);
	color: #f1f5f9;
	font-family: inherit;
	font-size: 0.85rem;
	outline: none;
}

.pgn-search::placeholder {
	color: #506080;
}

.pgn-search:focus {
	border-color: var(--pgn-teal-400);
}

.pgn-filter {
	width: 100%;
	padding: 0.55rem 0.7rem;
	margin-bottom: 1rem;
	border-radius: 10px;
	border: 1px solid rgba(94, 234, 212, 0.15);
	background: var(--pgn-navy-800);
	color: #cbd5e1;
	font-family: inherit;
	font-size: 0.82rem;
	cursor: pointer;
	outline: none;
}

.pgn-history-list {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	max-height: 360px;
	overflow-y: auto;
	margin-bottom: 1.25rem;
}

.pgn-history-empty {
	font-size: 0.82rem;
	color: var(--pgn-text-faint);
	font-style: italic;
	text-align: center;
	padding: 1rem 0;
}

.pgn-history-card {
	position: relative;
	padding: 0.85rem 2rem 0.85rem 0.9rem;
	border-radius: 12px;
	background: var(--pgn-navy-800);
	border: 1px solid rgba(94, 234, 212, 0.15);
}

.pgn-history-tag {
	display: inline-block;
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pgn-teal-300);
	margin-bottom: 0.35rem;
}

.pgn-history-pins {
	font-size: 0.88rem;
	font-weight: 700;
	color: #f1f5f9;
	font-variant-numeric: tabular-nums;
	word-break: break-word;
	line-height: 1.5;
}

.pgn-history-time {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.7rem;
	color: var(--pgn-text-faint);
}

.pgn-history-remove {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	border: none;
	background: transparent;
	color: var(--pgn-text-faint);
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.pgn-history-remove:hover {
	background: rgba(220, 38, 38, 0.15);
	color: var(--pgn-red-400);
}

/* ---------- Export ---------- */

.pgn-export-title {
	display: block;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pgn-text-faint);
	margin-bottom: 0.6rem;
}

.pgn-export-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.pgn-export-btn {
	padding: 0.55rem 0.5rem;
	border-radius: 9px;
	border: 1px solid rgba(94, 234, 212, 0.25);
	background: var(--pgn-navy-800);
	color: var(--pgn-teal-300);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.pgn-export-btn:hover {
	background: var(--pgn-navy-700);
	border-color: rgba(94, 234, 212, 0.5);
}

.pgn-clear-btn {
	width: 100%;
	padding: 0.6rem;
	border-radius: 10px;
	border: 1px solid rgba(248, 113, 113, 0.35);
	background: transparent;
	color: var(--pgn-red-400);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pgn-clear-btn:hover {
	background: rgba(220, 38, 38, 0.12);
}

@media (max-width: 800px) {
	.pgn-columns {
		grid-template-columns: 1fr;
	}
	.pgn-main {
		border-right: none;
		border-bottom: 1px solid rgba(94, 234, 212, 0.1);
	}
}
