/* 기본 폰트 설정 */
body, a, h1, h2, h3, h4, h5, h6, p, div, dd, dt, li, select, input, textarea, button {
	font-family: "Pretendard Variable", Pretendard, sans-serif;
}

/* 채팅창 전체 크기 조절 및 가운데 정렬 */
.sidetalk-side-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	width: 90%; /* 모바일에서도 화면에 맞게 너비를 조정 */
	max-width: 500px; /* 최대 너비 설정 */
	height: 80vh; /* 화면 높이의 80% */
	transform: translate(-50%, -50%);
	border-radius: 20px;
	background: #ffffff;
	box-shadow: rgba(0, 0, 0, 0.1) 0px 12px 60px;
	z-index: 9999999999;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.sidetalk-side-panel.view {
	right: auto;
}

/* 패널 헤더 */
.sidetalk-panel-header {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: auto;
	min-height: 65px;
	padding: 10px 20px;
	border-bottom: 1px solid #ededed;
	background-color: #f1f1f1;
	text-align: center;
	border-top-left-radius: 20px;
	border-top-right-radius: 20px;
}

.sidetalk-panel-header .sidetalk-title-header {
	width: 100%;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: #00a8ea;
}

.sidetalk-panel-header .sidetalk-close-btn {
	position: absolute;
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
	cursor: pointer;
	padding: 0px;
	background: none;
	border: none;
	outline: none;
}

.sidetalk-panel-header .sidetalk-close-btn img {
	width: 35px; /* 모바일에 맞게 크기 조정 */
	height: 35px;
}

/* 채팅창 */
.sidetalk-chat-history {
	display: flex;
	flex-direction: column-reverse;
	overflow-y: auto;
	width: 100%;
	height: 100%;
	padding: 10px 0px 10px 0px;
	box-sizing: border-box;
	background-color: white;
}

/* 채팅 메시지 관련 스타일 */
.sidetalk-chat-history .sidetalk-message {
	font-size: 15px;
	font-weight: 500;
	line-height: 21px;
}

.sidetalk-chat-history .sidetalk-message .sidetalk-message-name {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	color: #777;
}

.sidetalk-chat-history .sidetalk-message .sidetalk-message-name img {
	width: 25px;
	height: 25px;
	margin-right: 7px;
}

.sidetalk-chat-history .sidetalk-message .sidetalk-bubble {
	display: inline-block;
	min-width: 100px;
	min-height: 53px;
	padding: 20px 25px;
	margin-top: 10px;
	box-sizing: border-box;
	word-break: break-word;
	-webkit-animation: fade-bubble 1s;
	animation: fade-bubble 1s;
	margin-bottom: 0;
}

@keyframes fade-bubble {
	0% {
		opacity: 70%;
		transform: translateY(8px);
	}
	100% {
		opacity: 100%;
		transform: translateY(0);
	}
}

.sidetalk-chat-history .sidetalk-message.sidetalk-user-message {
	align-self: flex-end;
}

.sidetalk-chat-history .sidetalk-message.sidetalk-user-message .sidetalk-bubble {
	margin-top: 10px;
	border-radius: 45px 45px 0px 45px;
	background-color: #00a8ea;
	color: #fff;
}

.sidetalk-chat-history .sidetalk-message.sidetalk-other-message {
	align-self: flex-start;
	white-space: pre-wrap;
	margin: 0px 30px 0 20px;
}

.sidetalk-chat-history .sidetalk-message.sidetalk-other-message .sidetalk-bubble {
	border: 1px solid #ededed;
	border-radius: 0px 45px 45px 45px;
	background-color: #f1f1f1;
	color: #666;
}

/* 패널 풋터 */
.sidetalk-panel-footer {
	width: 100%;
	height: auto;
	padding: 17px 20px;
	box-sizing: border-box;
	border-top: 1px solid #ededed;
	background-color: #f1f1f1;
	position: absolute;
	bottom: 0;
	border-bottom-left-radius: 20px;
	border-bottom-right-radius: 20px;
}

.sidetalk-panel-footer .sidetalk-chat-input {
	position: relative;
	display: flex;
	overflow: hidden;
	width: 100%;
	border: 1px solid #ccc;
	border-radius: 45px;
	box-sizing: border-box;
	align-items: center;
}

.sidetalk-panel-footer .sidetalk-chat-input textarea {
	overflow: hidden;
	width: 100%;
	max-height: 62px;
	padding: 20px 50px 20px 25px;
	box-sizing: border-box;
	border: none;
	border-radius: 45px;
	outline: none;
	resize: none;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
}

.sidetalk-panel-footer .sidetalk-chat-input #sidetalk-send-message-btn {
	position: absolute;
	right: 0px;
	cursor: pointer;
	background: none;
	border: none;
	outline: none;
}

.sidetalk-panel-footer .sidetalk-chat-input #sidetalk-send-message-btn img {
	width: 35px; /* 모바일에 맞게 크기 조정 */
	height: 35px;
}

/* 대화 나오기 전 로딩창 */
#sidetalk-load-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100vh;
}

#sidetalk-load {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 90px;
	height: 90px;
	border-radius: 50%;
	background: transparent;
}

#sidetalk-load::before {
	position: absolute;
	content: '';
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 5px solid transparent;
	border-radius: 50%;
	border-top: 5px solid #00a8ea;
	border-left: 1px solid #00a8ea;
	animation: loading 1s linear infinite;
	box-sizing: border-box;
	z-index: 10;
}

#sidetalk-load::after {
	position: absolute;
	content: '';
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 5px solid transparent;
	border-radius: 50%;
	border-top: 5px solid #7cdaff;
	border-left: 1px solid #7cdaff;
	animation: loading 2s linear infinite;
	box-sizing: border-box;
}

#sidetalk-load img {
	width: 50px; /* 모바일에 맞게 크기 조정 */
	height: 50px;
}

/* 특정 사이트 키에만 적용할 색상 */
#sidetalk-load.custom::before {
	display: none;
	border-top: 5px solid #B59071;
	border-left: 1px solid #B59071;
}
#sidetalk-load.custom::after {
	display: none;
	border-top: 5px solid #B59071;
	border-left: 1px solid #B59071;
}

#sidetalk-load.custom img {
	width: 110px; /* 원하는 크기로 조정 */
	height: 110px;
}

@keyframes loading {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* 모바일 최적화 미디어 쿼리 */
@media screen and (max-width: 768px) {
	.sidetalk-side-panel {
		width: 100%;
		height: 100%;
		max-width: none;
		border-radius: 0;
	}

	.sidetalk-panel-header .sidetalk-close-btn img {
		width: 30px;
		height: 30px;
	}

	.sidetalk-panel-footer .sidetalk-chat-input #sidetalk-send-message-btn img {
		width: 30px;
		height: 30px;
	}

	#sidetalk-load {
		width: 80px;
		height: 80px;
	}

	#sidetalk-load img {
		width: 45px;
		height: 45px;
	}
}