@charset "UTF-8";

/* ============================================================
   특성화고 입학상담 AI 플로팅 위젯 스타일시트
   반응형 메신저 UI, 마크다운 표/리스트, 파스텔 블루 테마
   ============================================================ */

/* 1. 플로팅 런처 버튼 */
.rx-chatbot-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Pretendard", sans-serif;
}

.rx-chatbot-launcher-badge {
	position: relative;
	background: #1E293B;
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 20px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
	display: flex;
	align-items: center;
	gap: 6px;
	animation: rx-float-bounce 3s ease-in-out infinite;
	white-space: nowrap;
}

.rx-badge-ping {
	display: inline-block;
	width: 8px;
	height: 8px;
	background-color: #10B981;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.rx-chatbot-launcher-icon {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.rx-chatbot-launcher-icon svg {
	width: 28px;
	height: 28px;
}

.rx-chatbot-launcher:hover .rx-chatbot-launcher-icon {
	transform: scale(1.08);
	box-shadow: 0 10px 28px rgba(37, 99, 235, 0.48);
}

.rx-chatbot-launcher:active .rx-chatbot-launcher-icon {
	transform: scale(0.95);
}

/* 2. 플로팅 채팅창 컨테이너 */
.rx-chatbot-container {
	position: fixed;
	bottom: 96px;
	right: 24px;
	width: 400px;
	max-width: calc(100vw - 32px);
	height: 620px;
	max-height: calc(100vh - 120px);
	background: #FFFFFF;
	border-radius: 18px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Pretendard", sans-serif;
	animation: rx-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 2-1. 본문 임베드 인라인 모드 스타일 (페이지 본문 중앙 배치) */
.rx-chatbot-container.rx-chatbot-inline {
	position: relative !important;
	top: auto !important;
	bottom: auto !important;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 720px !important;
	height: 680px !important;
	max-height: 85vh !important;
	margin: 20px auto 40px auto !important;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px #E2E8F0 !important;
	border-radius: 20px !important;
	z-index: 10 !important;
	animation: none !important;
}

/* 2-2. 팝업 / iframe 전용 독립형 모드 스타일 (화면 100% 꽉 채움) */
.rx-chatbot-container.rx-chatbot-standalone {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	margin: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	border: none !important;
	z-index: 1000 !important;
	animation: none !important;
}

/* 3. 헤더 */
.rx-chatbot-header {
	padding: 14px 18px;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rx-chatbot-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.rx-chatbot-avatar {
	position: relative;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.rx-chatbot-avatar svg {
	width: 22px;
	height: 22px;
}

.rx-chatbot-online-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 10px;
	height: 10px;
	background: #10B981;
	border: 2px solid #FFFFFF;
	border-radius: 50%;
}

.rx-chatbot-title-box {
	display: flex;
	flex-direction: column;
}

.rx-chatbot-title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.3px;
	line-height: 1.3;
}

.rx-chatbot-subtitle {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	margin-top: 2px;
}

.rx-chatbot-header-right {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rx-chatbot-btn-kakao {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #FEE500;
	color: #191919 !important;
	font-size: 11.5px;
	font-weight: 700;
	padding: 5px 10px;
	border-radius: 14px;
	text-decoration: none !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: transform 0.15s, background-color 0.15s;
	line-height: 1;
}

.rx-chatbot-btn-kakao:hover {
	background: #FADA0A;
	color: #000000 !important;
	transform: translateY(-1px);
}

.rx-chatbot-btn-kakao svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.rx-chatbot-btn-header {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #FFFFFF;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	padding: 0;
}

.rx-chatbot-btn-header:hover {
	background: rgba(255, 255, 255, 0.28);
}

.rx-chatbot-btn-header svg {
	width: 17px;
	height: 17px;
}

/* 4. 추천 질문 칩 영역 */
.rx-chatbot-chips-bar {
	background: #F8FAFC;
	border-bottom: 1px solid #E2E8F0;
	padding: 10px 14px;
	overflow-x: auto;
	flex-shrink: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.rx-chatbot-chips-bar::-webkit-scrollbar {
	display: none;
}

.rx-chatbot-chips-track {
	display: flex;
	gap: 8px;
	width: max-content;
}

.rx-chatbot-chip {
	background: #FFFFFF;
	border: 1px solid #CBD5E1;
	color: #334155;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 16px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rx-chatbot-chip:hover {
	background: #EFF6FF;
	border-color: #93C5FD;
	color: #1D4ED8;
	transform: translateY(-1px);
}

/* 5. 메시지 목록 바디 */
.rx-chatbot-messages {
	flex: 1;
	padding: 16px 14px;
	overflow-y: auto;
	background: #F8FAFC;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rx-chat-row {
	display: flex;
	gap: 10px;
	max-width: 88%;
}

.rx-chat-row-bot {
	align-self: flex-start;
}

.rx-chat-row-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.rx-chat-avatar-mini {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #EFF6FF;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rx-chat-avatar-mini svg {
	width: 18px;
	height: 18px;
}

.rx-chat-bubble-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rx-chat-bubble {
	padding: 11px 15px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.55;
	word-break: break-word;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rx-chat-bubble-bot {
	background: #FFFFFF;
	color: #1E293B;
	border: 1px solid #E2E8F0;
	border-top-left-radius: 4px;
}

.rx-chat-bubble-user {
	background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
	color: #FFFFFF;
	border-top-right-radius: 4px;
}

.rx-chat-meta {
	font-size: 11px;
	color: #94A3B8;
	padding: 0 4px;
}

.rx-chat-row-user .rx-chat-meta {
	text-align: right;
}

/* 6. 마크다운 렌더링 스타일 (표, 리스트, 볼드) */
.rx-chat-bubble-bot p {
	margin: 0 0 8px 0;
}
.rx-chat-bubble-bot p:last-child {
	margin-bottom: 0;
}

.rx-chat-bubble-bot strong {
	color: #0F172A;
	font-weight: 700;
}

.rx-chat-bubble-bot ul,
.rx-chat-bubble-bot ol {
	margin: 6px 0;
	padding-left: 20px;
}

.rx-chat-bubble-bot li {
	margin-bottom: 4px;
}

.rx-chat-bubble-bot table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	font-size: 12px;
	background: #FFFFFF;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 0 0 1px #CBD5E1;
}

.rx-chat-bubble-bot th,
.rx-chat-bubble-bot td {
	padding: 7px 10px;
	border: 1px solid #E2E8F0;
	text-align: left;
}

.rx-chat-bubble-bot th {
	background: #EFF6FF;
	color: #1E40AF;
	font-weight: 600;
}

.rx-chat-bubble-bot tr:nth-child(even) td {
	background: #F8FAFC;
}

.rx-chat-bubble-bot code {
	background: #F1F5F9;
	color: #D97706;
	padding: 2px 5px;
	border-radius: 4px;
	font-size: 12px;
	font-family: Consolas, monospace;
}

.rx-chat-bubble-bot blockquote {
	margin: 8px 0;
	padding: 6px 12px;
	background: #F0FDF4;
	border-left: 3px solid #10B981;
	color: #166534;
	font-size: 12.5px;
}

/* 7. 타이핑 인디케이터 (3-dot) */
.rx-chatbot-typing-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	background: #F8FAFC;
	border-top: 1px solid #F1F5F9;
	flex-shrink: 0;
}

.rx-typing-bubble {
	display: flex;
	align-items: center;
	gap: 4px;
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	padding: 8px 12px;
	border-radius: 12px;
	width: fit-content;
}

.rx-typing-dot {
	width: 6px;
	height: 6px;
	background: #3B82F6;
	border-radius: 50%;
	animation: rx-dot-bounce 1.4s infinite ease-in-out both;
}

.rx-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.rx-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.rx-typing-dot:nth-child(3) { animation-delay: 0s; }

.rx-typing-text {
	font-size: 11.5px;
	color: #64748B;
}

/* 8. 입력 폼 영역 */
.rx-chatbot-input-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #FFFFFF;
	border-top: 1px solid #E2E8F0;
	flex-shrink: 0;
}

.rx-input-container {
	flex: 1;
	display: flex;
	align-items: center;
}

.rx-input-container textarea {
	width: 100%;
	border: 1px solid #CBD5E1;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 13.5px;
	line-height: 1.4;
	resize: none;
	outline: none;
	font-family: inherit;
	background: #F8FAFC;
	transition: border-color 0.2s, background 0.2s;
	max-height: 80px;
	box-sizing: border-box;
}

.rx-input-container textarea:focus {
	border-color: #3B82F6;
	background: #FFFFFF;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.rx-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.15s, opacity 0.15s;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.rx-send-btn:hover {
	transform: scale(1.05);
	opacity: 0.92;
}

.rx-send-btn:active {
	transform: scale(0.95);
}

.rx-send-btn svg {
	width: 17px;
	height: 17px;
	margin-left: 2px;
}

.rx-send-btn:disabled {
	background-color: #94A3B8 !important;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.rx-chatbot-footer-caption {
	background: #FFFFFF;
	text-align: center;
	font-size: 10px;
	color: #94A3B8;
	padding: 0 0 8px 0;
}

/* 9. 애니메이션 키프레임 */
@keyframes rx-slide-up {
	0% {
		opacity: 0;
		transform: translateY(20px) scale(0.97);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes rx-dot-bounce {
	0%, 80%, 100% {
		transform: scale(0);
	}
	40% {
		transform: scale(1);
	}
}

@keyframes rx-float-bounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-4px);
	}
}

/* 10. 반응형 모바일 최적화 (화면폭 640px 이하) */
@media screen and (max-width: 640px) {
	.rx-chatbot-launcher {
		bottom: 16px;
		right: 16px;
	}

	.rx-chatbot-launcher-badge {
		display: none; /* 모바일에서는 뱃지 숨김 */
	}

	.rx-chatbot-container:not(.rx-chatbot-inline) {
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}

	.rx-chatbot-container.rx-chatbot-inline {
		max-width: 100% !important;
		height: calc(100vh - 140px) !important;
		margin: 10px auto !important;
		border-radius: 14px !important;
	}

	.rx-chatbot-header {
		padding-top: max(14px, env(safe-area-inset-top));
	}

	.rx-chatbot-footer-caption {
		padding-bottom: max(8px, env(safe-area-inset-bottom));
	}
}
