/* Ask Friendly HR — Chatbot styles
 * Uses brand palette (navy #1A3557, orange #E8723A, cream #FDF6EC)
 */

/* ── Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────── */
:root {
  --cb-navy:      #1A3557;
  --cb-navy-lt:   #2D4F7A;
  --cb-orange:    #E8723A;
  --cb-orange-lt: #F5A574;
  --cb-cream:     #FDF6EC;
  --cb-cream-dk:  #F0DCC4;
  --cb-white:     #FFFFFF;
  --cb-text:      #2A2A2A;
  --cb-text-soft: #5A5A5A;
  --cb-border:    #E8D9C5;
  --cb-shadow:    rgba(26,53,87,0.1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--cb-cream);
  color: var(--cb-text);
  font-size: 16px;
}

/* ── Header ─────────────────────────────────────────── */
.cb-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--cb-navy);
  border-bottom: 2px solid var(--cb-orange);
  flex-shrink: 0;
}

.cb-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.cb-back:hover {
  background: rgba(255,255,255,0.12);
  color: var(--cb-white);
}

.cb-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(232,114,58,0.15);
  border: 2px solid var(--cb-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cb-header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cb-header-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cb-white);
}

.cb-header-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
}

/* ── Disclaimer banner ──────────────────────────────── */
.cb-disclaimer-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: #FFF8EC;
  border-bottom: 1px solid var(--cb-orange-lt);
  font-size: 0.75rem;
  color: #7A4010;
  font-weight: 500;
  flex-shrink: 0;
  line-height: 1.5;
}

/* ── Chat area ──────────────────────────────────────── */
.cb-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
  scroll-padding-bottom: 80px;
}

/* ── Messages ───────────────────────────────────────── */
.cb-message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 100%;
  animation: cb-fadeIn 0.3s ease;
}

@keyframes cb-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cb-message--ai {
  /* AI aligns left */
}

.cb-message--user {
  flex-direction: row-reverse;
}

.cb-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cb-message--ai .cb-message-avatar {
  background: var(--cb-cream-dk);
  border: 1.5px solid var(--cb-border);
}

.cb-message--user .cb-message-avatar {
  background: var(--cb-navy-lt);
}

.cb-message-bubble {
  max-width: min(480px, 85%);
  padding: 0.85rem 1.1rem;
  border-radius: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.65;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.cb-message--ai .cb-message-bubble {
  background: var(--cb-white);
  border: 1.5px solid var(--cb-border);
  border-bottom-left-radius: 0.3rem;
  color: var(--cb-text);
  box-shadow: 0 2px 12px var(--cb-shadow);
}

.cb-message--user .cb-message-bubble {
  background: var(--cb-navy);
  color: var(--cb-white);
  border-bottom-right-radius: 0.3rem;
}

.cb-message-bubble p {
  margin: 0;
}

.cb-message-bubble p + p {
  margin-top: 0.6em;
}

.cb-message-bubble strong {
  color: var(--cb-orange);
  font-weight: 700;
}

.cb-message--user .cb-message-bubble strong {
  color: var(--cb-orange-lt);
}

/* Loading dots */
.cb-message-bubble--loading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cb-dots {
  display: flex;
  gap: 4px;
}

.cb-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cb-text-soft);
  opacity: 0.4;
  animation: cb-bounce 1.2s ease-in-out infinite;
}

.cb-dots span:nth-child(2) { animation-delay: 0.2s; }
.cb-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* ── Quick prompt suggestions ───────────────────────── */
.cb-suggestions {
  padding: 0.75rem 1.25rem 0.5rem;
  background: var(--cb-cream);
  flex-shrink: 0;
  border-top: 1px solid var(--cb-border);
}

.cb-suggestions-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cb-text-soft);
  margin-bottom: 0.6rem;
}

.cb-suggestions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cb-suggestion-btn {
  background: var(--cb-white);
  border: 1.5px solid var(--cb-border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cb-navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.cb-suggestion-btn:hover {
  background: var(--cb-navy);
  border-color: var(--cb-navy);
  color: var(--cb-white);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--cb-shadow);
}

.cb-suggestion-btn:active {
  transform: translateY(0);
}

/* ── Input area ─────────────────────────────────────── */
.cb-input-area {
  padding: 0.75rem 1.25rem 1rem;
  background: var(--cb-cream);
  border-top: 1px solid var(--cb-border);
  flex-shrink: 0;
}

.cb-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  background: var(--cb-white);
  border: 2px solid var(--cb-border);
  border-radius: 1.2rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cb-input-wrap:focus-within {
  border-color: var(--cb-orange);
  box-shadow: 0 0 0 3px rgba(232,114,58,0.12);
}

.cb-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--cb-text);
  resize: none;
  overflow-y: auto;
  max-height: 140px;
  line-height: 1.5;
  padding: 0.2rem 0;
}

.cb-input::placeholder {
  color: var(--cb-text-soft);
  opacity: 0.7;
}

.cb-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cb-orange);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-white);
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.cb-send-btn:hover:not(:disabled) {
  background: var(--cb-orange-lt);
  transform: scale(1.05);
}

.cb-send-btn:disabled {
  background: var(--cb-cream-dk);
  color: rgba(255,255,255,0.4);
  cursor: not-allowed;
}

.cb-input-note {
  font-size: 0.7rem;
  color: var(--cb-text-soft);
  margin-top: 0.4rem;
  text-align: center;
}

/* ── Upsell banner ─────────────────────────────────── */
.cb-upsell-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: #FFF8EE;
  border-bottom: 1px solid var(--cb-border);
  font-size: 0.85rem;
  color: var(--cb-text);
}

.cb-upsell-banner svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.cb-upsell-banner strong {
  font-weight: 600;
  color: var(--cb-navy);
}

.cb-upsell-btn {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.3rem 0.9rem;
  background: var(--cb-orange);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.cb-upsell-btn:hover {
  background: var(--cb-orange-lt);
}

/* ── Upsell inline (in chat bubble) ────────────────── */
.cb-upsell-inline {
  text-align: center;
}

.cb-upsell-inline p {
  margin-bottom: 0.75rem;
}

.cb-upsell-cta-link {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: var(--cb-orange);
  color: white;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}

.cb-upsell-cta-link:hover {
  background: var(--cb-orange-lt);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .cb-message-bubble {
    max-width: 88%;
  }

  .cb-suggestions-grid {
    gap: 0.4rem;
  }

  .cb-suggestion-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    min-height: 44px;
  }
}