/* style.css - CSS for changelog page */
/**
 * Author: SFPD Team
 * Date: 25-03-2026
 * License: sfpd.site - Changelog is licensed under the MIT License. See LICENSE file for details.
 * Version: 1.0
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Fragment+Mono&display=swap');

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

:root {
	--ink: #0b0e14;
	--card: #12161f;
	--card2: #151a24;
	--border: rgba(255, 255, 255, 0.055);
	--border2: rgba(255, 255, 255, 0.11);
	--cyan: #00d4ff;
	--cyan-dim: rgba(0, 212, 255, 0.12);
	--cyan-glow: rgba(0, 212, 255, 0.06);
	--amber: #f5a623;
	--amber-dim: rgba(245, 166, 35, 0.12);
	--green: #39ff87;
	--green-dim: rgba(57, 255, 135, 0.1);
	--red: #ff4560;
	--red-dim: rgba(255, 69, 96, 0.1);
	--text: #c8d6e8;
	--muted: #4a5568;
	--ghost: #2a3345;
	--mono: 'Fragment Mono', monospace;
	--sans: 'Space Grotesk', sans-serif;
}

body {
	background: var(--ink);
	color: var(--text);
	font-family: var(--sans);
	overflow-x: hidden;
}

body::before {
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.08) 2px, rgba(0, 0, 0, 0.08) 4px);
	z-index: 0;
	opacity: 0.4;
}

.changelog-wrapper {
	position: relative;
	z-index: 1;
	max-width: 860px;
	margin: 0 auto;
	padding: 52px 28px 72px;
}

/* ── Terminal topbar ── */
.topbar {
	display: flex;
	align-items: center;
	margin-bottom: 48px;
	border: 1px solid var(--border2);
	border-radius: 10px;
	overflow: hidden;
	background: var(--card);
}
.tb-dots {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 13px 16px;
	border-right: 1px solid var(--border);
}
.tb-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
}
.tb-dot.r {
	background: #ff5f57;
}
.tb-dot.y {
	background: #febc2e;
}
.tb-dot.g {
	background: #28c840;
}
.tb-path {
	flex: 1;
	padding: 13px 18px;
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--muted);
}
.tb-path span {
	color: var(--cyan);
}
.tb-status {
	padding: 13px 18px;
	font-family: var(--mono);
	font-size: 0.7rem;
	color: var(--muted);
	border-left: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 8px;
}
.status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green);
	animation: blink 1.4s step-end infinite;
}
@keyframes blink {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0;
	}
}

/* ── Header ── */
.changelog-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	gap: 24px;
	margin-bottom: 44px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--border);
}
.sys-label {
	font-family: var(--mono);
	font-size: 0.62rem;
	color: var(--cyan);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin-bottom: 10px;
	opacity: 0.8;
}
.changelog-title {
	font-size: 2.4rem;
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1;
	color: #e8f0fc;
}
.changelog-title em {
	font-style: normal;
	color: var(--cyan);
}
.changelog-meta-stats {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}
.stat-line {
	font-family: var(--mono);
	font-size: 0.68rem;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 8px;
}
.stat-line .val {
	color: var(--text);
	font-weight: 500;
}
.stat-line .tag {
	color: var(--green);
}

/* ── Filter ── */
.filter-row {
	display: flex;
	gap: 8px;
	margin-bottom: 28px;
	flex-wrap: wrap;
}
.f-btn {
	font-family: var(--mono);
	font-size: 0.65rem;
	padding: 5px 14px;
	border-radius: 20px;
	border: 1px solid var(--border2);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: all 0.18s;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.f-btn:hover,
.f-btn.active {
	border-color: var(--cyan);
	color: var(--cyan);
	background: var(--cyan-dim);
}

/* ── Timeline ── */
.changelog-timeline {
	position: relative;
	padding-left: 42px;
}
.changelog-timeline::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 0;
	bottom: 0;
	width: 1px;
	background: linear-gradient(180deg, var(--cyan) 0%, var(--border) 60%, transparent 100%);
}

.changelog-entry {
	position: relative;
	margin-bottom: 6px;
	animation: slidein 0.45s ease both;
}
.changelog-entry:nth-child(1) {
	animation-delay: 0.06s;
}
.changelog-entry:nth-child(2) {
	animation-delay: 0.14s;
}
.changelog-entry:nth-child(3) {
	animation-delay: 0.22s;
}
.changelog-entry:nth-child(4) {
	animation-delay: 0.3s;
}
.changelog-entry:nth-child(5) {
	animation-delay: 0.38s;
}
@keyframes slidein {
	from {
		opacity: 0;
		transform: translateX(-8px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.tl-node {
	position: absolute;
	left: -34px;
	top: 19px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid var(--border2);
	background: var(--ink);
	transition: all 0.2s;
	z-index: 2;
}
.changelog-entry:first-child .tl-node {
	border-color: var(--cyan);
}
.changelog-entry.open .tl-node {
	background: var(--cyan);
	border-color: var(--cyan);
	box-shadow: 0 0 14px rgba(0, 212, 255, 0.5);
}
.changelog-entry:not(.open):hover .tl-node {
	border-color: var(--cyan);
}

.entry-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.changelog-entry.open .entry-card {
	border-color: rgba(0, 212, 255, 0.2);
	box-shadow:
		0 0 0 1px rgba(0, 212, 255, 0.06),
		0 12px 40px rgba(0, 0, 0, 0.5);
}
.changelog-entry:not(.open):hover .entry-card {
	border-color: var(--border2);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.entry-hdr {
	padding: 0;
	cursor: pointer;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: stretch;
	user-select: none;
}
.eh-left {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
}
.eh-right {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-left: 1px solid var(--border);
}

.commit-hash {
	font-family: var(--mono);
	font-size: 0.62rem;
	color: var(--cyan);
	background: var(--cyan-glow);
	border: 1px solid rgba(0, 212, 255, 0.15);
	padding: 4px 10px;
	border-radius: 6px;
	letter-spacing: 0.05em;
	flex-shrink: 0;
}
.entry-date {
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--text);
	display: block;
}
.entry-author {
	font-family: var(--mono);
	font-size: 0.64rem;
	color: var(--muted);
	display: block;
	margin-top: 2px;
}
.entry-author span {
	color: var(--amber);
}

.badges {
	display: flex;
	gap: 6px;
	align-items: center;
}
.badge {
	font-family: var(--mono);
	font-size: 0.58rem;
	font-weight: 500;
	padding: 3px 9px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.badge.latest {
	background: var(--green-dim);
	color: var(--green);
	border: 1px solid rgba(57, 255, 135, 0.25);
}
.badge.fix {
	background: var(--red-dim);
	color: var(--red);
	border: 1px solid rgba(255, 69, 96, 0.2);
}
.badge.feat {
	background: var(--cyan-dim);
	color: var(--cyan);
	border: 1px solid rgba(0, 212, 255, 0.2);
}
.badge.perf {
	background: var(--amber-dim);
	color: var(--amber);
	border: 1px solid rgba(245, 166, 35, 0.2);
}
.badge.break {
	background: rgba(255, 69, 96, 0.08);
	color: #ff7a90;
	border: 1px solid rgba(255, 69, 96, 0.2);
}

.toggle-btn {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	transition: all 0.2s;
	flex-shrink: 0;
}
.changelog-entry.open .toggle-btn {
	border-color: rgba(0, 212, 255, 0.3);
	color: var(--cyan);
	background: var(--cyan-glow);
}
.chevron {
	width: 10px;
	height: 10px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.28s;
	position: relative;
	top: -1px;
}
.changelog-entry.open .chevron {
	transform: rotate(45deg);
	top: 1px;
}
.entry-body {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.body-inner {
	border-top: 1px solid var(--border);
	background: var(--card2);
}
.diff-line {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 5px 0;
	font-family: var(--mono);
	font-size: 0.75rem;
	line-height: 1.6;
	border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}
.diff-line:last-child {
	border-bottom: none;
}
.diff-sign {
	width: 14px;
	flex-shrink: 0;
	font-weight: 700;
	margin-top: 1px;
}
.diff-line.add .diff-sign {
	color: var(--green);
}
.diff-line.fix .diff-sign {
	color: var(--red);
}
.diff-line.note .diff-sign {
	color: var(--amber);
}
.diff-line.info .diff-sign {
	color: var(--cyan);
}
.diff-text {
	color: var(--muted);
	flex: 1;
}
.diff-line.add .diff-text {
	color: #9ecfb0;
}
.diff-line.fix .diff-text {
	color: #f0909e;
}
.diff-line.note .diff-text {
	color: #c9a96e;
}
.diff-line.info .diff-text {
	color: #7fc8e0;
}
.diff-text code {
	background: rgba(255, 255, 255, 0.06);
	padding: 1px 5px;
	border-radius: 3px;
	font-size: 0.72rem;
}
.diff-block {
	padding: 18px 22px 22px;
	font-size: 14.5px;
	line-height: 1.65;
	color: var(--text);
}
.diff-block p {
	margin: 10px 0;
}
.diff-block ul {
	list-style: none;
	margin: 12px 0;
	padding: 0;
}
.diff-block li {
	position: relative;
	padding: 8px 12px 8px 34px;
	margin: 6px 0;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: 8px;
	transition: all 0.15s ease;
}
.diff-block li::before {
	content: '';
	position: absolute;
	left: 12px;
	top: 14px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #5865f2; /* accent color */
	box-shadow: 0 0 6px rgba(88, 101, 242, 0.6);
}
.diff-block li:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.12);
	transform: translateX(2px);
}
.diff-block strong {
	color: #fff;
	font-weight: 600;
}
.diff-block code {
	background: rgba(255, 255, 255, 0.06);
	padding: 2px 6px;
	border-radius: 6px;
	font-size: 13px;
}
.diff-block hr {
	border: none;
	height: 1px;
	background: var(--border);
	margin: 16px 0;
	opacity: 0.6;
}
.diff-block blockquote {
	margin: 14px 0;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.04);
	border-left: 3px solid #f09090; /* red accent */
	border-radius: 6px;
	color: #c9d1d9;
}
.diff-block blockquote p {
	margin: 0;
}

.warn-box {
	margin: 12px 0 4px;
	padding: 12px 16px;
	background: rgba(255, 69, 96, 0.07);
	border: 1px solid rgba(255, 69, 96, 0.2);
	border-radius: 6px;
	font-family: var(--mono);
	font-size: 0.72rem;
	color: #f09090;
	line-height: 1.7;
}
.warn-box .warn-label {
	color: var(--red);
	font-weight: 700;
	display: block;
	margin-bottom: 4px;
	font-size: 0.65rem;
	letter-spacing: 0.1em;
}

.footer-bar {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.footer-txt {
	font-family: var(--mono);
	font-size: 0.65rem;
	color: var(--ghost);
}
.footer-txt span {
	color: var(--muted);
}
.prompt {
	font-family: var(--mono);
	font-size: 0.7rem;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 6px;
}
.cursor-blink {
	width: 7px;
	height: 13px;
	background: var(--cyan);
	display: inline-block;
	animation: blink 1s step-end infinite;
	border-radius: 1px;
}

a {
	text-decoration: none;
	color: var(--cyan);
	transition: opacity 0.15s;
}
a:hover {
	opacity: 0.75;
	text-decoration: underline;
}
.changelog-empty {
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--muted);
	padding: 80px 0;
	text-align: center;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
	.changelog-wrapper {
		padding: 28px 14px 48px;
	}
	.changelog-timeline {
		padding-left: 28px;
	}
	.changelog-timeline::before {
		left: 8px;
	}
	.tl-node {
		left: -26px;
	}
	.toggle-btn {
		display: none;
	}
	.eh-right {
		padding: 12px 14px;
		border-left: none;
	}
	.eh-left {
		padding: 12px 14px;
		gap: 10px;
	}
	.commit-hash {
		font-size: 0.58rem;
		padding: 3px 7px;
	}
	.entry-date {
		font-size: 0.66rem;
	}
	.tb-path {
		font-size: 0.65rem;
		padding: 12px 12px;
	}
	.diff-block {
		padding: 14px 14px 18px;
	}
	.footer-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

/* Scrollbar */
::-webkit-scrollbar {
	width: 5px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: var(--border2);
	border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
	background: var(--cyan);
}
