/* ==========================================================================
   LOGO TRUNG TÂM TRÊN CÙNG (TOP-CENTER LOGO)
   Tích hợp hiệu ứng lóe sáng Light Sweep CHẠY CHÍNH XÁC THEO HÌNH DÁNG CHỮ / LOGO (KHÔNG ĐÓNG KHUNG)
   Cân đối chuẩn trên màn hình máy tính lớn, tablet và điện thoại di động
   ========================================================================== */

/* 1. KHUNG CHỨA TOÀN BỘ LOGO (MẶC ĐỊNH - MÀN HÌNH MÁY TÍNH / DESKTOP >= 769px) */
.top-center-logo {
	position: fixed;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2147483600;
	height: 50px; /* Khớp với chiều cao 50px của nút Menu Trái và Nút Phải */
	display: flex;
	align-items: center;
	justify-content: center;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: none; /* Tránh cản trở thao tác xoay 360 vùng xung quanh */
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Đảm bảo luôn hiển thị trên cùng khi bật chế độ Toàn màn hình (Fullscreen) */
:fullscreen .top-center-logo,
:-webkit-full-screen .top-center-logo,
:-moz-full-screen .top-center-logo,
:-ms-fullscreen .top-center-logo {
	position: fixed !important;
	top: 24px !important;
	left: 50% !important;
	transform: translateX(-50%) !important;
	z-index: 2147483600 !important;
	display: flex !important;
}

/* 2. KHUNG WRAPPER CỦA LOGO (KHÔNG KHUNG VIỀN - HOÀN TOÀN TRONG SUỐT) */
.top-center-logo-wrap,
a.top-center-logo-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	pointer-events: auto !important;
	cursor: pointer !important;
	text-decoration: none !important;
	outline: none;
	padding: 0;
	margin: 0;
	transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.top-center-logo-wrap:hover,
a.top-center-logo-wrap:hover {
	transform: scale(1.06);
	text-decoration: none;
}

.top-center-logo-wrap:active,
a.top-center-logo-wrap:active {
	transform: scale(0.96);
}

.top-center-logo-wrap:visited,
a.top-center-logo-wrap:visited {
	color: inherit;
	text-decoration: none;
}

/* 3. HÌNH ẢNH LOGO TRÊN MÁY TÍNH */
.top-center-logo-img {
	height: auto;
	width: auto;
	max-height: 80px; /* To rõ trên máy tính */
	max-width: 320px;
	object-fit: contain;
	display: block;
	-webkit-user-drag: none;
	filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
	transition: filter 0.35s ease;
}

.top-center-logo-wrap:hover .top-center-logo-img {
	filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 14px rgba(56, 189, 248, 0.45));
}

/* 4. LỚP MASK SHINE: CHỈ HIỆN ÁNH SÁNG TRÊN NÉT CHỮ / BIỂU TƯỢNG LOGO PNG (KHÔNG KHUNG) */
.top-center-logo-shine-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	-webkit-mask-image: url('../asset/logo.png');
	mask-image: url('../asset/logo.png');
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

/* Tia sáng quét qua bên trong nét chữ của Logo */
.top-center-logo-shine {
	position: absolute;
	top: -60%;
	left: -140%;
	width: 55%;
	height: 220%;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.3) 25%,
		rgba(255, 255, 255, 0.95) 50%,
		rgba(255, 255, 255, 0.3) 75%,
		rgba(255, 255, 255, 0) 100%
	);
	transform: rotate(25deg);
	pointer-events: none;
	box-shadow: 0 0 22px rgba(255, 255, 255, 0.9);
	animation: logoLightSweep 10s ease-in-out infinite;
}

/* Khi rê chuột vào logo: Tia sáng quét qua chậm rãi, mượt mà */
.top-center-logo-wrap:hover .top-center-logo-shine {
	animation: logoLightSweepHover 1.5s ease-in-out;
}

/* --- KEYFRAMES HIỆU ỨNG TIA SÁNG LÓE THEO CHỮ (QUÉT CHẬM TRONG ~2.8 GIÂY, LẶP LẠI MỖI 10S) --- */
@keyframes logoLightSweep {
	0% {
		left: -140%;
		opacity: 0;
	}
	3% {
		opacity: 1;
	}
	26% {
		opacity: 1;
	}
	28% {
		left: 150%;
		opacity: 0;
	}
	29%, 100% {
		left: 150%;
		opacity: 0;
	}
}

@keyframes logoLightSweepHover {
	0% {
		left: -140%;
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	90% {
		opacity: 1;
	}
	100% {
		left: 150%;
		opacity: 0;
	}
}

/* 5. MÀN HÌNH RỘNG / ĐỘ PHÂN GIẢI CAO (>= 1440px) */
@media screen and (min-width: 1440px) {
	.top-center-logo {
		top: 24px;
		height: 56px;
	}

	.top-center-logo-img {
		max-height: 90px;
		max-width: 380px;
	}
}

/* 6. MÀN HÌNH MÁY TÍNH BẢNG (TABLET / IPAD - 769px đến 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
	.top-center-logo {
		top: 20px;
		height: 48px;
	}

	.top-center-logo-img {
		max-height: 60px;
		max-width: 240px;
	}
}

/* 7. RESPONSIVE ĐIỆN THOẠI DI ĐỘNG (SMARTPHONE - <= 768px)
   Khóa khoảng cách left/right để logo luôn NẰM CHÍNH GIỮA KHOẢNG TRỐNG
   giữa Nút "Danh Mục" (Trái) và Nút Tròn Menu (Phải), không bị lệch hay đè nút */
@media screen and (max-width: 768px) {
	.top-center-logo {
		top: calc(18px + env(safe-area-inset-top, 0px));
		left: calc(146px + env(safe-area-inset-left, 0px));
		right: calc(66px + env(safe-area-inset-right, 0px));
		transform: none; /* Canh giữa đúng khoảng trống giữa 2 nút */
		height: 46px; /* Canh giữa trục dọc đồng bộ với nút tròn 46px */
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 4px;
		box-sizing: border-box;
	}

	:fullscreen .top-center-logo,
	:-webkit-full-screen .top-center-logo,
	:-moz-full-screen .top-center-logo,
	:-ms-fullscreen .top-center-logo {
		top: calc(18px + env(safe-area-inset-top, 0px)) !important;
		left: calc(146px + env(safe-area-inset-left, 0px)) !important;
		right: calc(66px + env(safe-area-inset-right, 0px)) !important;
		transform: none !important;
	}

	.top-center-logo-img {
		max-height: 34px;
		max-width: 100%;
		object-fit: contain;
		filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
	}
}

/* 8. ĐIỆN THOẠI MÀN HÌNH NHỎ (<= 380px) */
@media screen and (max-width: 380px) {
	.top-center-logo {
		left: calc(138px + env(safe-area-inset-left, 0px));
		right: calc(62px + env(safe-area-inset-right, 0px));
	}

	.top-center-logo-img {
		max-height: 28px;
	}
}

/* 9. ĐIỆN THOẠI XOAY NGANG (LANDSCAPE) */
@media screen and (max-height: 500px) and (orientation: landscape) {
	.top-center-logo {
		top: calc(8px + env(safe-area-inset-top, 0px));
		left: calc(140px + env(safe-area-inset-left, 0px));
		right: calc(60px + env(safe-area-inset-right, 0px));
		transform: none;
		height: 36px;
	}

	:fullscreen .top-center-logo,
	:-webkit-full-screen .top-center-logo,
	:-moz-full-screen .top-center-logo,
	:-ms-fullscreen .top-center-logo {
		top: calc(8px + env(safe-area-inset-top, 0px)) !important;
		left: calc(140px + env(safe-area-inset-left, 0px)) !important;
		right: calc(60px + env(safe-area-inset-right, 0px)) !important;
		transform: none !important;
	}

	.top-center-logo-img {
		max-height: 26px;
		max-width: 100%;
	}
}

/* Ẩn logo khi mở menu, popup hoặc thông báo */
.top-center-logo.hidden-under-menu {
	opacity: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
	z-index: -100 !important;
}
