@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
	--bg-primary: #06060a;
	--bg-secondary: rgba(15, 15, 25, 0.8);
	--bg-card: rgba(20, 20, 35, 0.6);
	--bg-input: rgba(12, 12, 22, 0.9);
	--border-subtle: rgba(255, 255, 255, 0.04);
	--border-light: rgba(255, 255, 255, 0.06);
	--border-medium: rgba(255, 255, 255, 0.1);
	--text-primary: #f0f0f5;
	--text-secondary: #8888a0;
	--text-muted: #555570;
	--accent-blue: #4d9eff;
	--accent-purple: #9d6eff;
	--accent-pink: #ff6eb0;
	--accent-amber: #ffb347;
	--accent-green: #47ffb3;
	--accent-red: #ff5c6e;
	--glow-blue: rgba(77, 158, 255, 0.15);
	--glow-purple: rgba(157, 110, 255, 0.15);
}

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

html {
	scroll-behavior: smooth;
}

body {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	line-height: 1.6;
	min-height: 100vh;
	overflow-x: hidden;
}

/* ── Ambient background ── */

.ambient-bg {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	overflow: hidden;
}

.ambient-bg::before,
.ambient-bg::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(120px);
	opacity: 0.4;
	animation: float 20s ease-in-out infinite;
}

.ambient-bg::before {
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
	top: -200px;
	left: -100px;
	animation-delay: 0s;
}

.ambient-bg::after {
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
	bottom: -150px;
	right: -100px;
	animation-delay: -10s;
}

@keyframes float {
	0%,
	100% {
		transform: translate(0, 0) scale(1);
	}
	33% {
		transform: translate(50px, -30px) scale(1.1);
	}
	66% {
		transform: translate(-30px, 50px) scale(0.95);
	}
}

/* ── Grid overlay ── */

.grid-overlay {
	position: fixed;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
	background-size: 60px 60px;
	pointer-events: none;
	z-index: 0;
	mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
	-webkit-mask-image: radial-gradient(
		ellipse at 50% 50%,
		black 30%,
		transparent 70%
	);
}

.container {
	max-width: 920px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
	position: relative;
	z-index: 1;
}

/* ── Header ── */

header {
	text-align: center;
	margin-bottom: 3rem;
	padding-top: 1.5rem;
}

header h1 {
	margin: 0;
	font-size: 3rem;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1.1;
	background: linear-gradient(
		135deg,
		#fff 0%,
		var(--accent-blue) 40%,
		var(--accent-purple) 70%,
		var(--accent-pink) 100%
	);
	background-size: 200% 200%;
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
	0%,
	100% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
}

header p {
	margin: 0.75rem 0 0;
	color: var(--text-muted);
	font-size: 1.05rem;
	font-weight: 400;
	letter-spacing: 0.01em;
}

/* ── Search box ── */

.search-box {
	background: var(--bg-card);
	backdrop-filter: blur(24px) saturate(150%);
	-webkit-backdrop-filter: blur(24px) saturate(150%);
	padding: 2rem;
	border-radius: 20px;
	margin-bottom: 2.5rem;
	border: 1px solid var(--border-subtle);
	box-shadow:
		0 0 0 1px var(--border-subtle) inset,
		0 8px 40px -8px rgba(0, 0, 0, 0.5),
		0 0 80px -20px var(--glow-blue);
	position: relative;
	overflow: hidden;
}

.search-box::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.08),
		transparent
	);
}

.row {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center;
}

.row + .row {
	margin-top: 1.25rem;
}

#query {
	flex: 1;
	min-width: 250px;
	padding: 1rem 1.25rem;
	border: 1.5px solid var(--border-light);
	border-radius: 14px;
	background: var(--bg-input);
	color: var(--text-primary);
	font-size: 1.05rem;
	font-family: inherit;
	font-weight: 400;
	outline: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) inset;
}

#query::placeholder {
	color: var(--text-muted);
	font-weight: 300;
}

#query:focus {
	border-color: var(--accent-blue);
	box-shadow:
		0 0 0 4px var(--glow-blue),
		0 2px 8px rgba(0, 0, 0, 0.2) inset;
	background: rgba(8, 8, 18, 1);
}

/* ── Buttons ── */

button {
	padding: 1rem 2rem;
	border: none;
	border-radius: 14px;
	background: linear-gradient(
		135deg,
		var(--accent-blue) 0%,
		var(--accent-purple) 100%
	);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow:
		0 4px 15px -3px rgba(77, 158, 255, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.05) inset;
	position: relative;
	overflow: hidden;
}

button::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.15) 0%,
		transparent 50%
	);
	opacity: 0;
	transition: opacity 0.3s;
}

button:hover {
	transform: translateY(-2px);
	box-shadow:
		0 8px 25px -5px rgba(77, 158, 255, 0.4),
		0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

button:hover::before {
	opacity: 1;
}

button:active {
	transform: translateY(0);
	box-shadow:
		0 2px 8px -2px rgba(77, 158, 255, 0.3),
		0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

/* ── Options row ── */

.options label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: var(--text-secondary);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.options select,
.options input[type="text"] {
	padding: 0.6rem 0.85rem;
	border: 1.5px solid var(--border-light);
	border-radius: 10px;
	background: var(--bg-input);
	color: var(--text-primary);
	font-size: 0.85rem;
	font-family: inherit;
	outline: none;
	transition: all 0.2s ease;
}

.options select {
	padding-right: 2.25rem;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666680' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.7rem center;
}

.options select:focus,
.options input[type="text"]:focus {
	border-color: var(--accent-blue);
	box-shadow: 0 0 0 3px var(--glow-blue);
}

#subreddit {
	width: 100px;
}

/* ── Toggle ── */

.toggle-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	user-select: none;
	font-size: 0.8rem;
	color: var(--text-secondary);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.toggle-label input[type="checkbox"] {
	width: 1.15rem;
	height: 1.15rem;
	accent-color: var(--accent-blue);
	cursor: pointer;
}

/* ── Filter buttons ── */

.filters {
	gap: 0.5rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border-subtle);
}

.filter-btn {
	padding: 0.5rem 1.15rem;
	border: 1.5px solid var(--border-light);
	border-radius: 100px;
	background: transparent;
	color: var(--text-secondary);
	font-size: 0.8rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: none;
}

.filter-btn:hover {
	border-color: rgba(77, 158, 255, 0.3);
	color: var(--accent-blue);
	background: var(--glow-blue);
	transform: none;
	box-shadow: none;
}

.filter-btn.active {
	background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 4px 15px -3px rgba(77, 158, 255, 0.4);
	font-weight: 600;
}

.filter-btn.active:hover {
	box-shadow: 0 6px 20px -3px rgba(77, 158, 255, 0.5);
}

/* ── Gallery button ── */

.gallery-btn {
	padding: 0.55rem 1.15rem;
	border: 1.5px solid var(--border-light);
	border-radius: 12px;
	background: transparent;
	color: var(--text-secondary);
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.25s ease;
	margin-right: auto;
	box-shadow: none;
}

.gallery-btn:hover {
	border-color: var(--accent-amber);
	color: var(--accent-amber);
	background: rgba(255, 179, 71, 0.08);
	box-shadow: none;
	transform: none;
}

.gallery-btn.active {
	border-color: var(--accent-amber);
	color: var(--accent-amber);
	background: rgba(255, 179, 71, 0.12);
	box-shadow: 0 0 20px -5px rgba(255, 179, 71, 0.3);
	animation: pulse-amber 2s ease-in-out infinite;
}

@keyframes pulse-amber {
	0%,
	100% {
		box-shadow: 0 0 20px -5px rgba(255, 179, 71, 0.3);
	}
	50% {
		box-shadow: 0 0 30px -5px rgba(255, 179, 71, 0.5);
	}
}

.gallery-btn.active:hover {
	border-color: var(--accent-red);
	color: var(--accent-red);
	background: rgba(255, 92, 110, 0.1);
}

/* ── Results ── */

#results {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* ── Post card ── */

.post {
	background: var(--bg-card);
	backdrop-filter: blur(16px) saturate(120%);
	-webkit-backdrop-filter: blur(16px) saturate(120%);
	border: 1px solid var(--border-subtle);
	border-radius: 20px;
	padding: 1.75rem;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	animation: cardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	opacity: 0;
	transform: translateY(20px);
	position: relative;
	overflow: hidden;
}

.post::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		var(--border-medium),
		transparent
	);
}

.post:nth-child(1) {
	animation-delay: 0.05s;
}
.post:nth-child(2) {
	animation-delay: 0.1s;
}
.post:nth-child(3) {
	animation-delay: 0.15s;
}
.post:nth-child(4) {
	animation-delay: 0.2s;
}
.post:nth-child(5) {
	animation-delay: 0.25s;
}
.post:nth-child(6) {
	animation-delay: 0.3s;
}
.post:nth-child(7) {
	animation-delay: 0.35s;
}
.post:nth-child(8) {
	animation-delay: 0.4s;
}
.post:nth-child(9) {
	animation-delay: 0.45s;
}
.post:nth-child(10) {
	animation-delay: 0.5s;
}

@keyframes cardAppear {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.post:hover {
	border-color: var(--border-light);
	box-shadow:
		0 20px 60px -15px rgba(0, 0, 0, 0.5),
		0 0 60px -20px var(--glow-blue);
	transform: translateY(-3px);
}

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

.post-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text-primary);
	line-height: 1.4;
	letter-spacing: -0.01em;
}

.post-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s;
}

.post-title a:hover {
	color: var(--accent-blue);
}

.post-meta {
	font-size: 0.78rem;
	color: var(--text-muted);
	margin-bottom: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

.post-meta span {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.post-body {
	background: rgba(0, 0, 0, 0.3);
	padding: 1.25rem 1.35rem;
	border-radius: 14px;
	white-space: pre-wrap;
	word-break: break-word;
	color: var(--text-secondary);
	font-size: 0.925rem;
	max-height: 400px;
	overflow-y: auto;
	line-height: 1.7;
	border: 1px solid var(--border-subtle);
}

.post-body:empty {
	display: none;
}

.post-body::-webkit-scrollbar {
	width: 5px;
}

.post-body::-webkit-scrollbar-track {
	background: transparent;
}

.post-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 10px;
}

.post-body::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.15);
}

.post-footer {
	margin-top: 1.25rem;
	font-size: 0.78rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	color: var(--text-muted);
	align-items: center;
}

.post-footer a {
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.2s;
}

.post-footer a:hover {
	color: var(--accent-blue);
}

/* ── Badges ── */

.badge {
	padding: 0.3rem 0.75rem;
	border-radius: 100px;
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	backdrop-filter: blur(8px);
}

.badge-video {
	background: rgba(71, 255, 179, 0.12);
	color: var(--accent-green);
	border: 1px solid rgba(71, 255, 179, 0.2);
}

.badge-gallery {
	background: rgba(157, 110, 255, 0.12);
	color: var(--accent-purple);
	border: 1px solid rgba(157, 110, 255, 0.2);
}

.badge-image {
	background: rgba(255, 110, 176, 0.12);
	color: var(--accent-pink);
	border: 1px solid rgba(255, 110, 176, 0.2);
}

.badge-self {
	background: rgba(136, 136, 160, 0.1);
	color: var(--text-secondary);
	border: 1px solid rgba(136, 136, 160, 0.15);
}

.badge-link {
	background: rgba(255, 179, 71, 0.12);
	color: var(--accent-amber);
	border: 1px solid rgba(255, 179, 71, 0.2);
}

.badge-redgifs {
	background: linear-gradient(
		135deg,
		rgba(255, 110, 176, 0.15),
		rgba(157, 110, 255, 0.15)
	);
	color: var(--accent-pink);
	border: 1px solid rgba(255, 110, 176, 0.25);
}

/* ── Media ── */

.media-container {
	margin-top: 1rem;
	position: relative;
	text-align: center;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--border-subtle);
}

.post-image {
	display: block;
	max-width: 100%;
	max-height: 650px;
	margin: 0 auto;
	border-radius: 14px;
	cursor: zoom-in;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-image:hover {
	transform: scale(1.005);
}

.post-video {
	display: block;
	max-width: 100%;
	max-height: 650px;
	width: 100%;
	margin: 0 auto;
	border-radius: 14px;
	background: #000;
	cursor: pointer;
}

.video-container {
	position: relative;
}

.video-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0) 0%,
		rgba(0, 0, 0, 0.6) 100%
	);
	cursor: pointer;
	transition: all 0.3s;
	border-radius: 14px;
}

.video-overlay:hover {
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.1) 0%,
		rgba(0, 0, 0, 0.7) 100%
	);
}

.video-play-icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: #fff;
	font-size: 1.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-left: 5px;
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.video-overlay:hover .video-play-icon {
	transform: scale(1.1);
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.video-hint {
	margin-top: 1rem;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.6);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	font-weight: 500;
}

/* ── Gallery grid ── */

.gallery-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	justify-content: center;
	margin-top: 0.75rem;
	padding: 0.75rem;
}

.gallery-image {
	max-width: 240px;
	max-height: 240px;
	border-radius: 12px;
	object-fit: cover;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--border-subtle);
}

.gallery-image:hover {
	transform: scale(1.05) translateY(-4px);
	border-color: rgba(77, 158, 255, 0.3);
	box-shadow:
		0 12px 32px -8px rgba(0, 0, 0, 0.6),
		0 0 40px -15px var(--glow-blue);
}

/* ── Comments ── */

.comments-container {
	margin-top: 1.25rem;
	border-top: 1px solid var(--border-subtle);
	padding-top: 1.25rem;
}

.comment {
	padding: 0.85rem 1.15rem;
	border-left: 2px solid var(--border-light);
	margin-bottom: 0.65rem;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 0 12px 12px 0;
	transition: all 0.2s;
}

.comment:hover {
	border-left-color: var(--accent-blue);
	background: rgba(0, 0, 0, 0.35);
}

.comment-meta {
	display: flex;
	gap: 0.85rem;
	font-size: 0.72rem;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
}

.comment-author {
	color: var(--accent-blue);
	font-weight: 600;
}

.comment-score {
	color: var(--accent-purple);
}

.comment-time {
	color: var(--text-muted);
}

.comment-body {
	font-size: 0.875rem;
	color: var(--text-secondary);
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.6;
}

.comment-replies {
	margin-top: 0.65rem;
}

.comments-btn {
	background: transparent;
	border: 1.5px solid var(--border-light);
	color: var(--text-secondary);
	padding: 0.45rem 1rem;
	font-size: 0.78rem;
	font-weight: 500;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: none;
	font-family: inherit;
}

.comments-btn:hover {
	border-color: var(--accent-blue);
	color: var(--accent-blue);
	background: var(--glow-blue);
	transform: none;
	box-shadow: none;
}

.comments-btn:disabled {
	opacity: 0.4;
	cursor: wait;
}

/* ── Lightbox ── */

.lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
}

.lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.97);
	backdrop-filter: blur(40px);
	-webkit-backdrop-filter: blur(40px);
}

.lightbox-content {
	position: relative;
	z-index: 1;
	max-width: 95vw;
	max-height: 95vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lb-image {
	display: block;
	max-width: 95vw;
	max-height: 90vh;
	border-radius: 12px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
	cursor: zoom-out;
	animation: lbFadeIn 0.3s ease;
}

.lb-video {
	display: block;
	max-width: 95vw;
	max-height: 90vh;
	border-radius: 12px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
	background: #000;
	animation: lbFadeIn 0.3s ease;
}

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

.lightbox-close {
	position: fixed;
	top: 1.5rem;
	right: 1.75rem;
	z-index: 2;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s;
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-close:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	transform: rotate(90deg);
}

.lightbox-nav {
	position: fixed;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.4rem;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	transform: translateY(-50%) scale(1.08);
}

.lightbox-prev {
	left: 1.5rem;
}

.lightbox-next {
	right: 1.5rem;
}

.lightbox-bottom {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	padding: 0.6rem 1.15rem;
	border-radius: 100px;
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.lb-play-btn {
	display: none;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05);
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.8rem;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}

.lb-play-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.lb-counter {
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.5);
	user-select: none;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/* ── Filmstrip ── */

.lb-filmstrip {
	position: fixed;
	bottom: 5rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	display: none;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.filmstrip-thumb {
	position: relative;
	width: 68px;
	height: 50px;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.35;
	border: 2px solid transparent;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	flex-shrink: 0;
}

.filmstrip-thumb:hover {
	opacity: 0.65;
	border-color: rgba(255, 255, 255, 0.2);
}

.filmstrip-thumb.active {
	opacity: 1;
	border-color: var(--accent-blue);
	box-shadow: 0 0 20px -5px var(--glow-blue);
}

.filmstrip-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.filmstrip-vid-icon {
	position: absolute;
	right: 4px;
	bottom: 4px;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 0.45rem;
	width: 18px;
	height: 18px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ── Load more ── */

.load-more {
	text-align: center;
	padding: 2.5rem;
}

.load-more .loading {
	color: var(--text-muted);
	font-size: 0.9rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.load-more .loading::before {
	content: "";
	width: 20px;
	height: 20px;
	border: 2px solid var(--border-light);
	border-top-color: var(--accent-blue);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

#scrollSentinel {
	height: 1px;
}

/* ── Status messages ── */

.loading {
	text-align: center;
	padding: 3rem;
	color: var(--text-muted);
	font-size: 0.95rem;
}

.error {
	background: rgba(255, 92, 110, 0.08);
	color: #ff8a9a;
	padding: 1.25rem 1.5rem;
	border-radius: 14px;
	border: 1px solid rgba(255, 92, 110, 0.15);
	font-size: 0.9rem;
}

.empty {
	text-align: center;
	padding: 4rem 2rem;
	color: var(--text-muted);
	font-size: 1rem;
}

/* ── RedGIFs container ── */

.redgifs-container {
	cursor: pointer;
	position: relative;
}

.redgifs-container .post-image {
	cursor: pointer;
}

.redgifs-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.1) 0%,
		rgba(0, 0, 0, 0.65) 100%
	);
	pointer-events: none;
	border-radius: 14px;
	transition: background 0.3s;
}

.redgifs-container:hover .redgifs-overlay {
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.15) 0%,
		rgba(0, 0, 0, 0.75) 100%
	);
}

.redgifs-play-icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: linear-gradient(
		135deg,
		rgba(255, 110, 176, 0.15),
		rgba(157, 110, 255, 0.15)
	);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: #fff;
	font-size: 1.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-left: 5px;
	border: 1.5px solid rgba(255, 110, 176, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.redgifs-container:hover .redgifs-play-icon {
	transform: scale(1.1);
	background: linear-gradient(
		135deg,
		rgba(255, 110, 176, 0.25),
		rgba(157, 110, 255, 0.25)
	);
	border-color: rgba(255, 110, 176, 0.5);
	box-shadow:
		0 12px 40px rgba(0, 0, 0, 0.4),
		0 0 40px -10px rgba(255, 110, 176, 0.25);
}

.redgifs-hint {
	margin-top: 1rem;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.6);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	font-weight: 500;
}

.meta-source-redgifs {
	color: var(--accent-pink);
	font-weight: 600;
}

/* ── Filtered out ── */

.post.filtered-out {
	display: none;
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.06);
	border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.12);
}

/* ── Selection ── */

::selection {
	background: rgba(77, 158, 255, 0.3);
	color: #fff;
}

/* ── Focus visible ── */

:focus-visible {
	outline: 2px solid var(--accent-blue);
	outline-offset: 2px;
}

/* ── Smooth page load ── */

body {
	animation: pageLoad 0.6s ease;
}

@keyframes pageLoad {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
