/* GB AI Summary – nút & popup */

.gbais-wrap {
	margin: var(--gbais-margin, 0 0 1.2em);
	display: flex;
}
.gbais-align-center { justify-content: center; }
.gbais-align-right  { justify-content: flex-end; }
.gbais-align-full .gbais-btn,
.gbais-align-full .gbais-btn-inner { width: 100%; justify-content: center; }

/* ---------- Nút: reset style mặc định của theme (Flatsome) ---------- */
.gbais-wrap .gbais-btn {
	--gbais-border: 2px;
	--gbais-speed: 3.5s;
	position: relative;
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	padding: var(--gbais-border);
	min-height: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--gbais-text, #1a1a2e);
	font: inherit;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	-webkit-tap-highlight-color: transparent;
	transition: transform .2s ease, box-shadow .3s ease;
}

/* Lớp gradient phía sau, lộ ra thành viền */
.gbais-wrap .gbais-btn::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 50%;
	left: 50%;
	width: max(250%, 320px);
	aspect-ratio: 1;
	background: conic-gradient(
		from 0deg,
		var(--gbais-c1, #00c6ff),
		var(--gbais-c2, #7b2ff7),
		var(--gbais-c3, #ff3cac),
		var(--gbais-c1, #00c6ff)
	);
	transform: translate(-50%, -50%);
}

.gbais-btn-inner {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .7em 1.4em;
	border-radius: inherit;
	background: var(--gbais-bg, #fff);
	color: var(--gbais-text, #1a1a2e);
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	transition: background .25s ease;
}
.gbais-size-sm .gbais-btn-inner { font-size: 13px; padding: .55em 1.1em; }
.gbais-size-lg .gbais-btn-inner { font-size: 17px; padding: .85em 1.8em; }

.gbais-icon {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	fill: var(--gbais-c2, #7b2ff7);
}

.gbais-wrap .gbais-btn:hover { transform: translateY(-1px); }
.gbais-wrap .gbais-btn:active { transform: translateY(0) scale(.98); }
.gbais-wrap .gbais-btn:focus-visible { outline: 2px solid var(--gbais-c2, #7b2ff7); outline-offset: 3px; }

/* ---------- Hiệu ứng viền ---------- */
.gbais-fx-rotate::before,
.gbais-fx-glow::before {
	animation: gbais-spin var(--gbais-speed) linear infinite;
}

.gbais-fx-glow {
	animation: gbais-glow 2.4s ease-in-out infinite;
}

.gbais-fx-shine .gbais-btn-inner::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
	transform: skewX(-20deg);
	animation: gbais-shine 3s ease-in-out infinite;
	pointer-events: none;
}
.gbais-fx-shine::before { animation: gbais-spin 10s linear infinite; }

.gbais-fx-pulse::before { animation: gbais-spin 6s linear infinite; }
.gbais-fx-pulse { animation: gbais-pulse 1.8s ease-out infinite; }

/* Đang tải: viền xoay nhanh */
.gbais-wrap .gbais-btn.is-loading { --gbais-speed: .9s; pointer-events: none; }
.gbais-wrap .gbais-btn.is-loading::before { animation: gbais-spin var(--gbais-speed) linear infinite; }

@keyframes gbais-spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes gbais-glow {
	0%, 100% { box-shadow: 0 0 6px -2px var(--gbais-c1, #00c6ff), 0 0 14px -6px var(--gbais-c2, #7b2ff7); }
	50%      { box-shadow: 0 0 16px 0 var(--gbais-c2, #7b2ff7), 0 0 28px -4px var(--gbais-c3, #ff3cac); }
}
@keyframes gbais-shine {
	0%, 55% { left: -60%; }
	100%    { left: 130%; }
}
@keyframes gbais-pulse {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gbais-c2, #7b2ff7) 55%, transparent); }
	100% { box-shadow: 0 0 0 12px transparent; }
}

/* ---------- Popup ---------- */
html.gbais-lock { overflow: hidden; }

.gbais-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	visibility: hidden;
	opacity: 0;
	transition: opacity .25s ease, visibility 0s linear .25s;
}
.gbais-modal.is-open {
	visibility: visible;
	opacity: 1;
	transition: opacity .25s ease;
}
.gbais-overlay {
	position: absolute;
	inset: 0;
	background: rgba(12, 14, 28, .6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
.gbais-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 660px;
	max-height: min(86vh, 820px);
	background: #fff;
	color: #222;
	border-radius: 18px;
	box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .35);
	overflow: hidden;
	transform: translateY(18px) scale(.97);
	transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
}
.gbais-modal.is-open .gbais-dialog { transform: none; }

/* Dải gradient phía trên popup */
.gbais-dialog::before,
.gbais-mfp::before {
	content: "";
	display: block;
	height: 4px;
	flex: none;
	background: linear-gradient(90deg, var(--gbais-c1, #00c6ff), var(--gbais-c2, #7b2ff7), var(--gbais-c3, #ff3cac), var(--gbais-c1, #00c6ff));
	background-size: 300% 100%;
	animation: gbais-bar 6s linear infinite;
}
@keyframes gbais-bar { to { background-position: 300% 0; } }

.gbais-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
}
.gbais-head-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--gbais-c1, #00c6ff), var(--gbais-c2, #7b2ff7));
}
.gbais-head-icon svg { width: 18px; height: 18px; fill: #fff; }
.gbais-title {
	flex: 1;
	margin: 0 !important;
	padding: 0;
	font-size: 18px;
	line-height: 1.3;
	color: inherit;
}
.gbais-close {
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	flex: none;
	border: 0;
	border-radius: 50%;
	background: #f2f2f5;
	color: #555;
	font-size: 22px;
	line-height: 36px;
	text-align: center;
	cursor: pointer;
	transition: background .2s;
}
.gbais-close:hover { background: #e4e4ea; color: #111; }

.gbais-body {
	padding: 20px 22px;
	overflow-y: auto;
	overscroll-behavior: contain;
	font-size: 16px;
	line-height: 1.65;
}
.gbais-summary p { margin: 0 0 .8em; }
.gbais-summary h4 { margin: 1em 0 .5em; font-size: 1.05em; }
.gbais-summary ul { margin: 0 0 .6em; padding: 0; list-style: none; }
.gbais-summary li {
	position: relative;
	margin: 0 0 .65em;
	padding-left: 1.6em;
}
.gbais-summary li::before {
	content: "";
	position: absolute;
	left: .2em;
	top: .55em;
	width: .55em;
	height: .55em;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--gbais-c1, #00c6ff), var(--gbais-c2, #7b2ff7));
}
.gbais-summary strong { color: #111; }
.gbais-summary a {
	color: var(--gbais-c2, #7b2ff7);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color .2s;
}
.gbais-summary a:hover { color: var(--gbais-c3, #ff3cac); }
.gbais-summary > * { animation: gbais-in .4s ease both; }
@keyframes gbais-in { from { opacity: 0; transform: translateY(6px); } }

.gbais-disclaimer {
	margin: 1em 0 0 !important;
	font-size: 12.5px;
	color: #888;
	font-style: italic;
}

.gbais-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	border-top: 1px solid #eee;
	font-size: 13px;
	color: #777;
}
.gbais-foot:empty { display: none; }
.gbais-copy,
.gbais-retry {
	margin: 0;
	padding: 7px 16px;
	min-height: 0;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-size: 13px;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}
.gbais-copy:hover,
.gbais-retry:hover { border-color: var(--gbais-c2, #7b2ff7); color: var(--gbais-c2, #7b2ff7); }
.gbais-copy[hidden] { display: none; }

/* Trạng thái tải */
.gbais-loading { text-align: center; color: #666; }
.gbais-loading p { margin: 10px 0 18px; font-size: 14px; }
.gbais-dots { display: inline-flex; gap: 6px; }
.gbais-dots span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gbais-c2, #7b2ff7);
	animation: gbais-bounce 1s ease-in-out infinite;
}
.gbais-dots span:nth-child(2) { background: var(--gbais-c1, #00c6ff); animation-delay: .15s; }
.gbais-dots span:nth-child(3) { background: var(--gbais-c3, #ff3cac); animation-delay: .3s; }
@keyframes gbais-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.gbais-skeleton { text-align: left; }
.gbais-skeleton i {
	display: block;
	height: 12px;
	margin: 0 0 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, #f0f0f3 25%, #e2e2e8 37%, #f0f0f3 63%);
	background-size: 400% 100%;
	animation: gbais-shimmer 1.4s ease infinite;
}
.gbais-skeleton i:nth-child(1) { width: 92%; }
.gbais-skeleton i:nth-child(2) { width: 78%; }
.gbais-skeleton i:nth-child(3) { width: 85%; }
.gbais-skeleton i:nth-child(4) { width: 60%; }
@keyframes gbais-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.gbais-error { text-align: center; padding: 10px 0; }
.gbais-error p { margin: 0 0 14px; color: #b42318; }

/* Popup Flatsome (Magnific Popup) */
.gbais-mfp {
	position: relative;
	max-width: 660px;
	margin: 0 auto;
	padding: 0 !important;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
}
.gbais-mfp .gbais-head { padding-right: 50px; }
.gbais-mfp .gbais-body { max-height: 65vh; }

/* Mobile: popup dạng bottom sheet */
@media (max-width: 599px) {
	.gbais-modal { align-items: flex-end; padding: 0; }
	.gbais-dialog {
		max-width: none;
		max-height: 88vh;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
	}
	.gbais-body { padding: 16px 18px; font-size: 15.5px; }
	.gbais-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
	.gbais-wrap .gbais-btn,
	.gbais-wrap .gbais-btn::before,
	.gbais-btn-inner::after,
	.gbais-dialog::before,
	.gbais-mfp::before,
	.gbais-summary > * { animation: none !important; }
}
