/* =============================================
   CLIENT PORTAL
   ============================================= */

/* Pulsing dot for coming soon */
.bsa-pulse-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e67e22;
	flex-shrink: 0;
	animation: bsa-pulse 2s ease-in-out infinite;
}

@keyframes bsa-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%       { opacity: 0.35; transform: scale(0.75); }
}

/* =============================================
   LEGACY sub-banner (keep for account page)
   ============================================= */

.bsa-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: var(--bsa-radius, 10px);
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bsa-badge--active   { background: rgba(39, 174, 96, 0.18);  color: #27ae60; }
.bsa-badge--expiring { background: rgba(230, 126, 34, 0.18); color: #d35400; }
.bsa-badge--expired  { background: rgba(192,  57, 43, 0.14); color: #c0392b; }

/* =============================================
   ACCOUNT PAGE
   ============================================= */

/* Resource list — scrollable */
.bsa-resource-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
}

/* Clickable resource items */
button.bsa-resource-item {
	position: relative;
	display: block;
	width: 100%;
	text-align: left;
	background: #FAFBFC;
	border: none;
	border-bottom: 1px solid #F4F5F7;
	border-left: 3px solid transparent;
	padding: 0.95rem 1.1rem 0.95rem 1rem;
	padding-right: 2.8rem;
	cursor: pointer;
	transition: background 0.1s, border-left-color 0.1s;
	line-height: 1.4;
}

button.bsa-resource-item:last-child { border-bottom: none; }

button.bsa-resource-item:hover {
	background: #EFF4F9;
	border-left-color: #A8C4DE;
}

button.bsa-resource-item.is-active {
	background: #E6EFF7;
	border-left-color: #2C5F8A;
}

.bsa-resource-item__meta {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.25rem;
}

.bsa-resource-item__period {
	font-size: 0.875rem;
	color: #6B7C8D;
}

.bsa-resource-item__badge {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: #6B7C8D;
	background: transparent;
	border: 1px solid #C8D0D8;
	padding: 0.1rem 0.42rem;
	border-radius: var(--bsa-radius, 10px);
}

.bsa-resource-item__title {
	font-size: 1rem;
	font-weight: 500;
	color: #0F1F38;
	line-height: 1.4;
}

.bsa-resource-favorite {
	position: absolute;
	top: 0.85rem;
	right: 0.8rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	color: #9AA8B5;
	cursor: pointer;
	transition: color 0.15s, background 0.15s, transform 0.15s;
}

.bsa-resource-favorite svg {
	width: 17px;
	height: 17px;
}

.bsa-resource-favorite:hover,
.bsa-resource-favorite:focus-visible {
	background: #E6EFF7;
	color: #2C5F8A;
	outline: none;
}

.bsa-resource-favorite.is-favourite {
	color: #D97706;
}
.bsa-resource-favorite.is-favourite svg {
	fill: currentColor;
}

.bsa-resource-favorite.is-favourite:hover,
.bsa-resource-favorite.is-favourite:focus-visible {
	color: #B45309;
}

button.bsa-resource-item.is-active .bsa-resource-item__title {
	color: #2C5F8A;
	font-weight: 600;
}

/* Resource type icon — small inline SVG before the badge */
.bsa-resource-item__type-icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	color: #6B7C8D;
	line-height: 0;
}

button[data-ct="pdf"]         .bsa-resource-item__type-icon { color: #C0392B; }
button[data-ct="video"]       .bsa-resource-item__type-icon { color: #7D3C98; }
button[data-ct="calc"]        .bsa-resource-item__type-icon { color: #27AE60; }
button[data-ct="diagnostic"]  .bsa-resource-item__type-icon { color: #D35400; }
button[data-ct="url"]         .bsa-resource-item__type-icon { color: #2980B9; }

.bsa-resource-list-empty {
	padding: 2rem 1rem;
	text-align: center;
	color: #6B7C8D;
	font-size: 0.875rem;
	font-style: italic;
}

/* All viewer states — hidden by default, shown via .is-active */
.bsa-viewer-state,
.bsa-calc-panel {
	display: none;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.bsa-viewer-state.is-active,
.bsa-calc-panel.is-active {
	display: flex;
}

.bsa-viewer-state--fill.is-active { height: 100%; }

/* Default / placeholder */
.bsa-viewer-placeholder {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	text-align: center;
}

.bsa-viewer-placeholder__icon {
	width: 80px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #EFF4F9;
	border-radius: 50%;
	margin-bottom: 1.25rem;
	flex-shrink: 0;
}

.bsa-viewer-placeholder__title {
	font-size: 1rem;
	font-weight: 600;
	color: #0F1F38;
	margin: 0 0 0.45rem;
	letter-spacing: 0;
	text-transform: none;
}

.bsa-viewer-placeholder p,
.bsa-viewer-placeholder__text {
	font-size: 0.875rem;
	color: #6B7C8D;
	margin: 0 0 1.35rem;
	max-width: 260px;
	line-height: 1.55;
}

/* Viewer header bar */
.bsa-viewer__header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.95rem 1.25rem;
	background: linear-gradient(100deg, #050E1A 0%, #0F1F38 50%, #1A3A5C 100%);
	border-bottom: 3px solid #2C5F8A;
	color: #FFFFFF;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
}

/* Subtle right-side radial glow */
.bsa-viewer__header::after {
	content: '';
	position: absolute;
	right: 1.5rem;
	top: 50%;
	transform: translateY(-50%);
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: radial-gradient(circle at center, rgba(44, 95, 138, 0.28) 0%, transparent 70%);
	pointer-events: none;
}

/* Resource-type badge inside header */
.bsa-viewer__badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: #A8C4DE;
	background: rgba(44, 95, 138, 0.4);
	border: 1px solid rgba(168, 196, 222, 0.25);
	border-radius: var(--bsa-radius, 10px);
	padding: 0.12rem 0.55rem;
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1.6;
	position: relative;
	z-index: 1;
}

.bsa-viewer__back {
	display: none;
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: var(--bsa-radius, 10px);
	color: rgba(255,255,255,0.8);
	font-size: 0.875rem;
	cursor: pointer;
	padding: 0.2rem 0.55rem;
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1.5;
	transition: all 0.12s;
}

.bsa-viewer__back:hover {
	background: rgba(255,255,255,0.1);
	color: #FFFFFF;
}

.bsa-viewer__title {
	font-size: var(--bsa-fs-sm);
	font-weight: 700;
	color: #FFFFFF;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	flex: 1;
	min-width: 0;
	position: relative;
	z-index: 1;
}

/* Viewer content area */
.bsa-viewer__content {
	flex: 1;
	position: relative;
	overflow: hidden;
	min-height: 0;
	background: #404040;
}

.bsa-viewer__content--video { background: #000; }

.bsa-viewer__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

.bsa-resource-suggestions {
	position: absolute;
	top: calc(100% + 0.4rem);
	left: 0;
	right: 0;
	z-index: 20;
	max-height: 320px;
	overflow-y: auto;
	background: #FFFFFF;
	border: 1px solid #D6E0E8;
	border-radius: var(--bsa-radius, 10px);
	box-shadow: 0 12px 28px rgba(15,31,56,0.18);
	padding: 0.25rem;
}

.bsa-resource-suggestion {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 0;
	border-radius: var(--bsa-radius, 10px);
	background: transparent;
	color: #1A2E44;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.bsa-resource-suggestion:hover,
.bsa-resource-suggestion:focus-visible {
	background: #EFF4F9;
	outline: none;
}

.bsa-resource-suggestion__title {
	font-size: 0.875rem;
	font-weight: 600;
}

.bsa-resource-suggestion__type {
	font-size: 0.72rem;
	color: #6B7C8D;
	text-transform: capitalize;
}

.bsa-resource-suggestions__empty {
	padding: 0.75rem;
	font-size: 0.8rem;
	color: #6B7C8D;
}

/* ---- Col 1: All Resources ---- */

.bsa-portal-col1 {
	display: flex;
	flex-direction: column;
	background: #cfcfcf;
	overflow: hidden;
	border-radius: var(--bsa-radius, 10px);
}

.bsa-resource-list--favourites {
	flex: 0 1 42%;
	min-height: 70px;
	border-bottom: 1px solid #B8C5D0;
}

.bsa-resource-list-empty--favourites {
	padding: 1rem;
	background: #F4F7FA;
}

/* ---- Col 3: Viewer ---- */

.bsa-portal-col3 {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #F8F9FB;
	border-radius: var(--bsa-radius, 10px);
}

/* =============================================
   PORTAL V3 RESPONSIVE
   ============================================= */

/* Tablet 2-col: All Resources (left) + Viewer (right); Recommended stacks below col1 */
@media (min-width: 782px) and (max-width: 1100px) {

	/* ---- Portal grid: 2-col with fixed Recommended row so it always shows ---- */

	.bsa-portal-col1 {
		grid-column: 1;
		grid-row: 1;
	}

	.bsa-portal-col3 {
		grid-column: 2;
		grid-row: 1 / 3;
	}

}

@media (max-width: 781px) {

	.bsa-portal-col1.is-mobile-library-hidden,
	.bsa-resource-list.is-mobile-library-hidden {
		display: none;
	}

	/* ---- Client bar: mobile hamburger layout ---- */

	/* Col1 fills all remaining space — Col2 sizes to content below it */
	.bsa-portal-col1 {
		flex: 1 1 0;
		min-height: 0;
		border-right: none;
		border-bottom: 1px solid #E8ECEF;
		overflow: hidden;
		border-radius: 0;
	}

	.bsa-portal-col3 {
		display: none;
		flex: 1;
		min-height: 0;
		height: auto;
		border-radius: 0;
	}

	.bsa-portal-col1.is-hidden { display: none; }

	.bsa-portal-col3.is-visible { display: flex; }

	/* Viewer back button */
	.bsa-viewer__back { display: block; }

	/* Resource items — larger touch targets */
	button.bsa-resource-item { padding: 0.9rem 1rem; }

	/* ---- Viewer slide-in animation ---- */
	@keyframes bsa-viewer-slide-in {
		from { opacity: 0; transform: translateX(20px); }
		to   { opacity: 1; transform: translateX(0); }
	}

	.bsa-portal-col3.is-visible {
		animation: bsa-viewer-slide-in 0.22s ease-out both;
	}

	button.bsa-resource-item--rec {
		flex: 0 0 clamp(155px, 44vw, 200px);
		border-bottom: none;
		border-right: 1px solid #F4F5F7;
		min-height: 0;
	}

	button.bsa-resource-item--rec:last-child { border-right: none; }

	/* ---- PDF mobile fallback ---- */
	.bsa-pdf-mobile-link { display: flex; }

	/* ---- Viewer header: hide badge on mobile (title already identifies content) ---- */
	.bsa-viewer__badge { display: none !important; }

	/* ---- Viewer header title: wrap freely now that badge is hidden ---- */
	.bsa-viewer__title {
		white-space: normal !important;
		overflow: visible !important;
		text-overflow: clip !important;
		font-size: 0.8125rem;
		text-align: left;
		line-height: 1.3;
	}

}

.bsa-form-success {
	background: rgba(39, 174, 96, 0.1);
	border: 1px solid rgba(39, 174, 96, 0.3);
	color: #27ae60;
	border-radius: var(--bsa-radius, 10px);
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.bsa-form-error {
	background: rgba(192, 57, 43, 0.1);
	border: 1px solid rgba(192, 57, 43, 0.3);
	color: #c0392b;
	border-radius: var(--bsa-radius, 10px);
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

