/* Kura Chat Widget — scoped under .kura-chat-* to avoid global collisions */

/* ── Launcher pill ─────────────────────────────────────────────────── */
.kura-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--teal, #0d5c63);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(13, 92, 99, 0.45);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  animation: kuraPulse 3s ease-in-out infinite;
}

.kura-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(13, 92, 99, 0.55);
  background: #0a4e54;
  animation: none;
}

.kura-chat-launcher.kura-is-open {
  animation: none;
}

.kura-chat-launcher-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes kuraPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(13, 92, 99, 0.45); }
  50% { box-shadow: 0 4px 32px rgba(13, 92, 99, 0.75), 0 0 0 6px rgba(13, 92, 99, 0.12); }
}

/* ── Chat card ─────────────────────────────────────────────────────── */
.kura-chat-card {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 9001;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--color-card, #111d1e);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform-origin: bottom right;
  animation: kuraSlideUp 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kura-chat-card.kura-closing {
  animation: kuraSlideDown 200ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes kuraSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes kuraSlideDown {
  from { opacity: 1; transform: translateY(0)   scale(1); }
  to   { opacity: 0; transform: translateY(20px) scale(0.97); }
}

/* ── Header ────────────────────────────────────────────────────────── */
.kura-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--teal, #0d5c63);
  flex-shrink: 0;
}

.kura-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kura-chat-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
  animation: kuraOnlinePulse 2.5s ease-in-out infinite;
}

@keyframes kuraOnlinePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.1); }
}

.kura-chat-header-title {
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.kura-chat-header-sub {
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

.kura-chat-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 150ms ease;
  flex-shrink: 0;
}

.kura-chat-close:hover {
  background: rgba(255,255,255,0.22);
}

/* ── Messages area ─────────────────────────────────────────────────── */
.kura-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.kura-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.kura-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* ── Individual bubbles ────────────────────────────────────────────── */
.kura-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: kuraMsgIn 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.kura-msg.kura-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.kura-msg.kura-msg-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.kura-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.kura-msg-user .kura-msg-bubble {
  background: var(--teal, #0d5c63);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.kura-msg-bot .kura-msg-bubble {
  background: var(--color-card, #1a2829);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  color: var(--color-text, #e8f4f5);
  border-bottom-left-radius: 4px;
}

/* ── Typing indicator ──────────────────────────────────────────────── */
.kura-typing {
  display: flex;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: var(--color-card, #1a2829);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.kura-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-muted, rgba(255,255,255,0.4));
  animation: kuraTypingBounce 1.2s ease-in-out infinite;
}

.kura-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.kura-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes kuraTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick-reply chips ─────────────────────────────────────────────── */
.kura-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.kura-chip {
  padding: 7px 14px;
  border: 1px solid var(--teal, #0d5c63);
  color: var(--teal, #0d5c63);
  background: transparent;
  border-radius: 9999px;
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.kura-chip:hover {
  background: var(--teal, #0d5c63);
  color: #fff;
}

/* ── Input area ────────────────────────────────────────────────────── */
.kura-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border, rgba(255,255,255,0.08));
  background: var(--color-bg, #0b1617);
  flex-shrink: 0;
}

.kura-chat-input {
  flex: 1;
  background: var(--color-card, #1a2829);
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  border-radius: 9999px;
  padding: 9px 16px;
  color: var(--color-text, #e8f4f5);
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease;
  min-width: 0;
}

.kura-chat-input::placeholder {
  color: var(--color-muted, rgba(255,255,255,0.35));
}

.kura-chat-input:focus {
  border-color: var(--teal, #0d5c63);
}

.kura-chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kura-chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--teal, #0d5c63);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}

.kura-chat-send:hover:not(:disabled) {
  background: #0a4e54;
  transform: scale(1.05);
}

.kura-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 430px) {
  .kura-chat-card {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .kura-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
