/* Custom styles */
body { padding-bottom: 40px; }

/* Optional: improve card look on both themes */
.card.bg-body-tertiary {
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.05);
}

/* Login page helpers */
.login-wrapper {
	min-height: calc(100vh - 120px); /* account for navbar spacing */
}
.login-card .logo {
	font-weight: 600;
}
.logo-circle {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	border: 2px solid var(--bs-border-color);
	background: var(--bs-body-bg);
}

.theme-inline-switch {
	pointer-events: auto;
}
.theme-inline-switch { position: relative; }
.theme-bubble-stream {
	position: absolute;
	left: 50%;
	top: calc(100% + 6px); /* directly under the switch */
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none; /* bubbles are non-interactive */
	/* ensure bubbles layer above footer text inside the card */
	z-index: 2000;
}
.theme-bubble.stream {
	position: relative; /* anchor caret to this bubble */
	margin-top: 6px;
	/* reset offsets inherited from base .theme-bubble (which is absolute-centered) */
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	opacity: 0; /* start hidden for fade-in */
	transform: translateY(6px); /* subtle lift-up on show */
	transition: opacity .28s ease, transform .28s ease;
	will-change: opacity, transform;
}
.theme-bubble.stream.show {
	transform: translateY(0);
}
.theme-bubble.stream::after { display: none; }
.theme-bubble.stream.with-caret::after { display: block; top: -4px; }
.theme-bubble {
	position: absolute;
	left: 50%;
	top: calc(100% + 6px); /* show below the switch */
	transform: translateX(-50%) translateY(2px);
	white-space: nowrap; /* one line */
	border-radius: .375rem;
	padding: .2rem .45rem; /* smaller */
	box-shadow: 0 .2rem .45rem rgba(0,0,0,.08);
	font-size: .75rem;
	z-index: 1060;
	opacity: 0;
	transition: opacity .2s ease, transform .2s ease;
}
.theme-bubble.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
/* Ensure stacked variant doesn't inherit the absolute-centered transform */
.theme-bubble.stream.show {
	opacity: 1;
	transform: translateY(0) !important;
}
.theme-bubble::after{
	content: "";
	position: absolute;
	top: -5px;
	left: 50%;
	width: 8px;
	height: 8px;
	background: currentColor; /* overridden by skins using box-shadow for border */
	transform: translateX(-50%) rotate(45deg);
}

/* Bubble skins that freeze at creation time */
.bubble-skin-light {
	background-color: #f8f9fa; /* light subtle bg */
	color: #212529; /* light text */
	border: 1px solid rgba(0,0,0,.12);
}
.bubble-skin-light::after {
	background: #f8f9fa;
	box-shadow: -1px -1px 0 0 rgba(0,0,0,.12);
}
.bubble-skin-dark {
	background-color: #2b3035; /* bootstrap dark-ish */
	color: #e9ecef; /* light text on dark */
	border: 1px solid rgba(255,255,255,.14);
}
.bubble-skin-dark::after {
	background: #2b3035;
	box-shadow: -1px -1px 0 0 rgba(255,255,255,.14);
}
.theme-inline-switch .form-switch {
	padding-left: 0; /* remove default left padding used when a label follows */
}
.theme-inline-switch .form-switch .form-check-input {
	float: none;          /* don't float left */
	margin-left: 0;       /* remove negative margin that causes overlap */
	margin-right: 0;      /* keep symmetric spacing; gap handles spacing */
	background-color: var(--bs-body-bg); /* neutral track */
	border-color: var(--bs-border-color);
	box-shadow: none;
}
.theme-inline-switch .form-switch .form-check-input:checked {
	background-color: var(--bs-border-color); /* subtle checked state */
	border-color: var(--bs-border-color);
}
.theme-inline-switch .form-switch .form-check-input:focus {
	box-shadow: 0 0 0 .125rem rgba(var(--bs-body-color-rgb, 33,37,41), .12);
}

/* Floating theme switcher */
.theme-switcher {
	position: fixed;
	left: 0;
	bottom: 0;
	z-index: 1050;
	padding: 0.25rem 0.5rem 0.5rem 0.25rem;
	transform: translateX(-100%); /* fully hidden */
	transition: transform .2s ease-in-out, opacity .2s ease-in-out;
	opacity: 1; /* container itself remains at full opacity when revealed */
}
.theme-switcher::before {
	content: "";
	position: absolute;
	right: -12px; /* create a hover hotspot inside the viewport */
	bottom: 0;
	width: 12px;
	height: 72px;
	background: transparent; /* invisible hotspot */
}
.theme-switcher:hover,
.theme-switcher:focus-within {
	transform: translateX(0);
}
.theme-switcher-handle {
	display: none; /* remove visual handle artifact entirely */
}
.theme-switcher-panel {
	margin-top: 0.25rem;
	padding: 0.5rem 0.75rem;
	background: var(--bs-body-bg);
	color: var(--bs-body-color);
	border: 1px solid var(--bs-border-color);
	border-left: none;
	border-radius: 0 0.5rem 0 0;
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.1);
}

/* Generic page card layout to match login vibes */
.page-wrapper {
	min-height: calc(100vh - 120px);
}
.page-card {
	max-width: 860px;
	width: 100%;
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.05);
	position: relative; /* anchor absolute footer inside */
	padding-bottom: 3rem; /* room for absolute footer */
}
.page-card h1 {
	margin-bottom: .5rem;
}
.page-card .lead {
	margin-bottom: 1rem;
}
.page-card hr {
	margin: 1.25rem 0;
}

/* Header card aesthetic */
.header-card {
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.05);
}
.header-logo-circle{
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--bs-border-color);
}
.ratio > iframe { width: 100%; height: 100%; display: block; }

/* SSO buttons */
.btn-sso {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	font-weight: 600;
	border-width: 2px;
}
.btn-sso .sso-icon { display: inline-flex; line-height: 0; align-items: center; justify-content: center; width: 20px; height: 20px; overflow: hidden; border-radius: 4px; }
.btn-sso .sso-icon svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.btn-sso .sso-icon img { width: 18px; height: 18px; display: block; object-fit: contain; flex-shrink: 0; }
.btn-sso span + span { line-height: 1; }
.btn-discord {
	color: #fff;
	background-color: #5865F2;
	border-color: #4d5ae5;
}
.btn-discord:hover { background-color: #4752C4; border-color: #3f4ab4; color: #fff; }
.btn-microsoft {
	color: var(--bs-body-color);
	background-color: var(--bs-body-bg);
	border-color: var(--bs-border-color);
}
.btn-microsoft:hover { background-color: rgba(var(--bs-primary-rgb), .08); }
.btn-startgg {
	color: var(--bs-body-color);
	background-color: var(--bs-body-bg);
	border-color: var(--bs-border-color);
}
.btn-startgg:hover { background-color: rgba(var(--bs-primary-rgb), .08); }

/* Avatar selection */
.avatar-grid {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}
.avatar-choice {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border: 2px solid transparent;
	padding: .3rem;
	border-radius: .5rem;
}
.avatar-choice img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	display: block;
}
.avatar-choice input { display: none; }
.avatar-choice input:checked + img { outline: 3px solid var(--bs-primary); border-radius: .375rem; }
.avatar-choice:hover { border-color: rgba(0,0,0,.06); cursor: pointer; }

/* Badge mockup styles */
.badge-mockup {
	width: 320px;
	height: 420px;
	border-radius: 12px;
	border: 1px solid var(--bs-border-color);
	box-shadow: 0 6px 18px rgba(0,0,0,.06);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	position: relative;
	overflow: hidden;
}
.badge-mockup.wwl2025 {
	background: #000 url('/images/badge_imgs/backgrounds/wwl2025.png') center/cover no-repeat;
}
.badge-mockup .badge-name {
	font-weight: 800;
	font-size: 1.35rem;
	line-height: 1.2;
	color: #fff;
	text-shadow: 0 2px 6px rgba(0,0,0,.35);
	margin-top: 165px; /* below event logo area */
}
.badge-mockup .badge-small {
	font-size: .95rem;
	color: #f1f3f5;
	text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
/* Event logo at top center */
.badge-mockup .badge-event-logo {
	position: absolute;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	width: 68%;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
}
/* User selected overlay bottom-right */
.badge-mockup .badge-user-overlay {
	position: absolute;
	right: 10px;
	bottom: 21px; /* lowered by ~5px; may tuck under strip */
	width: 112px;
	height: auto;
	object-fit: contain;
	z-index: 1; /* allow barcode strip to overlay if overlapping */
}

/* Badge number (lower-left) */
.badge-mockup .badge-number {
	position: absolute;
	left: 10px;
	bottom: 26px; /* just above the barcode */
	color: #fff;
	font-weight: 800;
	font-size: 1.25rem;
	text-shadow: 0 2px 6px rgba(0,0,0,.45);
	z-index: 4; /* above barcode strip */
}

/* Barcode across bottom */
.badge-mockup .badge-barcode {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 24px; /* shorter strip */
	display: flex;
	align-items: center;
	gap: 0;
	overflow: hidden;
	z-index: 3; /* above overlay image, below number */
	background: #ffffff; /* white spans across entire badge */
}
.badge-mockup .badge-barcode svg {
	width: 100%;
	height: 20px; /* match JsBarcode height for tight fit */
	display: block;
}
.badge-mockup .badge-barcode .bar {
	display: inline-block;
	background: #111;
	height: 40px;
}
.badge-mockup .badge-barcode .gap,
.badge-mockup .badge-barcode .digit-gap {
	display: inline-block;
	height: 1px; /* not visible; just spacing */
}

