/* ═══════════════════════════════════════
   PrimeClass Floating Widget
   오른쪽 하단 플로팅 버튼 (챗봇 + 카카오톡)
═══════════════════════════════════════ */

/* ── 전체 컨테이너 ── */
.fw-wrap {
  position: fixed;
  bottom: 32px;
  right: 28px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* ── 개별 버튼 공통 ── */
.fw-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  transition: transform .22s ease, box-shadow .22s ease;
  flex-shrink: 0;
}
.fw-btn:hover {
  transform: translateY(-4px) scale(1.06);
}

/* ── 카카오톡 버튼 ── */
.fw-kakao {
  background: #FEE500;
}
.fw-kakao:hover {
  box-shadow: 0 10px 32px rgba(254,229,0,.5);
}
.fw-kakao svg {
  width: 28px;
  height: 28px;
}

/* ── 챗봇 버튼 ── */
.fw-chat {
  background: #E8192C;
}
.fw-chat:hover {
  box-shadow: 0 10px 32px rgba(232,25,44,.45);
}
.fw-chat i {
  font-size: 22px;
  color: #fff;
}

/* ── 맨위로 버튼 ── */
.fw-top {
  background: #fff;
  border: 1.5px solid #e5e7eb;
}
.fw-top:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  border-color: #E8192C;
}
.fw-top i {
  font-size: 16px;
  color: #374151;
}
.fw-top:hover i { color: #E8192C; }

/* ── 툴팁 라벨 ── */
.fw-btn::before {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  transform: translateY(-50%) translateX(6px);
}
.fw-btn::after {
  content: '';
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #111827;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.fw-btn:hover::before,
.fw-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.fw-btn:hover::after { transform: translateY(-50%); }

/* ══════════════════════════════
   챗봇 팝업
══════════════════════════════ */
.fw-chatbox {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 8999;
  width: 340px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  background: #fff;
  display: flex;
  flex-direction: column;

  /* 닫힘 상태 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.96);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.fw-chatbox.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 챗박스 헤더 */
.fwcb-head {
  background: linear-gradient(135deg, #E8192C 0%, #c0101f 100%);
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fwcb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.fwcb-info { flex: 1; }
.fwcb-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
}
.fwcb-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
  font-family: 'Noto Sans KR', sans-serif;
}
.fwcb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: blink 1.6s ease infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.fwcb-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color .15s;
}
.fwcb-close:hover { color: #fff; }

/* 챗박스 메시지 영역 */
.fwcb-body {
  flex: 1;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.fwcb-body::-webkit-scrollbar { width: 4px; }
.fwcb-body::-webkit-scrollbar-track { background: transparent; }
.fwcb-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* 메시지 버블 */
.fwcb-msg {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  animation: msgIn .22s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fwcb-msg.user { flex-direction: row-reverse; }

.fwcb-bubble-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #E8192C;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.fwcb-bubble {
  max-width: 220px;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  font-family: 'Noto Sans KR', sans-serif;
}
.fwcb-msg.bot .fwcb-bubble {
  background: #fff;
  color: #111827;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.fwcb-msg.user .fwcb-bubble {
  background: #E8192C;
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

/* 빠른 질문 버튼 */
.fwcb-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.fwcb-quick-btn {
  padding: 6px 12px;
  border: 1.5px solid #E8192C;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #E8192C;
  background: #fff;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all .18s ease;
  white-space: nowrap;
}
.fwcb-quick-btn:hover {
  background: #E8192C;
  color: #fff;
}

/* 타이핑 인디케이터 */
.fwcb-typing {
  display: flex; align-items: center; gap: 7px;
}
.fwcb-typing-dots {
  display: flex; gap: 4px; padding: 10px 14px;
  background: #fff; border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.fwcb-typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d1d5db;
  animation: dot-bounce .9s ease infinite;
}
.fwcb-typing-dots span:nth-child(2) { animation-delay: .18s; }
.fwcb-typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); background: #d1d5db; }
  40% { transform: translateY(-6px); background: #E8192C; }
}

/* 챗박스 입력창 */
.fwcb-foot {
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
}
.fwcb-input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #111827;
  outline: none;
  transition: border-color .18s;
}
.fwcb-input:focus { border-color: #E8192C; }
.fwcb-input::placeholder { color: #9ca3af; }
.fwcb-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #E8192C;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .18s, transform .18s;
}
.fwcb-send:hover { background: #c0101f; transform: scale(1.08); }

/* ── 반응형 ── */
@media(max-width: 480px) {
  .fw-wrap { bottom: 20px; right: 16px; }
  .fw-chatbox { right: 12px; width: calc(100vw - 24px); bottom: 86px; }
  .fw-btn::before, .fw-btn::after { display: none; }
}
