/* Wsac styles (migrated from single-file plugin) */
#wsac-widget {
  /* 플로팅 버튼 및 채팅창 위치 조정 */
  position: fixed;
  bottom: 45px;
  right: 45px;
  z-index: 999999;
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

/* 플로팅 버튼 */
#wsac-toggle {
  /* 플로팅 버튼 크기(세로 높이) */
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
  background: #4a90e2;
  position: relative;
  overflow: visible;
}
#wsac-toggle:hover {
  transform: scale(1.05);
}
#wsac-toggle img {
  width: 85%;
  height: 85%;
  margin: 0;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-sizing: border-box;
}
.online-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #2ecc71;
  border: 2px solid white;
  border-radius: 50%;
}

/* 채팅창 윈도우 */
#wsac-window {
  position: absolute;
  bottom: 90px;
  right: 0;
  width: 360px;
  height: 600px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid #f0f0f0;
}
#wsac-window.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  pointer-events: none;
}

/* 헤더 */
.header {
  background: #4a90e2;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.5px;
}
#wsac-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  opacity: 0.8;
}
#wsac-close:hover {
  opacity: 1;
}

/* 메시지 영역 */
#wsac-msgs {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#wsac-msgs::-webkit-scrollbar {
  width: 6px;
}
#wsac-msgs::-webkit-scrollbar-thumb {
  background: #eee;
  border-radius: 3px;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 95%;
  align-items: flex-start;
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avt {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #eee;
}
.avt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bub {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}
.bub p {
  margin: 0.45em 0;
}
.bub p:first-child {
  margin-top: 0;
}
.bub p:last-child {
  margin-bottom: 0;
}
.bub ul,
.bub ol {
  margin: 0.45em 0 0.45em 1.2em;
  padding: 0;
}
.bub li {
  margin: 0.35em 0;
}
.bub li > p {
  margin: 0;
}
.ai .bub {
  background: #f3f3f3;
  color: #333;
  border-top-left-radius: 2px;
}
.user .bub {
  background: #4a90e2;
  color: #fff;
  border-top-right-radius: 2px;
  text-align: right;
}
.msg.ai .bub::before {
  content: "아서(Arthur) " attr(data-time);
  display: block;
  font-size: 11px;
  color: #5a5a5a;
  margin-bottom: 6px;
  font-weight: bold;
}
.msg.user .bub::before {
  display: none;
}

/* 입력 영역 */
.input-area {
  padding: 15px;
  background: #fff;
  border-top: 1px solid #f5f5f5;
}
.input-box {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  background: white;
}
.input-box:focus-within {
  border-color: #4a90e2;
}

#wsac-in {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px;
  font-size: 14px;
  color: #333;
  background: transparent;
}
#wsac-send {
  background: #bbb;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#wsac-send.active {
  background: #4a90e2;
}

.footer-text {
  text-align: center;
  font-size: 11px;
  color: #ccc;
  margin-top: 10px;
}

@media (max-width: 480px) {
  #wsac-window {
    width: calc(100vw - 40px);
    height: 75vh;
    right: -10px;
    bottom: 100px;
  }
}

/* 로딩 애니메이션 */
.wsac-dots {
  display: inline-flex;
  gap: 4px;
}
.wsac-dot {
  width: 6px;
  height: 6px;
  background: #aaa;
  border-radius: 50%;
  animation: wsac-bounce 1.4s infinite;
}
.wsac-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.wsac-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes wsac-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
