/* ============================================================
   Header (#site-header)
   ============================================================ */

#site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: var(--header-height);
	padding: 0;
	background-color: var(--header-bg);
	display: flex;
	align-items: center;
	backdrop-filter: var(--header-blur);
}

.container {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 var(--space-6);
}

main .container {
	overflow-x: hidden;
}
header .container {
	overflow: visible;
}

#site-header .container {
	position: relative;
	width: 100%;
}

#page-wrapper {
	min-height: 100vh;
}

/* Page offset for fixed header — updated from .app-page to [id^="page-"] */
[id^="page-"] {
	padding-top: var(--header-height);
}

/* Site logo */
.site-logo {
	display: flex;
	align-items: center;
}

.site-logo img {
	height: 40px;
	max-height: 60px;
	width: auto;
	max-width: 180px;
	object-fit: contain;
}

.site-logo-text {
	font-family: var(--font-title);
	font-size: var(--text-xl);
	font-weight: 700;
	color: #ffffff;
}

@media (max-width: 480px) {
	.site-logo img {
		max-width: 120px;
		max-height: 50px;
	}
}

@media (min-width: 768px) {
	#site-header .site-logo img {
		height: 50px;
		max-width: 150px;
	}
}

/* Header membership  */
.header-membership {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: none;
	border: none;
	color: var(---coin-text-light);
	cursor: pointer;
	font-size: var(--text-xs);
	font-family: var(--font-condensed);
	padding: 0;
	text-align: center;
	text-decoration: none;
	gap: 2px;
	min-width: 50px;
}

.dark .header-membership {
	color: var(--coin-text-light);
}

.membership-label {
	font-size: var(--text-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.header-actions {
	gap: var(--gap-base);
}
/* Premium/VIP emoji */
.premium-emoji {
	display: flex;
	align-items: center;
	justify-content: center;
}

.premium-emoji-xs {
	width: var(--icon-xs);
	height: var(--icon-xs);
	font-size: var(--text-2xs);
}

.premium-emoji-sm {
	width: var(--icon-sm);
	height: var(--icon-sm);
	font-size: var(--text-xs);
}

.premium-emoji-md {
	width: var(--icon-md);
	height: var(--icon-md);
	font-size: var(--text-sm);
}

.premium-emoji-lg {
	width: 32px;
	height: 32px;
	font-size: var(--text-base);
}

.premium-emoji-img {
	display: block;
}

.header-right .premium-emoji-img {
	width: 32px;
	height: 32px;
}


h4 .premium-emoji-img {
	width: 32px;
	height: 32px;
	margin-left: -12px;
}

/* Smaller premium emoji on photo badges */
.photo-badge-emoji .premium-emoji-img {
	width: 24px;
	height: 24px;
}

@media (min-width: 768px) {
	.app-header .header-right {
		align-items: center;
	}
	.header-membership {
		flex-direction: row;
		gap: var(--space-2);
		min-width: auto;
		padding: 0 var(--space-2) 0 0;
		border-radius: var(--radius-2xl);
		transition: background-color 0.2s;
		font-size: var(--text-base);
	}

	.membership-label {
		font-size:var(--size-md);
	}
}

/* ============================================================
   Desktop Nav Container
   ============================================================ */

.desktop-nav {
	display: none;
}

@media (min-width: 768px) {
	.desktop-nav {
		display: flex;
		align-items: center;
		gap: var(--space-2);
	}
}

/* NOTE: .desktop-nav a styles already exist in site.css — not duplicated */

/* ============================================================
   Bottom Nav Container
   ============================================================ */

.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	justify-content: space-around;
	align-items: stretch;
	height: auto;
	min-height: 64px;
	background: var(--navBackground);
	border-top: 1px solid var(--border);
/*	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
	padding-top: 8px;
	*/
}

@media (min-width: 768px) {
	.bottom-nav {
		display: none;
	}
}

/* NOTE: .bottom-nav a styles already exist in site.css — not duplicated */

/* ============================================================
   Primary Nav Rules (nav.primary)
   ============================================================ */

nav.primary {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: .5rem;
	width: 100%;
}

nav.primary .site-logo {
	grid-column: 1;
	justify-self: start;
}

nav.primary .header-center {
	grid-column: 2;
	justify-self: center;
}

nav.primary .header-right {
	grid-column: 3;
	justify-self: end;
	display: flex;
	align-items: flex-end;
	gap: var(--space-2);
}

@media (min-width: 768px) {
	nav.primary .header-right {
		align-items: center;
	}
}

/* ============================================================
   Secondary Nav Rules (nav.secondary)
   ============================================================ */

nav.secondary {
	display: flex;
	background: var(--pill-bg);
	border: var(--pill-border-width) var(--pill-border-style) var(--pill-border-color);
	border-radius: var(--pill-radius);
	overflow: hidden;
	min-height: var(--space-8);
	margin-top: var(--space-4);
}

nav.secondary button {
	flex: 1;
	font-size: var(--text-xs);
	font-weight: 400;
	min-height: 1.25rem;
	white-space: nowrap;
	border: none;
	border-right: 1px solid var(--border);
	border-radius: 0;
	background: transparent;
	color: var(--foreground);
	cursor: pointer;
	transition: all 0.2s;
}

@media (min-width: 768px) {
	nav.secondary button {
		font-size: var(--text-sm);
	}
}

nav.secondary button:last-child {
	border-right: none;
}

nav.secondary button[aria-selected="true"],
nav.secondary button.active {
	background: var(--pill-active-bg);
	color: var(--pill-active-text);
	font-weight: 600;
}

.dark nav.secondary button {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
}

.dark nav.secondary button[aria-selected="true"],
.dark nav.secondary button.active {
	background: linear-gradient(rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.6) 100%);
}

nav.secondary .badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: 6px;
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: 1;
	border-radius: var(--radius-md);
	background: var(--secondary);
	color: #fff;
}

nav.secondary button[aria-selected="true"] .badge,
nav.secondary button.active .badge {
	background-color: var(--background-color);
	color: var(--foreground);
}

nav.secondary button.explore {
	background: linear-gradient(135deg, var(--vip-gold) 0%, var(--vip-gold-dark) 100%);
	color: white;
	font-weight: 600;
}

/* ============================================================
   Bottom Nav — mobile navigation bar
   ============================================================ */

.bottom-nav a {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: var(--space-2) 0;
	text-decoration: none;
	color: var(--muted);
	font-size: var(--text-xs);
	font-weight: 400;
	transition: color 0.2s, background 0.2s;
}

.bottom-nav a.active {
	color: var(--pill-active-bg);
	background-color: rgba(0, 0, 0, 0.1);
}

.dark .bottom-nav a.active {
	background-color: rgba(255, 255, 255, 0.1);
}

.bottom-nav a > span:first-child {
	position: relative;
	width: 28px;
	height: 28px;
}

.bottom-nav a > span:first-child svg {
	width: 24px;
	height: 24px;
}

.bottom-nav .badge {
	position: absolute;
	top: -4px;
	right: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	color: #fff;
	background: var(--secondary);
	border-radius: 9px;
}

/* ============================================================
   Desktop Nav — header navigation
   ============================================================ */

.desktop-nav a {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4);
	text-decoration: none;
	color: var(--muted);
	border-radius: var(--radius-2xl);
	transition: color 0.2s, background 0.2s;
	font-size: var(--text-sm);
	white-space: nowrap;
}

.desktop-nav a.active {
	color: var(--pill-active-bg);
	background: var(--info-bg-subtle-flat);
}

.desktop-nav a svg {
	width: 20px;
	height: 20px;
}

.desktop-nav .badge {
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	color: #fff;
	background: var(--secondary);
	border-radius: 9px;
}


   /* Title classes */
.section-title,
.modal-title,
.prompt-title,
.card-title {
	font-weight: var(--weight-title);
}

/* ============================================================
   Header Row (generic pattern)
   ============================================================ */

.header-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-3);
}

.header-row > button:last-child {
	position: absolute;
	right: 0;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
	padding: var(--space-4) var(--space-6);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-4);
}

.alert-error {
	padding: var(--space-3) var(--space-4);
	background-color: var(--error-bg-subtle-flat);
	color: var(--error);
	border: 1px solid rgba(220, 38, 38, 0.2);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	margin-bottom: var(--space-4);
}

.alert-info {
	background-color: var(--info-bg-subtle-flat);
	color: var(--info);
	border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================================
   Toggle Switch
   ============================================================ */

.toggle-switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 28px;
	flex-shrink: 0;
}

.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--border);
	transition: 0.3s;
	border-radius: var(--radius-full);
}

.toggle-slider:before {
	position: absolute;
	content: "";
	height: 22px;
	width: 22px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.3s;
	border-radius: var(--radius-full);
	box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
	background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
	transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ============================================================
   Page Title
   ============================================================ */

header h1 {
	font-size: var(--font-title-size);
	font-weight: var(--weight-heading);
	margin: 0;
	text-align: center;
}

header .title-row {
	gap: var(--gap-base);
	margin-bottom: var(--space-3);
	position: relative;
}

header .title-row h1 {
	margin-bottom: 0;
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
}

header .title-row .btn-back {
	position: absolute;
	left: 0;
}

/* ---- Scroll lock for native dialog ---- */
body:has(dialog[open]) {
  overflow: hidden;
}

/* ---- Page wrapper / main container ---- */
/* Migrated from base.css page-specific selectors to ID-based selectors */

/* == Discovery Page == */
#page-discovery {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* == Explore Page == */
#page-explore {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

#page-explore main {
	padding-bottom: 0;
}

/* == Activity Page == */
#page-activity main {
	padding: 0 0 6rem;
}

/* == Verify Page == */
#page-verify main {
	padding: var(--space-8) 0 var(--space-24);
}

/* == Likes Page == */
#page-likes main {
	padding: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* == Messages Page == */
#page-messages main {
	padding: 0 0 6rem;
}

#page-messages main > .container {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 var(--space-4);
}

/* == Member Profile Page == */
#page-member main {
	padding: 0 0 6rem;
}

/* == Chat Page == */
#page-chat {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

#page-chat main {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
	padding: 0;
	margin: 0 auto;
	max-width: 80rem;
	width: 100%;
	background: rgba(0,0,0,0.05);
	border-left: 1px solid var(--border);
	border-right: 1px solid var(--border);
}

/* == Settings Page == */
#page-settings main {
	padding-bottom: 100px;
}

/* == Profile Page == */
#page-profile main {
	padding: 0 0 6rem;
}

/* ============================================================
   Sub-header (sticky page title + pills below site header)
   ============================================================ */

main > header {
	position: sticky;
	top: var(--header-height);
	z-index: 90;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	background: var(--menu-bg);
	border-bottom: 1px solid var(--border);
	padding: var(--space-4) 0;
	margin-bottom: var(--space-1);
}

@media (max-width: 468px) {
	main > header { padding:var(--space-2) 0; top:55px; }
	main > header h1 { display: none; }
	main > header .header-row,
	main > header .title-row { display: none; }
	#page-settings main > header .title-row { display: flex; }
}

/* ============================================================
   Static Page Modal
   ============================================================ */

#static-page {
	display: flex;
	flex-direction: column;
	max-height: 80vh;
}

#static-page SECTION {
	flex: 1;
	overflow-y: scroll;
	padding: var(--space-6);
	text-align: left;
}

/* Visible scrollbar for static page content */
#static-page SECTION::-webkit-scrollbar {
	width: 8px;
}

#static-page SECTION::-webkit-scrollbar-track {
	background: var(--border);
	border-radius: 4px;
}

#static-page SECTION::-webkit-scrollbar-thumb {
	background: var(--muted);
	border-radius: 4px;
}

#static-page .content {
	line-height: 1.7;
}

#static-page .content h1,
#static-page .content h2,
#static-page .content h3 {
	margin: 1.5rem 0 1rem;
}

#static-page .content p {
	margin: 0 0 1em;
}

#static-page .content ul,
#static-page .content ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

/* ============================================================
   Card Rules (.card)
   ============================================================ */

.card {
	position: relative;
	width:auto;
	display: flex;
	flex-direction: column;
	padding: var(--padding-base);
	background: var(--card-bg);
	border: var(--profile-border-width) var(--profile-border-style) var(--profile-border-color);
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
	overflow: hidden;
	transition: var(--transition-lift);
	container-name: card;
}

.card.verified {
	border-color: var(--member-verified-bg);
	box-shadow: 0 2px 8px color-mix(in srgb, var(--member-verified-bg) 30%, transparent);
}
.card.passed {
	opacity:0.4;
}
.card.liked {
	border-color: #ff0000;
	box-shadow: 0 2px 8px color-mix(in srgb, #ff0000 30%, transparent);
}

.card > a {
	display: block;
}

.card figure {
	position: relative;
	aspect-ratio: 4/5;
	overflow: hidden;
	margin: 0;
}

.card figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card figcaption {
	padding: var(--space-2) var(--space-3);
}

.card figcaption h3 {
	font-size: var(--text-base);
	font-weight: 600;
	margin: 0 0 0.125rem;
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.card figcaption p {
	font-size: var(--text-xs);
	color: var(--muted);
	margin: 0;
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.card footer {
	display: flex;
	justify-content: center;
	gap: var(--gap-base);
	padding: var(--space-3);
	background: var(--card-bg);
}

.card footer button {
	width: 44px;
	height: 44px;
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	cursor: pointer;
	transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.card footer button:active {
	transform: scale(0.93);
}

.card footer button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.card footer button svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* Card size variants */
.card[data-size="featured"] footer {
	gap: var(--gap-base);
}

.card[data-size="featured"] footer button {
	width: var(--icon-3xl);
	height: var(--icon-3xl);
}

.card[data-size="featured"] footer button svg {
	width: 22px;
	height: 22px;
}

.card[data-size="compact"] {
	border-radius: var(--radius-md);
	padding:0;
}

.card[data-size="compact"] figcaption {
	padding: var(--space-1\.5) var(--space-2);
}

.card[data-size="compact"] figcaption h3 {
	font-size: var(--text-xs);
	font-weight:400;
}

.card[data-size="compact"] figcaption p {
	font-size: var(--text-xs);
}

.card[data-size="compact"] footer {
	gap: var(--space-2);
	padding: var(--space-2);
}

.card[data-size="compact"] footer button {
	width: 28px;
	height: 28px;
}

.card[data-size="compact"] footer button svg {
	width: 14px;
	height: 14px;
}

.card[data-size="avatar"] footer button {
	width: 36px;
	height: 36px;
}

.card[data-size="avatar"] footer button svg {
	width: 18px;
	height: 18px;
}

.card[data-size="avatar"] footer {
	gap: var(--gap-base);
	padding: var(--space-2);
}

/* Container queries for responsive button sizing */
@container card (max-width: 200px) {
	.card footer {
		gap: var(--gap-base);
		padding: var(--space-2);
	}
	.card footer button {
		width: 32px;
		height: 32px;
	}
	.card footer button svg {
		width: 16px;
		height: 16px;
	}
}

@container card (min-width: 200px) and (max-width: 280px) {
	.card footer {
		gap: var(--gap-base);
		padding: var(--space-2);
	}
	.card footer button {
		width: 36px;
		height: 36px;
	}
	.card footer button svg {
		width: 18px;
		height: 18px;
	}
}

@container card (min-width: 280px) and (max-width: 360px) {
	.card footer {
		gap: var(--gap-base);
		padding: var(--space-3);
	}
	.card footer button {
		width: 40px;
		height: 40px;
	}
	.card footer button svg {
		width: 20px;
		height: 20px;
	}
}

/* Profiles layout */
.profiles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: var(--gap-base);
	width: 100%;
}

@media (min-width: 768px) {
	.profiles {
		grid-template-columns: repeat(4, 1fr);
		gap: var(--gap-base);
	}
}

@media (min-width: 1024px) {
	.profiles {
		grid-template-columns: repeat(var(--profile-columns), 1fr);
	}
}

.profiles ARTICLE {
	padding:0;
}


.card-icons {
	gap: var(--space-2);
	margin-top: var(--space-2);
	font-size: var(--text-sm);
	color: var(--muted);
}

.card-icons img {
	height: 24px;
}



/* Landing grid variant - wider on desktop */
@media (min-width: 1024px) {
	.profiles.landing {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* Mobile Stacked Cards (Tinder-like swipe view) */
.profiles.stacked-mobile {
	display: block;
	position: relative;
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	height: 520px;
}

.profiles.stacked-mobile .swipeable-card-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Stack cards: first on top, others behind */
.profiles.stacked-mobile .swipeable-card-wrapper:nth-child(1) {
	z-index: 3;
}

.profiles.stacked-mobile .swipeable-card-wrapper:nth-child(2) {
	z-index: 2;
	transform: scale(0.95) translateY(10px);
}

.profiles.stacked-mobile .swipeable-card-wrapper:nth-child(3) {
	z-index: 1;
	transform: scale(0.90) translateY(20px);
}

/* ============================================================
   6. Card Action Button States
   Semantic button states using data-action attributes
   ============================================================ */

/* Pass button - active/passed state */
.card footer button[data-action="pass"].active {
	background: var(--btn-pass-active-bg, #ef4444);
	border-color: var(--btn-pass-active-border, #dc2626);
	color: #fff;
}

/* Like button - active/liked state */
.card footer button[data-action="like"].active {
	background: var(--btn-like-active-bg, #ec4899);
	border-color: var(--btn-like-active-border, #db2777);
	color: #fff;
}

/* Preview button inside figure */
.card figure button[data-action="preview"] {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 5;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	border-radius: var(--radius-full);
	color: #fff;
	cursor: pointer;
	opacity: 0.2;
	transition: opacity 0.2s, background 0.2s;
}

.card:hover figure button[data-action="preview"] {
	opacity: 1;
}

.card figure button[data-action="preview"]:hover {
	background: rgba(0, 0, 0, 0.8);
}

/* Featured card overlay (for large/swipe cards) */
.card[data-size="featured"] figcaption.overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: var(--space-4);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
	color: #fff;
}

.card[data-size="featured"] figcaption.overlay h3 {
	color: #fff;
	font-size: var(--text-xl);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card[data-size="featured"] figcaption.overlay p {
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--text-sm);
}


/* Swipeable card wrapper */
.swipeable-card-wrapper {
	position: relative;
	/* Prevent browser back/forward gesture - only allow vertical scroll */
	touch-action: pan-y;
}
