/**
 * assets/summary.css
 * Slide-over Drawer chuẩn SaaS Y tế — tối giản, rõ ràng, responsive.
 */

/* ===== Nút kích hoạt ===== */
.fp-ai-summary-trigger-wrap {
	margin: 20px 0;
}
.fp-ai-summary-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: linear-gradient(135deg, #0f766e, #0d9488);
	color: #fff;
	border: none;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fp-ai-summary-trigger-btn:hover {
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.35);
	/* KHÔNG dùng scale() — đúng quy tắc thiết kế của theme (chỉ brightness/shadow). */
	filter: brightness(1.05);
}
.fp-ai-summary-trigger-icon {
	font-size: 16px;
}

/* ===== Backdrop ===== */
.fp-ai-summary-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(2px);
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.3s ease;
}
.fp-ai-summary-backdrop.is-open {
	opacity: 1;
}

/* ===== Drawer (slide từ phải sang) ===== */
.fp-ai-summary-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(420px, 100vw);
	background: #fff;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
	transform: translateX(100%);
	transition: transform 0.3s ease;
}
.fp-ai-summary-drawer.is-open {
	transform: translateX(0);
}

.fp-ai-summary-drawer__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 20px;
	border-bottom: 1px solid #eef0f2;
	flex-shrink: 0;
}
.fp-ai-summary-drawer__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
}
.fp-ai-summary-drawer__close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
}
.fp-ai-summary-drawer__close:hover {
	background: #f1f5f9;
}

/* ===== Tier badge ===== */
.fp-ai-summary-tier-badge {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 3px 10px;
	border-radius: 999px;
	background: #e2e8f0;
	color: #475569;
}
.fp-ai-summary-tier-badge[data-tier="plus"] {
	background: #dbeafe;
	color: #1d4ed8;
}
.fp-ai-summary-tier-badge[data-tier="premium"] {
	background: #fef3c7;
	color: #b45309;
}
.fp-ai-summary-tier-badge[data-tier="vip"] {
	background: linear-gradient(135deg, #7c3aed, #a855f7);
	color: #fff;
}

/* ===== Body / nội dung tóm tắt ===== */
.fp-ai-summary-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}
.fp-ai-summary-content p {
	margin: 0 0 12px;
	font-size: 14.5px;
	line-height: 1.7;
	color: #1e293b;
}
.fp-ai-summary-content .fp-ai-summary-section-title {
	font-weight: 700;
	color: #0f172a;
	margin-top: 18px;
}
.fp-ai-summary-list {
	margin: 0 0 12px 18px;
	padding: 0;
}
.fp-ai-summary-list li {
	font-size: 14.5px;
	line-height: 1.7;
	color: #1e293b;
	margin-bottom: 6px;
}

.fp-ai-summary-error {
	background: #fef2f2;
	color: #b91c1c;
	border-left: 3px solid #ef4444;
	padding: 12px 14px;
	border-radius: 6px;
	font-size: 13.5px;
}

.fp-ai-summary-disclaimer {
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px dashed #e2e8f0;
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.6;
}

/* ===== Skeleton loading ===== */
.fp-ai-summary-skeleton__line {
	height: 12px;
	border-radius: 6px;
	margin-bottom: 12px;
	background: linear-gradient(90deg, #eef1f4 25%, #e2e8f0 37%, #eef1f4 63%);
	background-size: 400% 100%;
	animation: fp-ai-summary-shimmer 1.4s ease infinite;
}
.fp-ai-summary-skeleton__line--short {
	width: 60%;
}
@keyframes fp-ai-summary-shimmer {
	0% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0 50%;
	}
}

/* ===== Chat (VIP) ===== */
.fp-ai-summary-chat {
	flex-shrink: 0;
	border-top: 1px solid #eef0f2;
	display: flex;
	flex-direction: column;
	max-height: 45%;
}
.fp-ai-summary-chat__messages {
	overflow-y: auto;
	padding: 14px 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.fp-ai-summary-chat__bubble {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.5;
	white-space: pre-wrap;
}
.fp-ai-summary-chat__bubble--user {
	align-self: flex-end;
	background: #0f766e;
	color: #fff;
	border-bottom-right-radius: 4px;
}
.fp-ai-summary-chat__bubble--ai {
	align-self: flex-start;
	background: #f1f5f9;
	color: #1e293b;
	border-bottom-left-radius: 4px;
}
.fp-ai-summary-chat__bubble--ai.is-thinking {
	color: #94a3b8;
	font-style: italic;
}
.fp-ai-summary-chat__bubble--error {
	background: #fef2f2;
	color: #b91c1c;
}
.fp-ai-summary-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #eef0f2;
}
.fp-ai-summary-chat__input {
	flex: 1;
	border: 1px solid #dbe1e7;
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 13.5px;
	outline: none;
}
.fp-ai-summary-chat__input:focus {
	border-color: #0f766e;
}
.fp-ai-summary-chat__send {
	background: #0f766e;
	color: #fff;
	border: none;
	border-radius: 999px;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	cursor: pointer;
	font-size: 15px;
}
.fp-ai-summary-chat__send:hover {
	filter: brightness(1.08);
}

/* ===== Khoá cuộn trang chính khi Drawer mở ===== */
body.fp-ai-summary-no-scroll {
	overflow: hidden;
}

/* ===== Responsive: Mobile chiếm toàn màn hình ===== */
@media (max-width: 480px) {
	.fp-ai-summary-drawer {
		width: 100vw;
	}
	.fp-ai-summary-chat {
		max-height: 50%;
	}
}
