/* ===================================
   Guider CSS - Guider 데모 채팅 위젯 & 클릭 안내 오버레이
   =================================== */

/* ---------- 런처 버튼 (흰 원 + 로고 + 보랏빛 글로우) ---------- */
.guider-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(139, 44, 255, 0.28), 0 2px 6px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: var(--transition);
}

.guider-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 30px rgba(139, 44, 255, 0.38), 0 2px 6px rgba(15, 23, 42, 0.12);
}

.guider-launcher.is-open {
  transform: scale(0.94);
}

.guider-launcher img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* 처음 열기 전까지 은은한 글로우 펄스 */
.guider-launcher:not(.seen) {
  animation: guiderLauncherPulse 2.4s ease-in-out infinite;
}

@keyframes guiderLauncherPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(139, 44, 255, 0.28), 0 0 0 0 rgba(139, 44, 255, 0.3); }
  50% { box-shadow: 0 8px 24px rgba(139, 44, 255, 0.28), 0 0 0 12px rgba(139, 44, 255, 0); }
}

/* ---------- 채팅 패널 (밝은 테마, 실제 Guider 확장 UI 기준) ---------- */
.guider-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 1500;
  width: 400px;
  max-height: min(620px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: var(--transition);
}

.guider-panel.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.guider-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px 24px;
  border-bottom: 1px solid #ececf1;
}

.guider-header-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.guider-header-title {
  margin-left: 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a2e;
}

.guider-header-divider {
  color: #d0d0da;
}

.guider-header-site {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  color: #6b6b80;
}

.guider-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f1f5;
  color: #6b6b80;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.guider-close:hover {
  background: #e4e4ec;
  color: #1a1a2e;
}

/* ---------- 메시지 영역 ---------- */
.guider-messages {
  flex: 1;
  min-height: 200px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* 첫 화면 */
.guider-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 12px;
}

.guider-welcome-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(200, 80, 255, 0.35));
}

.guider-welcome-title {
  margin-top: 18px;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(90deg, #e23aa8, #8b2cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.guider-welcome-desc {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #7a7a8c;
}

.guider-suggestions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.guider-example {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  background: #fbf0f8;
  border: 1px solid #f3d9ee;
  border-radius: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.guider-example:hover {
  background: #f8e4f3;
  border-color: #eab8de;
  transform: translateY(-1px);
}

.guider-example-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d6338f;
}

.guider-example-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* 말풍선 */
.guider-msg {
  max-width: 85%;
  padding: 11px 15px;
  font-size: 0.9rem;
  line-height: 1.55;
  border-radius: 18px;
  word-break: keep-all;
  white-space: pre-line;
  animation: guiderMsgIn 0.25s ease-out;
}

@keyframes guiderMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.guider-msg-bot {
  align-self: flex-start;
  color: #2b2b3c;
  background: #f4f4f8;
  border-bottom-left-radius: 6px;
}

.guider-msg-bot b {
  color: #b02a8f;
}

.guider-msg-user {
  align-self: flex-end;
  color: var(--white);
  background: linear-gradient(135deg, #e23aa8, #8b2cff);
  border-bottom-right-radius: 6px;
}

.guider-msg-thinking {
  color: #8a8a9c;
  font-size: 0.82rem;
  background: transparent;
  border: 1px dashed #dcdce6;
}

.guider-msg-place {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8b2cff;
  border-top: 1px solid #e6e6ee;
}

/* ---------- 입력 ---------- */
.guider-form {
  padding: 16px 20px 12px;
  border-top: 1px solid #ececf1;
}

.guider-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 20px;
  background: #f4f4f8;
  border: 1px solid transparent;
  border-radius: 30px;
  transition: var(--transition);
}

.guider-input-box:focus-within {
  border-color: #eab8de;
  background: var(--white);
}

.guider-input {
  flex: 1;
  min-width: 0;
  max-height: 96px;
  padding: 8px 0;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #1a1a2e;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
}

.guider-input::placeholder {
  color: #a0a0b2;
}

.guider-mic,
.guider-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.guider-mic {
  color: #6b6b80;
  background: #e8e8ef;
  font-size: 1rem;
}

.guider-mic:hover {
  background: #dcdce6;
}

.guider-send {
  color: var(--white);
  background: linear-gradient(135deg, #e86fc4, #a77bf0);
  font-size: 1rem;
}

/* 아래쪽 화살표를 45° 돌려 ↙ 모양 */
.guider-send i {
  transform: rotate(45deg);
}

.guider-send:hover {
  background: linear-gradient(135deg, #e23aa8, #8b2cff);
}

.guider-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #a0a0b2;
  text-align: center;
}

/* ---------- 클릭 안내 오버레이 ---------- */
.guider-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.guider-overlay.active {
  opacity: 1;
}

.guider-highlight {
  position: fixed;
  border: 3px solid #ff1aa8;
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(255, 26, 168, 0.25), 0 0 24px rgba(255, 26, 168, 0.6);
  animation: guiderHighlightPulse 1.4s ease-in-out infinite;
}

@keyframes guiderHighlightPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 26, 168, 0.25), 0 0 24px rgba(255, 26, 168, 0.6); }
  50% { box-shadow: 0 0 0 10px rgba(255, 26, 168, 0.05), 0 0 32px rgba(139, 44, 255, 0.7); }
}

/* 화살표: 기본은 대상 위쪽에서 아래를 가리킴 */
.guider-pointer {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -100%);
  animation: guiderBounceDown 0.9s ease-in-out infinite;
}

.guider-pointer.below {
  flex-direction: column-reverse;
  transform: translate(-50%, 0);
  animation-name: guiderBounceUp;
}

.guider-pointer.below .guider-pointer-arrow {
  transform: rotate(180deg);
}

.guider-pointer-label {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  background: linear-gradient(135deg, #ff1aa8, #8b2cff);
  border-radius: 50px;
  box-shadow: 0 6px 18px rgba(139, 44, 255, 0.45);
}

.guider-pointer-arrow {
  font-size: 1.8rem;
  color: #ff1aa8;
  filter: drop-shadow(0 4px 8px rgba(255, 26, 168, 0.6));
}

@keyframes guiderBounceDown {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -10px; }
}

@keyframes guiderBounceUp {
  0%, 100% { margin-top: 0; }
  50% { margin-top: 10px; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 768px) {
  .guider-launcher {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .guider-launcher img {
    width: 30px;
    height: 30px;
  }

  .guider-panel {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-height: calc(100vh - 110px);
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guider-launcher:not(.seen),
  .guider-highlight,
  .guider-pointer,
  .guider-msg {
    animation: none;
  }
}
