/* ═══════════════════════════════════════════════════════════════════
   chat-widget-marketing.css — 마케팅 페이지 floating 챗봇 스타일
   브랜드: #c8115a 마젠타
   ═══════════════════════════════════════════════════════════════════ */

/* ── Floating 버튼 (FAB) ── */
.emk-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
  padding: 0;
}
.emk-fab:hover {
  background: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.12);
}
.emk-fab:active {
  transform: translateY(0);
}
.emk-fab.open {
  background: var(--brand, #c8115a);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(200, 17, 90, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1);
}
.emk-fab .emk-fab-icon-chat,
.emk-fab .emk-fab-icon-close {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}
.emk-fab .emk-fab-icon-chat {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: block;
  object-fit: contain;
}
.emk-fab .emk-fab-icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}
.emk-fab.open .emk-fab-icon-chat {
  opacity: 0;
  transform: rotate(90deg);
}
.emk-fab.open .emk-fab-icon-close {
  opacity: 1;
  transform: rotate(0);
}

/* ── 패널 ── */
.emk-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Inter", "Noto Sans KR", sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.emk-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── 헤더 ── */
.emk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.emk-head-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.emk-head-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
}
.emk-head-info {
  flex: 1;
  min-width: 0;
}
.emk-head-title {
  font-weight: 700;
  font-size: 14px;
  color: #111;
}
.emk-head-status {
  font-size: 11px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.emk-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: emk-pulse 2s ease-in-out infinite;
}
@keyframes emk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.emk-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  background: #fff;
  color: #888;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.15s;
}
.emk-close:hover {
  background: #f9fafb;
  color: #111;
  border-color: #d4d4d4;
}

/* ── 본문 ── */
.emk-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.emk-body::-webkit-scrollbar { width: 5px; }
.emk-body::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 999px;
}
.emk-body::-webkit-scrollbar-track { background: transparent; }

/* ── 메시지 ── */
.emk-msg-wrap {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  max-width: 100%;
}
.emk-msg-wrap.user {
  flex-direction: row-reverse;
}
.emk-msg-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand, #c8115a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 10px;
  flex-shrink: 0;
}
.emk-msg-wrap.user .emk-msg-icon { display: none; }
.emk-msg-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.emk-msg-wrap.user .emk-msg-content {
  align-items: flex-end;
}

.emk-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
}
.emk-msg.bot {
  background: #fff;
  border: 1px solid #e8e8e8;
  color: #111;
  border-top-left-radius: 4px;
}
.emk-msg.user {
  background: var(--brand, #c8115a);
  color: #fff;
  border-top-right-radius: 4px;
}
.emk-msg b { font-weight: 700; }
.emk-msg a { color: var(--brand, #c8115a); text-decoration: none; }
.emk-msg a:hover { text-decoration: underline; }

/* ── 빠른 답변 버튼 ── */
.emk-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  max-width: 100%;
}
.emk-quick-btn {
  padding: 6px 11px;
  background: #fff;
  border: 1px solid var(--brand, #c8115a);
  color: var(--brand, #c8115a);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
}
.emk-quick-btn:hover {
  background: var(--brand, #c8115a);
  color: #fff;
}

/* ── 타이핑 ── */
.emk-typing {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  border-top-left-radius: 4px;
}
.emk-typing .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #999;
  animation: emk-typ 1s infinite;
}
.emk-typing .d:nth-child(2) { animation-delay: 0.15s; }
.emk-typing .d:nth-child(3) { animation-delay: 0.3s; }
@keyframes emk-typ {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ── 입력 영역 ── */
.emk-foot {
  border-top: 1px solid #f0f0f0;
  padding: 10px 12px;
  background: #fff;
  flex-shrink: 0;
}
.emk-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.emk-input {
  flex: 1;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #111;
  height: 34px;
  transition: border-color 0.15s;
}
.emk-input:focus {
  outline: none;
  border-color: var(--brand, #c8115a);
}
.emk-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand, #c8115a);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s;
}
.emk-send:hover {
  background: var(--brand-dark, #a00e49);
}

/* ── 모바일 ── */
@media (max-width: 480px) {
  .emk-fab {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
  .emk-panel {
    bottom: 80px;
    right: 16px;
    left: 16px;
    width: auto;
    height: calc(100vh - 100px);
    max-height: 600px;
  }
}
