/* ═══════════════════════════════════════════
   BASE 3D DRUCK QUE — Dark Purple / Magenta Theme
   ═══════════════════════════════════════════ */

:root {
	/* Background — inspired by logo (#0A0210, #180924) */
	--bg-primary: #0a0210;
	--bg-secondary: #0d0518;
	--bg-card: #120722;
	--bg-card-hover: #1a0c30;
	--bg-nav: rgba(10, 2, 16, 0.92);
	--bg-form: rgba(18, 7, 34, 0.7);
	--bg-overlay: rgba(0, 0, 0, 0.5);

	/* Accent Colors — from logo analysis */
	--magenta: #d58dd8;
	--magenta-bright: #ebaee3;
	--magenta-dark: #a667ce;
	--pink: #e592d8;
	--purple: #9a5ba6;
	--purple-deep: #271332;

	/* Accent dim variants */
	--magenta-dim: rgba(213, 141, 216, 0.15);
	--magenta-glow: rgba(213, 141, 216, 0.08);
	--purple-dim: rgba(166, 103, 206, 0.15);

	/* Gradients */
	--gradient-hero: linear-gradient(135deg, rgba(213, 141, 216, 0.12), rgba(166, 103, 206, 0.12));
	--gradient-accent: linear-gradient(135deg, var(--magenta), var(--purple));
	--gradient-btn: linear-gradient(135deg, var(--magenta), var(--magenta-dark));

	/* Text */
	--text-primary: #e8dff0;
	--text-secondary: #b0a0c8;
	--text-muted: #605070;
	--text-accent: var(--magenta-bright);

	/* Borders */
	--border-subtle: rgba(213, 141, 216, 0.08);
	--border-card: rgba(213, 141, 216, 0.12);
	--border-accent: rgba(213, 141, 216, 0.3);
	--border-input: rgba(213, 141, 216, 0.2);
	--border-input-focus: rgba(213, 141, 216, 0.5);

	/* Spacing */
	--nav-height: 64px;
	--max-width: 1120px;
	--radius: 12px;
	--radius-lg: 20px;
	--radius-full: 9999px;

	/* Typography */
	--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	/* Shadows */
	--shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
	--shadow-glow: 0 0 30px rgba(213, 141, 216, 0.1);
}

/* ═══ RESET ═══ */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-body);
	background: var(--bg-primary);
	color: var(--text-primary);
	line-height: 1.7;
	min-height: 100vh;
	overflow-x: hidden;
}

/* Subtle purple background grid */
body::before {
	content: '';
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background-image:
		linear-gradient(rgba(213, 141, 216, 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(213, 141, 216, 0.03) 1px, transparent 1px);
	background-size: 60px 60px;
	pointer-events: none;
	z-index: 0;
}

/* Purple ambient glow */
body::after {
	content: '';
	position: fixed;
	top: -30%;
	right: -20%;
	width: 60%;
	height: 60%;
	background: radial-gradient(ellipse, rgba(213, 141, 216, 0.04), transparent 70%);
	pointer-events: none;
	z-index: 0;
}

/* ═══ NAVIGATION ═══ */
nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nav-height);
	background: var(--bg-nav);
	border-bottom: 1px solid var(--border-subtle);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	z-index: 100;
}

.nav-inner {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 1.5rem;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text-primary);
	text-decoration: none;
	font-weight: 700;
	font-size: 1.15rem;
	transition: color 0.2s;
}

.logo:hover {
	color: var(--magenta-bright);
}

.logo-icon {
	color: var(--magenta);
	font-size: 1.3rem;
}

.nav-count {
	color: var(--text-muted);
	font-size: 0.85rem;
}

/* ═══ HERO ═══ */
.hero {
	padding: 7rem 1.5rem 3rem;
	text-align: center;
	background: var(--gradient-hero);
	border-bottom: 1px solid var(--border-subtle);
	position: relative;
	z-index: 1;
}

.hero-content {
	max-width: 700px;
	margin: 0 auto;
}

.hero h1 {
	font-size: 2.8rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 0.75rem;
	background: var(--gradient-accent);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.hero h1 .accent {
	-webkit-text-fill-color: var(--magenta-bright);
}

.hero-subtitle {
	color: var(--text-secondary);
	font-size: 1.2rem;
	margin-bottom: 0.75rem;
}

.hero-desc {
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
}

/* ═══ FORM ═══ */
.form-section {
	padding: 2rem 1.5rem;
	position: relative;
	z-index: 1;
}

.form-card {
	max-width: 640px;
	margin: 0 auto;
	background: var(--bg-form);
	border: 1px solid var(--border-card);
	border-radius: var(--radius-lg);
	padding: 2rem;
	text-align: center;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.form-icon {
	font-size: 2rem;
	margin-bottom: 0.5rem;
}

.form-card h2 {
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 1.25rem;
	color: var(--text-primary);
}

.link-form {
	width: 100%;
}

.input-group {
	display: flex;
	gap: 0.75rem;
	width: 100%;
}

.input-group input {
	flex: 1;
	padding: 0.85rem 1.2rem;
	background: var(--bg-primary);
	border: 1px solid var(--border-input);
	border-radius: var(--radius);
	color: var(--text-primary);
	font-size: 1rem;
	font-family: var(--font-body);
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
	border-color: var(--border-input-focus);
	box-shadow: 0 0 0 3px var(--magenta-dim);
}

.input-group input::placeholder {
	color: var(--text-muted);
}

.input-group button {
	padding: 0.85rem 1.75rem;
	background: var(--gradient-btn);
	border: none;
	border-radius: var(--radius);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.15s;
	white-space: nowrap;
	font-family: var(--font-body);
}

.input-group button:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.input-group button:active {
	transform: translateY(0);
}

.input-group button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.form-hint {
	margin-top: 0.75rem;
	color: var(--text-muted);
	font-size: 0.85rem;
	transition: color 0.3s;
}

.form-hint.error {
	color: #ff6b8a;
}

.form-hint.success {
	color: var(--magenta-bright);
}

/* ═══ LINKS SECTION ═══ */
.links-section {
	padding: 1rem 1.5rem 4rem;
	max-width: var(--max-width);
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	gap: 1rem;
}

.section-header h2 {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.accent-line {
	display: inline-block;
	width: 3px;
	height: 1.2em;
	background: var(--gradient-accent);
	border-radius: 2px;
}

.count-badge {
	background: var(--magenta-dim);
	color: var(--magenta-bright);
	padding: 0.3rem 0.85rem;
	border-radius: var(--radius-full);
	font-size: 0.8rem;
	font-weight: 600;
}

/* ═══ LINK GRID ═══ */
.link-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 1.25rem;
}

.link-card {
	position: relative;
	background: var(--bg-card);
	border: 1px solid var(--border-card);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.link-card:hover {
	transform: translateY(-3px);
	border-color: var(--border-accent);
	box-shadow: var(--shadow-card), var(--shadow-glow);
}

.link-card-inner {
	display: block;
	text-decoration: none;
	color: inherit;
}

.card-img {
	width: 100%;
	height: 200px;
	overflow: hidden;
	background: var(--bg-secondary);
	position: relative;
}

.card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.link-card:hover .card-img img {
	transform: scale(1.05);
}

.card-img.img-failed {
	display: none;
}

.card-body {
	padding: 1.25rem;
}

.card-favicon {
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 0.5rem;
	border-radius: 2px;
}

.card-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	line-height: 1.4;
	display: inline;
}

.card-title:hover {
	color: var(--magenta-bright);
}

.card-desc {
	color: var(--text-secondary);
	font-size: 0.88rem;
	line-height: 1.5;
	margin-top: 0.5rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-footer {
	margin-top: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.card-url {
	color: var(--text-muted);
	font-size: 0.78rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.card-date {
	color: var(--text-muted);
	font-size: 0.75rem;
}

/* Delete button */
.card-delete {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--text-muted);
	font-size: 1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s, background 0.2s, color 0.2s;
	line-height: 1;
}

.link-card:hover .card-delete {
	opacity: 1;
}

.card-delete:hover {
	background: rgba(255, 107, 138, 0.2);
	color: #ff6b8a;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
	text-align: center;
	padding: 4rem 2rem;
	color: var(--text-muted);
}

.empty-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
}

.empty-state h3 {
	font-size: 1.2rem;
	color: var(--text-secondary);
	margin-bottom: 0.5rem;
}

.empty-state p {
	font-size: 0.9rem;
}

/* ═══ FOOTER ═══ */
footer {
	text-align: center;
	padding: 2rem;
	color: var(--text-muted);
	font-size: 0.85rem;
	border-top: 1px solid var(--border-subtle);
}

.footer-accent {
	color: var(--magenta);
	margin-right: 0.25rem;
}

/* ═══ TOAST ═══ */
.toast-container {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	padding: 0.85rem 1.25rem;
	border-radius: var(--radius);
	background: var(--bg-card);
	border: 1px solid var(--border-card);
	color: var(--text-primary);
	font-size: 0.9rem;
	box-shadow: var(--shadow-card);
	animation: toastIn 0.3s ease;
	max-width: 400px;
}

.toast.error {
	border-color: rgba(255, 107, 138, 0.3);
	color: #ff6b8a;
}

.toast.success {
	border-color: var(--border-accent);
	color: var(--magenta-bright);
}

@keyframes toastIn {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
	.hero h1 {
		font-size: 2rem;
	}

	.hero {
		padding: 6rem 1rem 2rem;
	}

	.input-group {
		flex-direction: column;
	}

	.input-group button {
		width: 100%;
	}

	.link-grid {
		grid-template-columns: 1fr;
	}

	.card-img {
		height: 160px;
	}

	.form-card {
		padding: 1.5rem;
	}

	.toast-container {
		left: 1rem;
		right: 1rem;
		bottom: 1rem;
	}
}

@media (max-width: 480px) {
	.hero h1 {
		font-size: 1.7rem;
	}

	.nav-inner {
		padding: 0 1rem;
	}

	.links-section {
		padding: 0.5rem 1rem 3rem;
	}
}
