/* ==========================================================================
   Banshkhali Blood Bank — Premium Hero Banner ("Aurora Card")
   --------------------------------------------------------------------------
   Replaces ONLY the visual design of the existing Home Dashboard Hero
   Banner's "standard" display mode (assets/js/views/dashboard.js ->
   heroSlideMarkup()). It renders as new markup nested inside the exact
   same <section class="db-hero db-hero-slide ..."> the Hero Banner Auto
   Slider (initHeroSlider), Hero Banners CRUD, REST API and Admin Panel
   already produce and control — none of that is touched by this file.

   "Full Banner Image" display mode (.db-hero-full-image / .db-hero-full-img)
   is completely untouched and still styled by app.css exactly as before.

   Styles the EXISTING markup only (.bbb-phero-row > left / center /
   right) — no new wrapper elements required from dashboard.js.

   ARCHITECTURE — two genuinely separate layouts, not one shrunk to fit
   the other:
     • Base rules (no media query) = DESKTOP layout, exactly as before:
       .bbb-phero-row is a single row (left | center | right).
     • @media (max-width: 767px) = dedicated MOBILE layout: three
       stacked rows (top: avatar+greeting+name+badge / middle:
       motivational message / bottom: date+time+button). It does NOT
       reuse or scale down the desktop row — it re-lays-out the exact
       same elements with `order` inside a wrapped flex column so nothing
       truncates or overlaps at any phone width.
     • @media (min-width: 768px) is untouched desktop territory.
   ========================================================================== */

.db-hero.bbb-phero {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transform: translateZ(0);
	display: flex;
	align-items: stretch;
	padding: 0;
	min-height: 196px;
	border: 1px solid rgba(255, 255, 255, .14);
	background: linear-gradient(135deg, #2E7D50, #14202E); /* fallback before [data-tod] paints */
}

/* Legacy card texture pseudo-elements (garnet gradient + noise) are part
   of the old design this replaces — the Aurora sky gradient below is the
   only background for this variant. */
.db-hero.bbb-phero::before,
.db-hero.bbb-phero::after { content: none; }

/* ---- Automatic time-of-day sky (see phScene()/data-tod in dashboard.js) ---- */
.db-hero.bbb-phero[data-tod="morning"]   { background: linear-gradient(160deg, #FFE1A8 0%, #FFB25E 34%, #F9824B 64%, #4E7A34 100%); }
.db-hero.bbb-phero[data-tod="noon"]      { background: linear-gradient(160deg, #D9F0FC 0%, #93CDEE 42%, #4F9BDB 72%, #2E7D50 100%); }
.db-hero.bbb-phero[data-tod="afternoon"] { background: linear-gradient(160deg, #FFDCA3 0%, #FB9A56 38%, #E8622E 68%, #5B3A22 100%); }
.db-hero.bbb-phero[data-tod="evening"]   { background: linear-gradient(160deg, #6B4C86 0%, #4A3573 45%, #2A2154 74%, #120E28 100%); }
.db-hero.bbb-phero[data-tod="night"]     { background: linear-gradient(160deg, #16233F 0%, #0B142A 55%, #050A16 100%); }

/* ---- Ambient vector scene (sun/moon, clouds, birds, stars, hills) ---- */
.bbb-phero-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; overflow: hidden; }
.bbb-phero-scene-svg { display: block; width: 100%; height: 100%; }

.bbb-phero-rays { animation: pheroRaysSpin 70s linear infinite; }
@keyframes pheroRaysSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.bbb-phero-star { fill: #fff; animation: pheroTwinkle 3.2s ease-in-out infinite; }
@keyframes pheroTwinkle { 0%, 100% { opacity: .22; } 50% { opacity: 1; } }

.bbb-phero-cloud {
	transform: translate(var(--x), var(--y));
	animation: pheroDrift 32s ease-in-out infinite;
}
@keyframes pheroDrift {
	0%   { transform: translate(calc(var(--x) - 50px), var(--y)); }
	50%  { transform: translate(calc(var(--x) + 50px), var(--y)); }
	100% { transform: translate(calc(var(--x) - 50px), var(--y)); }
}

.bbb-phero-bird {
	transform: translate(var(--x), var(--y));
	animation: pheroFly 9s ease-in-out infinite alternate;
}
@keyframes pheroFly {
	0%   { transform: translate(var(--x), var(--y)); }
	50%  { transform: translate(calc(var(--x) + 46px), calc(var(--y) - 10px)) scaleY(.7); }
	100% { transform: translate(calc(var(--x) + 92px), var(--y)); }
}

.bbb-phero-light { display: none !important; }

/* ==========================================================================
   DESKTOP LAYOUT (default / ≥768px) — unchanged single-row design.
   ========================================================================== */
.bbb-phero-row {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 20px 18px;
}

.bbb-phero-left { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 auto; }
.bbb-phero-avatar-wrap { position: relative; flex: none; }
.bbb-phero-avatar {
	display: block;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	object-fit: cover;
	border: 2.5px solid rgba(255, 255, 255, .92);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}
.bbb-phero-online {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #35D07F;
	border: 2px solid rgba(255, 255, 255, .95);
}
.bbb-phero-left-text { min-width: 0; }
.bbb-phero-greeting {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	font: 600 12.5px/1.3 var(--font-en, sans-serif);
	color: rgba(255, 255, 255, .92);
	text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.bbb-phero-name {
	margin: 1px 0 6px;
	font: 800 18px/1.15 var(--font-bn, sans-serif);
	font-variant-numeric: normal;
	font-feature-settings: normal;
	color: #fff;
	text-shadow: 0 2px 6px rgba(0, 0, 0, .3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 40vw;
}
.bbb-phero-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font: 700 11px/1 var(--font-bn, sans-serif);
	font-variant-numeric: normal;
	color: #fff;
	background: rgba(20, 10, 14, .38);
	border: 1px solid rgba(255, 255, 255, .3);
	padding: 5px 10px;
	border-radius: 999px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.bbb-phero-badge svg { flex: none; color: #D61F2C; }

.bbb-phero-center {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 118px;
}
.bbb-phero-medallion-svg {
	width: 88px;
	height: 88px;
	display: block;
	filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25));
}
.bbb-phero-pulse-ring {
	fill: none;
	stroke: rgba(255, 255, 255, .55);
	stroke-width: 2;
	transform-origin: 100px 100px;
	animation: pheroPulseRing 2.6s ease-out infinite;
}
.bbb-phero-pulse-ring-2 { animation-delay: 1.3s; }
@keyframes pheroPulseRing {
	0%   { transform: scale(.62); opacity: .5; }
	100% { transform: scale(1.4); opacity: 0; }
}
.bbb-phero-drop { transform-origin: 100px 100px; animation: pheroDropBob 3.2s ease-in-out infinite; }
@keyframes pheroDropBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.bbb-phero-ecg { stroke-dasharray: 220; animation: pheroEcgDash 2.4s linear infinite; }
@keyframes pheroEcgDash { 0% { stroke-dashoffset: 220; } 100% { stroke-dashoffset: 0; } }

.bbb-phero-message {
	margin: 0;
	max-width: 20ch;
	text-align: center;
	font: 600 11px/1.35 var(--font-bn, sans-serif);
	color: rgba(255, 255, 255, .95);
	text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	min-height: 2.5em;
	transition: opacity .38s ease;
}
.bbb-phero-message.is-fading { opacity: 0; }

.bbb-phero-right { flex: none; }
.bbb-phero-glass {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 164px;
	padding: 12px 14px;
	border-radius: 18px;
	/* Premium deep-red gradient (brand palette), same box, just richer */
	background: linear-gradient(165deg, #F20D2F 0%, #E60024 52%, #D90020 100%);
	border: 1px solid rgba(255, 255, 255, .5);
	backdrop-filter: blur(16px) saturate(150%);
	-webkit-backdrop-filter: blur(16px) saturate(150%);
	/* Soft floating shadow — visually lifts the card off the Hero Banner
	   without changing its margin/position */
	box-shadow:
		0 16px 34px -10px rgba(74, 0, 16, .55),
		0 4px 12px -2px rgba(0, 0, 0, .28),
		inset 0 1px 0 rgba(255, 255, 255, .18);
}
/* Slight glossy highlight — a thin light sheen across the top edge,
   purely decorative (absolute, pointer-events:none), adds no layout size.
   border-radius: inherit makes it clip to its own rounded corners so the
   parent no longer needs overflow:hidden (which, combined with this
   element's backdrop-filter + border-radius, was rendering as small dark
   corner artifacts in Chromium). */
.bbb-phero-glass::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: linear-gradient(160deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .05) 22%, rgba(255, 255, 255, 0) 45%);
}
.bbb-phero-glass-row {
	/* DIAGNOSTIC TEST: font-size, font-weight, line-height and
	   letter-spacing forced to match the Calendar Card's date line
	   (.db-cal-line-bn) exactly, to test whether the clipping is
	   caused by this element's smaller typography. Revert after
	   the test. */
	display: flex;
	align-items: center;
	gap: 7px;
	font: 700 11px/1.3 var(--font-bn, sans-serif);
	letter-spacing: .1px;
	font-variant-numeric: normal;
	font-feature-settings: normal;
	font-synthesis: none;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
	-webkit-font-smoothing: antialiased;
	text-rendering: geometricPrecision;
	isolation: isolate;
	white-space: nowrap;
}
.bbb-phero-glass-row [data-phero-date],
.bbb-phero-glass-row [data-phero-time] {
	font-family: 'Hind Siliguri', var(--font-bn, sans-serif);
	font-variant-numeric: normal;
	font-feature-settings: normal;
}
.bbb-phero-glass-row svg { flex: none; opacity: .92; }
/* Bangla calendar row (Line 2): same .bbb-phero-glass-row typography
   (font, weight, size, color, left padding via the shared .bbb-phero-glass
   container, and row gap) as the Gregorian date/time rows above it —
   only the text content differs. flex-basis:100% just guarantees it
   always starts a fresh line, on both the desktop column layout and
   the mobile wrapped row layout below. */
.bbb-phero-glass-row-bangla { flex: 1 1 100%; }
.bbb-phero-live-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #35D07F;
	margin-left: auto;
	animation: pheroTwinkle 1.6s ease-in-out infinite;
}
.bbb-phero-btn {
	margin-top: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font: 700 12px/1 var(--font-bn, sans-serif);
	color: #fff;
	background: rgba(255, 255, 255, .22);
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 999px;
	padding: 9px 12px;
	text-decoration: none;
	transition: background .2s ease, transform .15s ease;
}
.bbb-phero-btn:hover { background: rgba(255, 255, 255, .32); }
.bbb-phero-btn:active { transform: scale(.96); }

/* ---- "Animations off" (Blood Bank > Dashboard Manager > Appearance) ---- */
/*
 * The Dashboard Manager's global animation switch may disable general UI
 * motion, but the Premium Hero's ambient scene is part of the banner itself.
 * Keep the sun rays, clouds and birds alive so the Hero does not look frozen.
 * Other Hero micro-animations still respect the global switch.
 */
html.bbb-no-anim .bbb-phero-light,
html.bbb-no-anim .bbb-phero-pulse-ring,
html.bbb-no-anim .bbb-phero-drop,
html.bbb-no-anim .bbb-phero-ecg,
html.bbb-no-anim .bbb-phero-live-dot {
	animation: none !important;
}

@media (min-width: 900px) {
	.db-hero.bbb-phero { min-height: 250px; }
	.bbb-phero-row { padding: 30px 34px; }
	.bbb-phero-name { font-size: 24px; max-width: 26vw; }
	.bbb-phero-center { width: 148px; }
	.bbb-phero-medallion-svg { width: 114px; height: 114px; }
	.bbb-phero-message { max-width: 22ch; font-size: 12px; }
	.bbb-phero-glass { min-width: 190px; padding: 14px 16px; }
	.bbb-phero-glass-row { font-size: 8.5px; line-height: 1.05; } /* DIAGNOSTIC: matched to .db-cal-line-bn's 900px+ override */
}

/* ==========================================================================
   MOBILE LAYOUT (< 768px) — a genuinely separate design, built for the
   3 rows requested (Top: avatar+greeting+name+badge / Middle:
   motivational message / Bottom: date+time+button), not a shrunk copy
   of the desktop row. Reorders the exact same three existing elements
   (.bbb-phero-left, .bbb-phero-center, .bbb-phero-right) top-to-bottom
   and restyles their internals so every piece of text has room to
   render in full — no ellipsis needed anywhere on mobile, no overlap.
   ========================================================================== */
/* v1.21.9 mobile spacing/alignment refinement
 * - Reduce the Header → Dynamic Hero breathing room without touching the header.
 * - Keep the date/time glass card visually centered inside the Hero.
 */
@media (max-width: 767px) {
	.db-page { padding-top: 6px; }
	.bbb-phero-right { display: flex; justify-content: center; width: 100%; }
	.bbb-phero-glass { margin-left: auto; margin-right: auto; }
}


@media (max-width: 767px) {
	/* Mobile Hero: reduce the existing 200px card by exactly 20% -> 160px.
	 * Internal layout is proportionally scaled so the existing content/design
	 * stays intact instead of being vertically clipped. */
	.db-hero.bbb-phero { min-height: 160px; height: 160px; }

	.bbb-phero-row {
		flex-direction: column;
		align-items: stretch;
		justify-content: center;
		gap: 8px;
		padding: 14px 14px;
		transform: scale(.8);
		transform-origin: center center;
		width: 125%;
		margin-left: -12.5%;
	}

	/* ---- Top row: avatar + greeting + name + blood-group badge ---- */
	.bbb-phero-left {
		order: 1;
		flex: none;
		display: flex;
		align-items: center;
		gap: 10px;
		min-width: 0;
	}
	.bbb-phero-avatar { width: 40px; height: 40px; border-width: 2px; }
	.bbb-phero-online { width: 10px; height: 10px; }
	.bbb-phero-left-text {
		flex: 1 1 auto;
		min-width: 0;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		column-gap: 8px;
		row-gap: 3px;
	}
	.bbb-phero-greeting {
		flex: 1 1 100%;
		font-size: 10.5px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.bbb-phero-name {
		margin: 0;
		font-size: 15px;
		line-height: 1.2;
		max-width: none;         /* no truncation on mobile */
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
		flex: 0 1 auto;
	}
	.bbb-phero-badge {
		font-size: 10px;
		padding: 3px 8px;
		flex: none;
	}

	/* ---- Middle row: motivational message, its own dedicated line ---- */
	.bbb-phero-center {
		order: 2;
		width: 100%;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		gap: 8px;
	}
	.bbb-phero-medallion-svg { width: 30px; height: 30px; flex: none; }
	.bbb-phero-message {
		flex: 1 1 auto;
		min-width: 0;
		max-width: none;
		text-align: left;
		font-size: 10.5px;
		line-height: 1.3;
		min-height: 0;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	/* ---- Bottom row: date, time, profile button — one line, all
	   three items visible, button never wraps its label. ---- */
	.bbb-phero-right {
		order: 3;
		width: 100%;
	}
	.bbb-phero-glass {
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		row-gap: 4px;
		column-gap: 6px;
		min-width: 0;
		width: 100%;
		padding: 7px 8px 7px 10px;
		border-radius: 18px;
	}
	.bbb-phero-glass-row {
		font-size: 11px; /* DIAGNOSTIC: matched to .db-cal-line-bn (was 9px) */
		gap: 3px;
		flex: 0 1 auto;
		min-width: 0;
		overflow: visible;
		text-overflow: clip;
		white-space: normal;
	}
	.bbb-phero-glass-row svg { width: 10px; height: 10px; }
	/* Date row gets a bullet separator instead of the time row's own
	   live-dot margin-left:auto trick (that only worked in a column). */
	.bbb-phero-glass-row:first-child::after {
		content: '•';
		margin-left: 6px;
		opacity: .55;
		flex: none;
	}
	.bbb-phero-live-dot { margin-left: 0; }
	.bbb-phero-btn {
		margin-top: 0;
		margin-left: auto;
		flex: none;
		padding: 7px 12px;
		font-size: 10px;
		gap: 4px;
		white-space: nowrap;
	}
}

/* Small-phone refinement — same mobile layout, just a touch tighter so
   the bottom row's date+time+button never crowd on ~320–360px screens. */
@media (max-width: 359px) {
	.bbb-phero-row { padding: 12px 10px; gap: 6px; }
	.bbb-phero-avatar { width: 36px; height: 36px; }
	.bbb-phero-name { font-size: 13.5px; }
	.bbb-phero-greeting { font-size: 10px; }
	.bbb-phero-badge { font-size: 9px; padding: 3px 7px; }
	.bbb-phero-medallion-svg { width: 26px; height: 26px; }
	.bbb-phero-message { font-size: 9.5px; -webkit-line-clamp: 2; }
	.bbb-phero-glass-row { font-size: 11px; } /* DIAGNOSTIC: matched to .db-cal-line-bn (was 8.5px) */
	.bbb-phero-glass { column-gap: 5px; padding: 6px 7px 6px 9px; }
	.bbb-phero-btn span { display: none; } /* icon-only button, only at the very smallest widths */
	.bbb-phero-btn { padding: 7px 9px; }
}

/* Slider wrapper interop: initHeroSlider() only toggles .is-active on
   .db-hero-slide and replays the .db-hero-anim-* entrance class — both
   already apply to .bbb-phero sections untouched, so no extra rule is
   needed here beyond what app.css already defines for those classes. */

/* Live location-aware temperature — appended to the existing Bangla date
   line only; no Hero layout dimensions or other components are changed. */
.bbb-phero-weather {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
	margin-left: 5px;
	font-family: 'Hind Siliguri', var(--font-bn, sans-serif);
	font-weight: 700;
}
.bbb-phero-weather-sep { opacity: .78; margin-right: 1px; }


/* v1.21.10 mobile hero glass-card centering correction
 * Keep the existing 160px Hero and all internal content unchanged.
 * The information card is centered within the Hero instead of drifting
 * to one side on mobile. */
@media (max-width: 767px) {
	.bbb-phero-right {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
	.bbb-phero-glass {
		box-sizing: border-box;
		width: calc(100% - 24px);
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
}
