/* Tedzi Market — vanilla CSS, no framework. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
	--accent: #4f46e5;
	--accent-dark: #3730a3;
	--accent-soft: #eef0ff;
	--text: #1a1d24;
	--text-muted: #6b7280;
	--bg: #fafbff;
	--surface: #ffffff;
	--surface-alt: #f4f6fa;
	--border: #e2e5ee;
	--shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 8px 24px rgba(79, 70, 229, .06);
	--radius: 12px;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky; top: 0; z-index: 10;
}
.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 20px;
}
.brand {
	display: flex; align-items: center; gap: 10px;
	font-weight: 700; font-size: 18px; color: var(--text);
	text-decoration: none;
}
.brand-mark { font-size: 24px; }
.brand-sub { color: var(--accent); font-weight: 600; }
.lang-switch select {
	border: 1px solid var(--border); border-radius: 8px;
	padding: 6px 10px; font-size: 14px; background: var(--surface);
	color: var(--text); cursor: pointer;
}

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

/* ── Hero ── */
.hero {
	background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, #ec4899 100%);
	color: white;
	padding: 56px 0 64px;
	text-align: center;
}
.hero h1 {
	font-size: clamp(28px, 5vw, 42px);
	margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em;
}
.hero-sub {
	font-size: clamp(15px, 2vw, 18px);
	max-width: 540px; margin: 0 auto; opacity: .94;
}

/* ── Filters ── */
.filters {
	display: grid; gap: 10px;
	grid-template-columns: 1fr;
	margin: -28px 0 28px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	position: relative; z-index: 2;
}
@media (min-width: 720px) {
	.filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.filters input,
.filters select {
	border: 1px solid var(--border); border-radius: 8px;
	padding: 10px 12px; font-size: 14px; background: var(--surface);
	color: var(--text);
}
.filters input:focus,
.filters select:focus {
	outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}

.result-count { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

/* ── Card grid ── */
.card-grid {
	display: grid; gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	margin-bottom: 60px;
}
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 18px 16px;
	cursor: pointer;
	transition: transform .15s, box-shadow .15s, border-color .15s;
	display: flex; flex-direction: column; gap: 6px;
}
.card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow); border-color: var(--accent);
}
.card-tool {
	font-size: 11px; font-weight: 700; color: var(--accent);
	text-transform: uppercase; letter-spacing: .04em;
}
.card-title { font-size: 17px; font-weight: 700; line-height: 1.3; margin: 2px 0 4px; }
.card-meta { color: var(--text-muted); font-size: 13px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
	background: var(--accent-soft); color: var(--accent-dark);
	font-size: 11px; padding: 2px 8px; border-radius: 999px;
}
.diff-beginner { color: #047857; }
.diff-intermediate { color: #b45309; }
.diff-advanced { color: #b91c1c; }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* ── Detail view ── */
.detail-wrap { padding: 32px 0 60px; }
.back-btn {
	background: transparent; border: 0; color: var(--accent);
	font-size: 14px; cursor: pointer; padding: 0; margin-bottom: 18px;
}
.back-btn:hover { text-decoration: underline; }
.detail-card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 28px;
}
.detail-card h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; }
.detail-card .detail-tool {
	font-size: 12px; font-weight: 700; color: var(--accent);
	text-transform: uppercase; letter-spacing: .04em;
}
.detail-meta {
	display: flex; flex-wrap: wrap; gap: 18px;
	margin: 20px 0; padding: 14px; background: var(--surface-alt); border-radius: 8px;
	font-size: 14px;
}
.detail-meta div { color: var(--text-muted); }
.detail-meta strong { color: var(--text); display: block; margin-bottom: 2px; }
.detail-section { margin: 24px 0; }
.detail-section h3 { font-size: 16px; margin: 0 0 10px; }
.preview-table {
	width: 100%; border-collapse: collapse; font-size: 14px;
	background: var(--surface-alt); border-radius: 8px; overflow: hidden;
}
.preview-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.preview-table tr:last-child td { border-bottom: 0; }
.preview-table td:first-child { font-weight: 600; color: var(--accent); }

.btn-primary {
	display: inline-block;
	background: var(--accent); color: white !important;
	padding: 12px 22px; border-radius: 8px;
	font-size: 15px; font-weight: 600;
	text-decoration: none; border: 0; cursor: pointer;
	transition: background .15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
	display: inline-block;
	background: var(--surface-alt); color: var(--text);
	padding: 12px 22px; border-radius: 8px;
	font-size: 15px; font-weight: 600;
	text-decoration: none; border: 1px solid var(--border); cursor: pointer;
	margin-left: 8px;
}

/* ── Submit page ── */
.submit-steps { padding-left: 22px; }
.submit-steps li { margin-bottom: 10px; }
.submit-steps code {
	background: var(--surface-alt); padding: 1px 6px; border-radius: 4px;
	font-size: 13px;
}
.submit-note {
	margin-top: 24px; padding: 12px; background: var(--surface-alt);
	border-radius: 8px; font-size: 13px; color: var(--text-muted);
}

/* ── Footer ── */
.site-footer {
	background: var(--surface); border-top: 1px solid var(--border);
	padding: 24px 0;
	margin-top: 40px;
}
.footer-links {
	text-align: center; margin: 0 0 10px;
	font-size: 14px; color: var(--text-muted);
}
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-credit {
	text-align: center; margin: 0; font-size: 12px; color: var(--text-muted);
}
.footer-credit a { color: var(--accent); text-decoration: none; }

/* ── Card badges (featured / new) ── */
.card { position: relative; }
.card-badges {
	position: absolute; top: 12px; right: 12px;
	display: flex; gap: 4px;
}
.card-badge {
	font-size: 10px; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase;
	padding: 3px 7px; border-radius: 999px;
}
.badge-featured { background: #fef3c7; color: #92400e; }
.badge-new { background: #dcfce7; color: #15803d; }

/* ── Language pair pill (card + detail) ── */
.lang-pair {
	display: inline-flex; align-items: center; gap: 4px;
	background: var(--surface-alt);
	padding: 4px 10px; border-radius: 999px;
	font-size: 13px; font-weight: 600;
	margin: 4px 0;
	width: fit-content;
}
.lang-pair .flag { font-size: 16px; line-height: 1; }
.lang-pair .code {
	color: var(--accent-dark); letter-spacing: .03em;
}
.lang-pair .lang-arrow {
	color: var(--text-muted); font-size: 14px;
	margin: 0 4px;
}
.detail-langpair {
	margin-top: 14px;
	display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
}
.detail-langpair .lang-pair { font-size: 16px; padding: 8px 14px; }
.detail-langpair small { color: var(--text-muted); font-size: 13px; }
