/*
 * AI 부스터 / 프로 1일(24시간) 잔여 시간 알림 — 독립 스타일
 * Figma node 1667:26464 (2026_AI 디자이너) 사양 기반.
 * 사이드바 폭 변수(--ai-sb-width)는 aichatHome.css 에서 정의되며 데스크탑 244 / 중간 170 / 모바일 0.
 */

/* JS 가 데이터 채운 뒤 .is-visible 클래스 추가 시점에 노출 */
.aichat-rst {
	display: none;
	position: fixed;
	left: calc(var(--ai-sb-width, 244px) + 20px);
	bottom: 20px;
	width: fit-content;
	min-width: 391px;
	/* 사이드바를 제외한 영역 안에서만 머물도록 제한 */
	max-width: calc(100% - var(--ai-sb-width, 244px));
	box-sizing: border-box;
	padding: 21px 16px;
	background: var(--ai-noti-bg);
	border: 1px solid var(--ai-border);
	border-radius: 7px;
	box-shadow: 4px 4px 40px 0 rgba(0, 0, 0, 0.2);
	z-index: 9999;
	pointer-events: auto;
	overflow: hidden;
}

.aichat-rst.is-visible {
	display: block;
}

.aichat-rst__row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

.aichat-rst__icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	background:url('/common/responsive/images/aichat/icon_caution.svg') center center / 18px 18px no-repeat,
		rgba(20, 20, 20, 0.5);
	border-radius: 100px;
}

.aichat-rst__text {
	color: #FFFFFF;
	font-weight: 400;
	font-size: 14px;
	line-height: 22px;
	letter-spacing: -0.14px;
	flex: 1;
	min-width: 0;
	white-space: nowrap;
}

.aichat-rst__text em {
	font-style: normal;
	font-weight: 500;
	color: #FF6E61;
}

/* 케이스별 변동 텍스트: data-case 속성과 같은 이름의 span 만 inline 으로 노출 */
.aichat-rst__text > span {
	display: none;
}

.aichat-rst[data-case="proOnly"]     .aichat-rst__text > .proOnly,
.aichat-rst[data-case="proBooster"]  .aichat-rst__text > .proBooster,
.aichat-rst[data-case="boosterOnly"] .aichat-rst__text > .boosterOnly {
	display: inline;
}

/*
 * 호버 오버레이는 요소 opacity 대신 배경색 alpha 로만 페이드 —
 * 닫기 버튼은 투명도 영향 없이 visibility 로만 토글되어 항상 선명하게.
 */
.aichat-rst__buttons {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	padding: 0 20px;
	background-color:rgba(28, 29, 31, 0);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	transition:background-color .2s;
	font-family: inherit;
	pointer-events: none;
}

.aichat-rst:hover .aichat-rst__buttons {
	background-color:rgba(28, 29, 31, 0.9);
	pointer-events: auto;
}

.aichat-rst:hover .aichat-rst__buttons .aichat-rst__close{
	visibility:visible;
}

/* 좌측: "오늘은 이 경고를 그만 볼래요" (MFV3 stop_today) */
.aichat-rst__buttons .aichat-rst__stop {
	background: transparent;
	border: none;
	padding: 0;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 23px;
	letter-spacing: -0.15px;
	cursor: pointer;
	text-align: left;
}

/* 우측: "닫기" — 둥근 알약 (MFV3 noti_close 사이즈/타이포 + 기본 노출 배경) */
.aichat-rst__buttons .aichat-rst__close {
	background:#444444;
	border: none;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 13px;
	width: 61px;
	height: 30px;
	border-radius: 100px;
	display: flex;
	padding: 4px 17px 4px 18px;
	box-sizing: border-box;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	visibility:hidden;
}

/* 작업창(navAside 패널 존재 시): 좌측 패널 폭만큼 추가 오프셋 */
body:has(#aiContent aside) .aichat-rst {
	left: calc(var(--ai-sb-width, 244px) + 220px);
}

/* 모바일: 사이드바 → 하단 탭바 전환 영역 (≤768px) */
@media (max-width: 768px) {
	.aichat-rst {
		left: 12px;
		right: 12px;
		bottom:calc(var(--ai-nav-h-mo) + 12px);
		width: auto;
	}
}

/*
 * 폭이 아니라 hover 능력 기준 — 좁은 데스크탑 창은 호버가 되므로 기존 오버레이 디자인 유지.
 * 호버 불가 환경에서는 어두운 오버레이 대신 닫기 버튼을 텍스트 우측에 인라인 상시 노출.
 */
@media (hover:none) and (pointer:coarse){
	.aichat-rst{
		flex-direction:row;
		align-items:center;
		gap:10px;
	}

	.aichat-rst.is-visible{
		display:flex;
	}

	.aichat-rst__row{
		flex:1;
		min-width:0;
	}

	.aichat-rst__text{
		overflow:hidden;
		text-overflow:ellipsis;
	}

	/* 오버레이를 일반 흐름으로 되돌려 닫기 버튼만 인라인 노출 */
	.aichat-rst__buttons {
		position:static;
		width:auto;
		height:auto;
		padding:0;
		margin-left:auto;
		flex-shrink:0;
		background-color:transparent;
		pointer-events: auto;
	}

	/* 탭으로 :hover sticky 발동해도 어두운 배경이 들어가지 않도록 무력화 */
	.aichat-rst:hover .aichat-rst__buttons{
		background-color:transparent;
	}

	.aichat-rst__buttons .aichat-rst__close{
		visibility:visible;
	}
}
