/* Import shared badge styles */
@import url('badges.css');

/* ═══════════════════════════════════════════════════════════════
   Notion Dark Theme Design System for Marketplace (HSL-based)
   Leveraging Notion's $2B+ design research investment
   ═══════════════════════════════════════════════════════════════ */

/* Base background */
body {
	background-color: hsl(0 0% 10%);
}

:root {
	--profile-card-border: hsl(0 0% 100% / 0.09);
	--profile-card-bg: hsl(0 0% 13%);
	--profile-card-avatar-bg: hsl(0 0% 15%);
	--profile-card-avatar-fg: hsl(0 0% 92%);
	--profile-card-name: hsl(0 0% 92%);
	--profile-card-muted: hsl(30 2% 60%);
}

/* Scrollbar */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: hsl(0 0% 100% / 0.12);
	border-radius: 10px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
	background: hsl(0 0% 100% / 0.2);
	border: 2px solid transparent;
	background-clip: padding-box;
}

/* Selection */
::selection {
	background: hsl(280 42% 53% / 0.35);
}

/* Focus ring */
*:focus-visible {
	outline: 2px solid hsl(280 42% 53%);
	outline-offset: 2px;
}

.premium-crown {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: hsl(45 93% 58%);
	font-size: 16px;
	margin-left: 4px;
}

.premium-crown--sm {
	font-size: 14px;
}
.premium-crown--xs {
	font-size: 12px;
	margin-left: 2px;
}

.premium-crown__icon {
	line-height: 1;
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

/* Code blocks */
code,
pre {
	font-family: 'SFMono-Regular', Menlo, Consolas, 'PT Mono', 'Liberation Mono',
		Courier, monospace;
}

/* Smooth transitions */
.transition-notion {
	transition: all 0.15s ease;
}

.profile-inline-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Navigation indicator initial position */
#nav-indicator {
	left: 0;
	width: 92px;
}

/* Copy modal z-index */
#copyModal {
	z-index: 60;
}

/* Navigation State */
#nav-home.active,
#nav-my-prompts.active {
	color: hsl(0 0% 92%) !important;
}
#nav-home:not(.active),
#nav-my-prompts:not(.active) {
	color: hsl(30 2% 60%) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Mobile Responsive Styles
   ═══════════════════════════════════════════════════════════════ */

/* Mobile sidebar - always show text on small screens */
@media (max-width: 767px) {
	/* Hide sidebar completely on mobile - filters are in hamburger menu */
	#market-sidebar {
		display: none !important;
	}

	/* Mobile menu toggle button */
	.mobile-menu-toggle {
		display: flex !important;
	}

	/* Mobile nav menu container */
	.mobile-nav-menu {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100;
		pointer-events: none;
	}

	.mobile-nav-menu.open {
		pointer-events: auto;
	}

	/* Overlay */
	.mobile-nav-overlay {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: hsl(0 0% 0% / 0.5);
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	.mobile-nav-menu.open .mobile-nav-overlay {
		opacity: 1;
	}

	/* Sidebar panel - slides in from left */
	.mobile-nav-sidebar {
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		width: 280px;
		max-width: 85vw;
		background: hsl(0 0% 10%);
		border-right: 1px solid hsl(0 0% 100% / 0.09);
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
		display: flex;
		flex-direction: column;
	}

	.mobile-nav-menu.open .mobile-nav-sidebar {
		transform: translateX(0);
	}

	.mobile-nav-menu .mobile-nav-content {
		padding: 1rem;
		padding-top: 1.5rem;
		padding-bottom: 2rem;
		flex: 1;
	}

	/* Better touch targets in mobile menu */
	.mobile-nav-menu label {
		min-height: 44px;
	}

	/* Profile modal - ensure it's centered not at bottom */
	#profile-modal > div:first-child {
		align-items: center !important;
		padding-top: 1rem;
		padding-bottom: 1rem;
	}

	#profile-modal > div > div:last-of-type {
		margin: 1rem;
		max-height: calc(100vh - 2rem);
		overflow-y: auto;
	}
}

/* Desktop - hide mobile-specific elements */
@media (min-width: 768px) {
	.mobile-menu-toggle,
	.mobile-nav-menu {
		display: none !important;
	}
}

/* Base state for mobile toggle - hidden by default, shown via media query */
.mobile-menu-toggle {
	display: none;
}

/* Additional mobile improvements */
@media (max-width: 767px) {
	/* Better modal display on mobile */
	#submit-modal > div > div:last-child,
	#profile-modal > div > div:last-child,
	#detail-modal > div > div:last-child,
	#login-modal > div > div:last-child,
	#report-modal > div > div:last-child {
		max-height: 90vh;
		overflow-y: auto;
		margin: 1rem;
		border-radius: 0.75rem;
	}

	/* Improve button spacing in modals on mobile */
	#submit-modal .sm\\:flex-row-reverse,
	#profile-modal .sm\\:flex-row-reverse {
		flex-direction: column;
		gap: 0.5rem;
	}

	/* Better touch targets for cards */
	#prompts-grid > div {
		min-height: 44px;
	}

	/* Ensure prompt cards are readable on mobile */
	.prompt-card {
		padding: 1rem;
	}

	/* Fix nav padding on mobile */
	nav > div {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	/* Adjust grid for better mobile viewing */
	#prompts-grid {
		gap: 0.75rem;
	}

	/* Make user menu button more touch-friendly */
	#user-menu-button {
		padding: 0.5rem;
	}

	/* Hide username on very small screens */
	#user-name {
		display: none;
	}
}

/* Small mobile adjustments (under 400px) */
@media (max-width: 400px) {
	/* Smaller logo on tiny screens */
	nav img {
		height: 2rem;
	}

	/* Stack submit button text */
	#btn-submit-prompt span {
		display: none;
	}

	#btn-submit-prompt i {
		display: none;
	}

	#btn-submit-prompt::before {
		content: '+';
		font-size: 1.25rem;
		font-weight: 500;
	}
}

/* Profile Card Styles */
.profile-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 20px;
	border: 1px solid var(--profile-card-border, hsl(0 0% 100% / 0.09));
	border-radius: 8px;
	background: var(--profile-card-bg, hsl(0 0% 13%));
	box-shadow: 0 10px 30px hsl(0 0% 0% / 0.15);
	transition: all 0.15s ease;
}

.profile-card--modal {
	width: 100%;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
}

.profile-card__avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--profile-card-avatar-bg, hsl(0 0% 15%));
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	font-weight: 600;
	color: var(--profile-card-avatar-fg, hsl(0 0% 92%));
}

.profile-card__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-card__meta {
	flex: 1;
	min-width: 220px;
}

.profile-card__name {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 20px;
	font-weight: 600;
	color: var(--profile-card-name, hsl(0 0% 92%));
}

.profile-card__email {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--profile-card-muted, hsl(30 2% 60%));
	margin-top: 4px;
}

.profile-card__plan {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--profile-card-muted, hsl(30 2% 60%));
}

.profile-card__plan.plan-premium {
	color: hsl(45 93% 58%);
}

.profile-card__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.profile-card__actions .icon-button {
	padding: 6px 10px;
	border-radius: 6px; /* rounded-md per Notion Design System */
	border: 1px solid transparent;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
}

.profile-card__actions .icon-button:hover {
	border-color: var(--profile-card-border, hsl(0 0% 100% / 0.13));
	background: hsl(0 0% 100% / 0.055);
}

.profile-card__edit-btn {
	border: none;
	background: transparent;
	color: var(--profile-card-muted, hsl(30 2% 60%));
	cursor: pointer;
	padding: 0;
	height: 20px;
	width: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.profile-card__edit-btn:hover {
	color: var(--profile-card-name, hsl(0 0% 92%));
}

.profile-card__name:hover .profile-card__edit-btn,
.profile-card__email:hover .profile-card__edit-btn {
	opacity: 1;
}

@media (max-width: 520px) {
	.profile-card__actions {
		width: 100%;
		justify-content: space-between;
	}
}
