/* ==========================================================================
   MENU TRÒN GÓC TRÊN CÙNG BÊN PHẢI (TOP-RIGHT SPEED DIAL)
   Chứa 2 nút tròn: Nút Xem (Thống Kê Lượt Truy Cập) & Nút Dịch (Đa Ngôn Ngữ)
   ========================================================================== */

/* 1. KHUNG CHỨA MENU TRÒN GÓC TRÊN BÊN PHẢI */
.menu-top-right-container {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 2147483640;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: auto;
}

/* Đảm bảo luôn nổi trên cùng khi bật Fullscreen */
:fullscreen .menu-top-right-container,
:-webkit-full-screen .menu-top-right-container,
:-moz-full-screen .menu-top-right-container,
:-ms-fullscreen .menu-top-right-container {
	position: fixed !important;
	top: 24px !important;
	right: 24px !important;
	z-index: 2147483647 !important;
	display: flex !important;
}

/* 2. NÚT CHÍNH TRÒN GÓC TRÊN BÊN PHẢI */
.menu-top-right-main-btn {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0ea5e9, #2563eb);
	border: 1px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
	color: #ffffff;
	cursor: pointer;
	outline: none;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	position: relative;
}

.menu-top-right-main-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 25px rgba(14, 165, 233, 0.65), 0 3px 8px rgba(0, 0, 0, 0.4);
}

.menu-top-right-main-btn:active {
	transform: scale(0.95);
}

/* Icon bên trong nút chính */
.menu-top-right-icon {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Khi menu mở (Active): Nút đổi sang màu đỏ và xoay thành dấu ✕ */
.menu-top-right-container.active .menu-top-right-main-btn {
	background: linear-gradient(135deg, #ef4444, #b91c1c);
	box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.menu-top-right-container.active .menu-top-right-icon {
	transform: rotate(135deg);
}

/* 3. DANH SÁCH CÁC NÚT CON SỔ XUỐNG DƯỚI */
.menu-top-right-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	margin: 0;
	list-style: none;
	pointer-events: none;
}

/* Khi mở menu: Cho phép tương tác với 2 nút con */
.menu-top-right-container.active .menu-top-right-list {
	pointer-events: auto;
}

/* Từng mục nút con */
.menu-top-right-item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	opacity: 0;
	transform: translateY(-20px) scale(0.5);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Nút bấm con tròn */
.menu-top-right-sub-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(18, 24, 38, 0.88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #e2e8f0;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	outline: none;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: all 0.25s ease;
	position: relative;
}

.menu-top-right-sub-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.25s ease;
}

.menu-top-right-sub-btn:hover {
	transform: scale(1.12);
	background: rgba(30, 41, 59, 0.95);
	border-color: #38bdf8;
	color: #38bdf8;
	box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

.menu-top-right-sub-btn:hover svg {
	transform: scale(1.1);
}

.menu-top-right-sub-btn:active {
	transform: scale(0.92);
}

/* Chấm xanh phát sáng báo hiệu online cho nút thống kê */
.menu-top-right-item.is-live-dot::after {
	content: '';
	position: absolute;
	top: -1px;
	right: -1px;
	width: 10px;
	height: 10px;
	background: #22c55e;
	border-radius: 50%;
	border: 1.5px solid #0f172a;
	box-shadow: 0 0 10px #22c55e, 0 0 4px #22c55e;
	z-index: 10005;
	pointer-events: none;
	animation: liveDotPulse 1.8s infinite ease-in-out;
}

@keyframes liveDotPulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.25); opacity: 0.8; }
}

/* Tooltip giải thích nằm bên trái nút */
.menu-top-right-tooltip {
	position: absolute;
	right: 52px;
	background: rgba(15, 23, 42, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #f8fafc;
	font-size: 12px;
	font-weight: 500;
	padding: 5px 10px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	white-space: nowrap;
	opacity: 0;
	transform: translateX(8px);
	pointer-events: none;
	transition: all 0.25s ease;
}

.menu-top-right-item:hover .menu-top-right-tooltip {
	opacity: 1;
	transform: translateX(0);
}

/* Hiệu ứng bung lần lượt 2 nút con */
.menu-top-right-container.active .menu-top-right-item {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.menu-top-right-container.active .menu-top-right-item:nth-child(1) {
	transition-delay: 0.04s;
}

.menu-top-right-container.active .menu-top-right-item:nth-child(2) {
	transition-delay: 0.08s;
}

/* 4. RESPONSIVE ĐIỆN THOẠI DI ĐỘNG */
@media screen and (max-width: 768px) {
	.menu-top-right-container {
		top: calc(18px + env(safe-area-inset-top, 0px));
		right: calc(16px + env(safe-area-inset-right, 0px));
		gap: 8px;
	}

	.menu-top-right-main-btn {
		width: 46px;
		height: 46px;
	}

	.menu-top-right-sub-btn {
		width: 38px;
		height: 38px;
	}

	.menu-top-right-sub-btn svg {
		width: 16px;
		height: 16px;
	}

	.menu-top-right-tooltip {
		right: 46px;
		font-size: 11px;
		padding: 4px 8px;
	}
}
