/* WP Live Chat Pro - widget.css (KMT 리디자인 v2) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root {
  --wlc: #1a3a6b;
  --wlc-mid: #1e4d9b;
  --wlc-dark: #0f2647;
  --wlc-accent: #00c2cb;
  --wlc-light: #e8f1ff;
  --wlc-text: #1e293b;
  --wlc-sub: #64748b;
  --wlc-border: #e2e8f0;
  --wlc-bg: #f8fafc;
}

/* ── 위젯 래퍼 ── */
#wlc-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
}

/* ══════════════════════════════
   FAB — PC: 사각형, 아이콘+라벨 가로 배치
══════════════════════════════ */
#wlc-fab {
  position: relative;
  width: auto;
  min-width: 66px;
  height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f2647 0%, #1a3a6b 55%, #1e4d9b 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  /* 아이콘 + 라벨 가로 배치 */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 6px 24px rgba(26,58,107,0.5);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s, opacity 0.2s;
  outline: none;
  white-space: nowrap;
  overflow: visible;
}

/* FAB 아이콘 SVG */
#wlc-fab > svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

/* FAB 라벨 */
.wlc-fab-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1;
  display: inline;
}

#wlc-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(26,58,107,0.55);
}
#wlc-fab:active { transform: scale(0.97); }

@keyframes wlc-pulse {
  0%   { box-shadow: 0 6px 24px rgba(26,58,107,0.5), 0 0 0 0 rgba(0,194,203,0.6); }
  70%  { box-shadow: 0 6px 24px rgba(26,58,107,0.5), 0 0 0 16px rgba(0,194,203,0); }
  100% { box-shadow: 0 6px 24px rgba(26,58,107,0.5), 0 0 0 0 rgba(0,194,203,0); }
}
#wlc-fab.pulse { animation: wlc-pulse 2.4s infinite; }

#wlc-widget.open #wlc-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.7) translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

/* 온라인 닷 */
#wlc-online-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  background: #94a3b8;
  border: 2.5px solid #fff;
  border-radius: 50%;
  display: block;
  transition: background 0.4s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
#wlc-widget.agents-online  #wlc-online-dot { background: #22c55e; }
#wlc-widget.agents-offline #wlc-online-dot { background: #ef4444; }
#wlc-widget.agents-lunch   #wlc-online-dot { background: #f59e0b; }

/* 미읽음 뱃지 */
#wlc-fab-badge {
  display: none;
  position: absolute;
  top: -9px;
  left: -9px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 2.5px solid #fff;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(239,68,68,0.5);
  z-index: 10;
  animation: wlc-badge-pop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes wlc-badge-pop {
  0%   { transform: scale(0) rotate(-20deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ══════════════════════════════
   채팅 패널
══════════════════════════════ */
#wlc-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 70px rgba(15,38,71,0.2), 0 4px 20px rgba(15,38,71,0.1);
  overflow: hidden;
  transform: scale(0.88) translateY(24px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
#wlc-widget.open #wlc-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── 패널 헤더 ── */
#wlc-panel-header {
  background: linear-gradient(135deg, #0f2647 0%, #1a3a6b 55%, #1e4d9b 100%);
  padding: 20px 20px 18px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
#wlc-panel-header::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(0,194,203,0.12); pointer-events: none;
}
#wlc-panel-header::after {
  content: '';
  position: absolute; bottom: -20px; left: 20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.05); pointer-events: none;
}

/* 닫기 버튼 — 반드시 보여야 함 */
#wlc-panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  outline: none;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  pointer-events: auto;
  opacity: 1;
}
#wlc-panel-close:hover {
  background: rgba(255,255,255,0.32);
  transform: scale(1.1);
}

/* 아바타 + 이름 */
.wlc-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 42px;
  position: relative;
  z-index: 1;
}
.wlc-agent-avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wlc-agent-avatar svg { display: block; }
.wlc-header-name { color: #fff; font-weight: 700; font-size: 15px; }
.wlc-header-status {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  display: flex; align-items: center; gap: 5px;
  margin-top: 3px;
  line-height: 1.6;
  flex-wrap: wrap;
}
.wlc-green-dot {
  width: 7px; height: 7px;
  background: #4ade80; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(74,222,128,0.8);
}

/* 입력 폼 */
#wlc-start-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}
#wlc-start-form input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.25);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
#wlc-start-form input::placeholder { color: rgba(255,255,255,0.5); }
#wlc-start-form input:focus {
  border-color: var(--wlc-accent);
  background: rgba(255,255,255,0.22);
}
#wlc-start-btn {
  padding: 12px;
  background: var(--wlc-accent);
  border: none; border-radius: 10px;
  color: #0f2647; font-weight: 700; font-size: 14px;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,194,203,0.4);
  transition: background 0.2s, transform 0.15s;
}
#wlc-start-btn:hover { background: #00d8e2; transform: translateY(-1px); }
#wlc-start-btn:active { transform: scale(0.98); }

#wlc-offline-notice {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 10px 14px;
  color: rgba(255,255,255,0.85); font-size: 13px; line-height: 1.55;
  position: relative; z-index: 1;
}

/* ── 메시지 ── */
#wlc-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--wlc-bg); min-height: 180px;
}
#wlc-messages::-webkit-scrollbar { width: 4px; }
#wlc-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.wlc-msg { display: flex; flex-direction: column; max-width: 80%; }
.wlc-msg-visitor { align-self: flex-end; }
.wlc-msg-agent   { align-self: flex-start; }
.wlc-msg-system  { align-self: center; max-width: 92%; }

.wlc-msg-bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
/* 고객(visitor) — 네이비 그라디언트 + 흰 글자 */
.wlc-msg-visitor .wlc-msg-bubble {
  background: linear-gradient(135deg, #1a3a6b 0%, #1e4d9b 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(26,58,107,0.28);
}
/* 상담원(agent) — 연한 청회색 그라디언트 + 네이비 글자 */
.wlc-msg-agent .wlc-msg-bubble {
  background: linear-gradient(135deg, #eef3fb 0%, #e8f1ff 100%);
  border: 1px solid #d0dff5;
  color: #1a3a6b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(26,58,107,0.08);
}
.wlc-msg-system .wlc-msg-bubble {
  background: transparent; color: #94a3b8; font-size: 12px; text-align: center;
}
.wlc-msg-agent-name { font-size: 11px; color: #1e4d9b; margin-bottom: 3px; font-weight: 700; letter-spacing: 0.01em; }
.wlc-msg-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.wlc-msg-visitor .wlc-msg-time { text-align: right; }
.wlc-msg-img { max-width: 200px; border-radius: 10px; margin-top: 4px; }
.wlc-msg-file-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; text-decoration: none; padding: 6px 10px; border-radius: 8px; margin-top: 4px; }
.wlc-msg-visitor .wlc-msg-file-link { background: rgba(255,255,255,0.2); color: #fff; }
.wlc-msg-agent   .wlc-msg-file-link { background: var(--wlc-light); color: var(--wlc); }

/* 타이핑 */
.wlc-typing { align-self: flex-start; }
.wlc-typing-bubble {
  background: linear-gradient(135deg, #eef3fb 0%, #e8f1ff 100%);
  border: 1px solid #d0dff5;
  border-radius: 16px; border-bottom-left-radius: 4px;
  padding: 10px 16px; display: flex; gap: 5px; align-items: center;
  box-shadow: 0 2px 8px rgba(26,58,107,0.08);
}
.wlc-typing-dot { width: 7px; height: 7px; background: #94a3b8; border-radius: 50%; animation: wlc-blink 1.2s infinite; }
.wlc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.wlc-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes wlc-blink { 0%,80%,100%{opacity:0.3} 40%{opacity:1} }

#wlc-waiting-msg { text-align: center; color: var(--wlc-sub); font-size: 13px; padding: 10px; }

/* ── 입력 영역 ── */
#wlc-input-area {
  padding: 10px 14px 14px;
  background: #fff;
  border-top: 1px solid var(--wlc-border);
  flex-shrink: 0;
}
.wlc-input-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.wlc-attach-btn { font-size: 18px; cursor: pointer; padding: 5px 7px; border-radius: 8px; color: var(--wlc-sub); transition: background 0.15s, color 0.15s; }
.wlc-attach-btn:hover { background: var(--wlc-light); color: var(--wlc); }
#wlc-file-preview { font-size: 11px; color: var(--wlc-sub); }

.wlc-input-row { display: flex; gap: 8px; align-items: flex-end; }
#wlc-input {
  flex: 1; border: 1.5px solid var(--wlc-border); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  resize: none; outline: none; max-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5; color: var(--wlc-text); background: var(--wlc-bg);
}
#wlc-input::placeholder { color: #b0bec5; }
#wlc-input:focus { border-color: var(--wlc); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); background: #fff; }

/* 전송 버튼 */
#wlc-send {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #1a3a6b 0%, #1e4d9b 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(26,58,107,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
/* CSS로 그린 종이비행기 스타일 화살표 */
.wlc-send-icon {
  display: block;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid #fff;
  margin-left: 3px;
}
#wlc-send:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,58,107,0.45); }
#wlc-send:active { transform: scale(0.93); box-shadow: none; }

#wlc-closed-notice {
  text-align: center; padding: 14px; color: var(--wlc-sub);
  font-size: 13px; background: var(--wlc-bg); border-top: 1px solid var(--wlc-border);
}

/* ══════════════════════════════
   모바일 — FAB 원형, 라벨 숨김
══════════════════════════════ */
@media (max-width: 480px) {
  #wlc-widget { bottom: 18px; right: 18px; }
  #wlc-fab {
    width: 58px !important;
    min-width: 58px !important;
    height: 58px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    flex-direction: column;
    gap: 0;
  }
  .wlc-fab-label { display: none !important; }
  #wlc-panel { width: calc(100vw - 28px); right: 0; bottom: 74px; border-radius: 18px; }
}
