/* ==========================================================================
   Announcement bell -- header/nav notification icon + dropdown.
   Loaded site-wide (csstemplate.jsp) since the bell appears in both
   header.jsp and profile-header.jsp, desktop nav and mobile sticky bar.
   Shares the --lms-navy / --lms-ink / --lms-line tokens used by the
   redesigned "lms-" pages (see online-course-enhancements.css) but defines
   its own copies so it renders correctly even on pages that don't opt into
   that stylesheet (e.g. home.html).
   ========================================================================== */

.announcement-bell {
	--lms-navy: #2D368F;
	--lms-ink: #0f172a;
	--lms-muted: #64748b;
	--lms-line: rgba(15, 23, 42, 0.08);
	position: relative;
	flex: none;
}

.announcement-bell-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: none;
	background: #f1f2fa;
	border-radius: 50%;
	color: var(--lms-navy);
	font-size: 18px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.announcement-bell-btn:hover,
.announcement-bell-btn:focus {
	background: #e4e7f7;
	outline: none;
}

.announcement-bell-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: #e11d48;
	color: #ffffff;
	font-size: 10px;
	line-height: 17px;
	font-weight: 800;
	text-align: center;
	box-shadow: 0 0 0 2px #ffffff;
}

.announcement-bell-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 380px;
	max-width: 92vw;
	max-height: 520px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid var(--lms-line);
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
	z-index: 9999;
	text-align: left;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.announcement-bell.active .announcement-bell-dropdown {
	display: flex;
	flex-direction: column;
}

.announcement-bell-dropdown__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--lms-line);
	background: #ffffff;
}

.announcement-bell-dropdown__heading {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.announcement-bell-dropdown__title {
	font-size: 15px;
	font-weight: 800;
	color: var(--lms-ink);
}

.announcement-bell-dropdown__count {
	display: inline-flex;
	align-items: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	background: #eef0fb;
	color: var(--lms-navy);
	font-size: 11px;
	font-weight: 800;
}

.announcement-bell-markall {
	border: none;
	background: transparent;
	color: var(--lms-navy);
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	white-space: nowrap;
}

.announcement-bell-markall:hover {
	text-decoration: underline;
}

.announcement-bell-list {
	padding: 6px 0;
	overflow-y: auto;
	max-height: 360px;
}

.announcement-bell-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 16px 12px 18px;
	text-decoration: none !important;
	color: var(--lms-ink);
	transition: background-color 0.15s ease;
}

.announcement-bell-item::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	bottom: 10px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--lms-navy);
	opacity: 0;
}

.announcement-bell-item.is-unread::before {
	opacity: 1;
}

.announcement-bell-item.is-unread {
	background: #f7f8fd;
}

.announcement-bell-item:hover {
	background: #f1f3fb;
}

.announcement-bell-item__thumb {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	overflow: hidden;
	background: linear-gradient(135deg, #eef0fb, #e4e8fa);
}

.announcement-bell-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.announcement-bell-item__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding-right: 8px;
}

.announcement-bell-item__title {
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.announcement-bell-item.is-unread .announcement-bell-item__title {
	font-weight: 800;
}

.announcement-bell-item__snippet {
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--lms-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.announcement-bell-item__date {
	font-size: 11.5px;
	color: var(--lms-muted);
	font-weight: 600;
}

.announcement-bell-item__dot {
	flex: none;
	width: 8px;
	height: 8px;
	margin-top: 6px;
	border-radius: 50%;
	background: var(--lms-navy);
	opacity: 0;
}

.announcement-bell-item.is-unread .announcement-bell-item__dot {
	opacity: 1;
}

.announcement-bell-message {
	display: none;
	padding: 36px 20px;
	text-align: center;
	font-size: 13px;
	color: var(--lms-muted);
}

.announcement-bell-empty {
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.announcement-bell-empty__icon {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #eef0fb;
	color: var(--lms-navy);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	margin-bottom: 6px;
}

.announcement-bell-empty strong {
	display: block;
	color: var(--lms-ink);
	font-size: 14px;
	font-weight: 800;
}

.announcement-bell-message.is-visible {
	display: block;
}

.announcement-bell-empty.is-visible {
	display: flex;
}

.announcement-bell-viewall {
	display: block;
	padding: 13px 18px;
	text-align: center;
	font-size: 13px;
	font-weight: 800;
	color: var(--lms-navy) !important;
	text-decoration: none !important;
	border-top: 1px solid var(--lms-line);
	background: #ffffff;
}

.announcement-bell-viewall:hover {
	background: #f5f6fb;
}

/* ---------- mobile sticky-bar instance ---------- */

.mobile-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

@media only screen and (max-width: 991.98px) {
	.mobile-header-actions .announcement-bell {
		position: relative;
		z-index: 30;
	}

	.mobile-header-actions .announcement-bell-dropdown {
		position: fixed;
		top: 108px;
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
		max-height: min(70vh, 480px);
		z-index: 2000;
	}
}

@media only screen and (max-width: 480px) {
	.announcement-bell-dropdown {
		width: 92vw;
		right: -8px;
	}

	.mobile-header-actions .announcement-bell-dropdown {
		width: auto;
		right: 12px;
	}
}
