/* ==========================================================================
   Whispor AI Assistant — floating chat widget
   Prefix: wc- (whispor chat) to avoid collision with main stylesheet
   ========================================================================== */

/* Container -------------------------------------------------------- */
.wc {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

/* FAB (floating action button) ------------------------------------ */
.wc-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--coral-500);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(224, 122, 95, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    background 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.wc-fab:hover {
  background: var(--coral-400);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(224, 122, 95, 0.5), 0 3px 10px rgba(0, 0, 0, 0.12);
}
.wc-fab svg {
  width: 26px;
  height: 26px;
}
.wc.is-open .wc-fab {
  display: none;
}

/* Intro pulse — draws attention on first visit */
.wc-fab.has-pulse {
  animation: wcPulse 2.4s ease-in-out 3;
}
@keyframes wcPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(224, 122, 95, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 4px 20px rgba(224, 122, 95, 0.4), 0 0 0 10px rgba(224, 122, 95, 0.15); }
}

/* Panel ----------------------------------------------------------- */
.wc-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(10, 46, 56, 0.18), 0 2px 12px rgba(10, 46, 56, 0.08);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
}
.wc.is-open .wc-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Panel header ---------------------------------------------------- */
.wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--teal-900);
  color: #fff;
  flex-shrink: 0;
}
.wc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wc-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
.wc-header-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.wc-header-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 8px;
  font-weight: 400;
}
.wc-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wc-home {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s var(--ease);
}
.wc-home:hover {
  background: rgba(255, 255, 255, 0.18);
}
.wc-home svg {
  width: 15px;
  height: 15px;
}
.wc-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s var(--ease);
}
.wc-close:hover {
  background: rgba(255, 255, 255, 0.18);
}
.wc-close svg {
  width: 16px;
  height: 16px;
}

/* Message body ---------------------------------------------------- */
.wc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.wc-body::-webkit-scrollbar {
  width: 4px;
}
.wc-body::-webkit-scrollbar-track {
  background: transparent;
}
.wc-body::-webkit-scrollbar-thumb {
  background: rgba(10, 46, 56, 0.12);
  border-radius: 4px;
}

/* Messages -------------------------------------------------------- */
.wc-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: wcFadeIn 0.25s var(--ease);
}
@keyframes wcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.wc-msg p { margin: 0 0 0.5em; }
.wc-msg p:last-child { margin: 0; }
.wc-msg a {
  color: var(--coral-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* AI messages — left aligned */
.wc-msg.wc-msg--ai {
  align-self: flex-start;
  background: var(--mist-100);
  color: var(--ink-900);
  border-bottom-left-radius: 4px;
}

/* User messages — right aligned */
.wc-msg.wc-msg--user {
  align-self: flex-end;
  background: var(--teal-900);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Welcome message ------------------------------------------------- */
.wc-welcome {
  text-align: center;
  padding: 20px 8px 8px;
  animation: wcFadeIn 0.3s var(--ease);
}
.wc-welcome-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mist-200);
  color: var(--coral-500);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.wc-welcome-icon svg {
  width: 22px;
  height: 22px;
}
.wc-welcome h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink-900);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.wc-welcome p {
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}

/* Quick-start suggestions */
.wc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}
.wc-suggest-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-700);
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.wc-suggest-btn:hover {
  border-color: var(--coral-500);
  color: var(--coral-500);
  background: rgba(224, 122, 95, 0.04);
}

/* Typing indicator ------------------------------------------------ */
.wc-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--mist-100);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  animation: wcFadeIn 0.2s var(--ease);
}
.wc-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-400);
  animation: wcBounce 1.2s ease-in-out infinite;
}
.wc-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.wc-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes wcBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Email capture card ---------------------------------------------- */
.wc-email-card {
  background: var(--mist-100);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  animation: wcFadeIn 0.3s var(--ease);
}
.wc-email-card p {
  font-size: 12.5px;
  color: var(--ink-700);
  margin: 0 0 10px;
  line-height: 1.45;
}
.wc-email-form {
  display: flex;
  gap: 6px;
}
.wc-email-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-900);
  background: #fff;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.wc-email-input:focus {
  border-color: var(--coral-500);
}
.wc-email-input::placeholder {
  color: var(--ink-400);
}
.wc-email-submit {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: var(--coral-500);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  white-space: nowrap;
}
.wc-email-submit:hover {
  background: var(--coral-400);
}
.wc-email-skip {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-400);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}
.wc-email-skip:hover {
  color: var(--ink-500);
}

/* Briefing CTA card ----------------------------------------------- */
.wc-cta-card {
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-800) 100%);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  animation: wcFadeIn 0.3s var(--ease);
}
.wc-cta-card p {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 10px;
}
.wc-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--coral-500);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.wc-cta-btn:hover {
  background: var(--coral-400);
  transform: translateY(-1px);
}
.wc-cta-btn .arrow {
  transition: transform 0.2s var(--ease);
}
.wc-cta-btn:hover .arrow {
  transform: translateX(3px);
}

/* Input bar ------------------------------------------------------- */
.wc-input-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  flex-shrink: 0;
}
.wc-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wc-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-900);
  background: var(--mist-100);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.wc-input:focus {
  border-color: var(--coral-500);
  background: #fff;
}
.wc-input::placeholder {
  color: var(--ink-400);
}
.wc-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--teal-900);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition:
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.wc-send:hover {
  background: var(--teal-800);
  transform: translateY(-1px);
}
.wc-send:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.wc-send svg {
  width: 16px;
  height: 16px;
}

/* Footer disclaimer ----------------------------------------------- */
.wc-footer {
  padding: 0 14px 8px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-400);
  background: #fff;
  flex-shrink: 0;
}

/* Responsive — mobile --------------------------------------------- */
@media (max-width: 480px) {
  .wc {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .wc-panel {
    width: auto;
    left: 0;
    right: 0;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    border-radius: 16px 16px var(--radius-lg) var(--radius-lg);
  }
  .wc-fab {
    position: fixed;
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 420px) {
  .wc-panel {
    border-radius: 14px;
  }
  .wc-msg {
    max-width: 92%;
  }
}
