/* ─────────────────────────────────────────────────────────────
   ask-branden.css — Floating chat widget styling
   Loaded site-wide. Activates on the bottom-right corner.
   ───────────────────────────────────────────────────────────── */

/* The floating launcher button */
.ab-launcher {
  position: fixed;
  right: 22px; bottom: 22px;
  height: 56px;
  padding: 0 20px 0 17px;
  border-radius: 30px;
  background: linear-gradient(135deg, #c9a84c 0%, #d9b85c 100%);
  color: #0b1f3a;
  border: none;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 10px 28px rgba(11,31,58,.35),
              0 0 0 1px rgba(255,255,255,.1) inset;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s,
              width .25s cubic-bezier(.2,.7,.2,1), padding .25s, border-radius .25s;
  font-family: 'Geist', 'Inter', sans-serif;
}
.ab-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px rgba(11,31,58,.45),
              0 0 0 1px rgba(255,255,255,.15) inset;
}
.ab-launcher svg { width: 26px; height: 26px; flex-shrink: 0; }
.ab-launcher-label {
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  line-height: 1.1;
}
.ab-label-main {
  font-size: .92rem; font-weight: 700;
  letter-spacing: .005em; white-space: nowrap;
  color: #0b1f3a;
}
.ab-label-sub {
  font-size: .52rem; font-weight: 600;
  letter-spacing: .01em; white-space: nowrap;
  color: rgba(11,31,58,.6); margin-top: 1px;
}

/* When the chat is open, collapse the pill back to a circular icon button */
.ab-launcher.open {
  width: 56px; padding: 0; gap: 0;
  border-radius: 50%;
}
.ab-launcher.open .ab-launcher-label { display: none; }

/* Pulse to draw attention on first load */
.ab-launcher::before {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 30px;
  background: rgba(201,168,76,.3);
  z-index: -1;
  animation: abPulse 2.4s ease-in-out infinite;
}
@keyframes abPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.1); opacity: 0; }
}
.ab-launcher.open::before { display: none; }

/* Tooltip "Ask Branden" that appears on hover */
.ab-launcher-tip {
  position: fixed;
  right: 92px; bottom: 32px;
  background: rgba(11,31,58,.95);
  color: #fff;
  padding: .55rem 1rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .25s, transform .25s;
  z-index: 8999;
  box-shadow: 0 4px 14px rgba(11,31,58,.25);
  white-space: nowrap;
}
.ab-launcher-tip.show { opacity: 1; transform: translateX(0); }
.ab-tip-spark { color: #c9a84c; }

/* The chat panel */
.ab-panel {
  position: fixed;
  right: 22px; bottom: 92px;
  width: 380px; max-width: calc(100vw - 44px);
  height: 560px; max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(11,31,58,.35),
              0 0 0 1px var(--border, #e4e7ed);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9000;
  font-family: 'Geist', 'Inter', sans-serif;
  transform-origin: bottom right;
  animation: abPanelIn .28s cubic-bezier(.2,.7,.2,1);
}
.ab-panel.open { display: flex; }
@keyframes abPanelIn {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.ab-header {
  background: linear-gradient(135deg, #0b1f3a 0%, #13305e 100%);
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(201,168,76,.2);
}
.ab-header-left { display: flex; align-items: center; gap: .65rem; }
.ab-header-dot {
  width: 8px; height: 8px;
  background: #52c77e; border-radius: 50%;
  box-shadow: 0 0 8px #52c77e;
}
.ab-header-name {
  font-size: .92rem; font-weight: 700;
  letter-spacing: .02em;
}
.ab-header-sub {
  font-size: .65rem; font-weight: 500;
  color: rgba(255,255,255,.6);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ab-close {
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,.6); font-size: 1.4rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.ab-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Message area */
.ab-messages {
  flex: 1; overflow-y: auto;
  padding: 1.1rem 1.1rem .6rem;
  background: #f7f8fa;
  display: flex; flex-direction: column; gap: .65rem;
  scroll-behavior: smooth;
}
.ab-messages::-webkit-scrollbar { width: 6px; }
.ab-messages::-webkit-scrollbar-thumb { background: rgba(11,31,58,.15); border-radius: 3px; }

.ab-msg {
  max-width: 88%;
  padding: .7rem .9rem;
  font-size: .85rem;
  line-height: 1.55;
  border-radius: 14px;
}
.ab-msg.bot {
  background: #fff;
  color: #1c2333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border, #e4e7ed);
}
.ab-msg.user {
  background: linear-gradient(135deg, #0b1f3a 0%, #13305e 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ab-msg.bot a { color: #c9a84c; text-decoration: underline; font-weight: 600; }
.ab-msg.bot strong { color: #0b1f3a; }

/* Typing indicator */
.ab-typing {
  display: inline-flex; gap: 3px;
  padding: .8rem .9rem;
}
.ab-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(11,31,58,.4);
  animation: abTyping 1.4s ease-in-out infinite;
}
.ab-typing span:nth-child(2) { animation-delay: .18s; }
.ab-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes abTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Suggestion chips on first open */
.ab-suggestions {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-top: .5rem; padding: 0 .25rem;
}
.ab-suggestion {
  font-size: .72rem; font-weight: 600;
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.3);
  color: #6e5c25;
  padding: .35rem .65rem;
  border-radius: 16px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  font-family: inherit;
}
.ab-suggestion:hover {
  background: rgba(201,168,76,.2);
  transform: translateY(-1px);
}

/* Input area */
.ab-input-row {
  display: flex; gap: .5rem;
  padding: .8rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid var(--border, #e4e7ed);
}
.ab-input {
  flex: 1;
  border: 1px solid var(--border, #e4e7ed);
  border-radius: 22px;
  padding: .65rem 1rem;
  font-size: .85rem;
  font-family: inherit;
  background: #f7f8fa;
  color: #1c2333;
  outline: none;
  transition: border-color .15s, background .15s;
  resize: none;
  max-height: 100px;
  min-height: 40px;
}
.ab-input:focus {
  border-color: rgba(201,168,76,.6);
  background: #fff;
}
.ab-send {
  background: linear-gradient(135deg, #c9a84c 0%, #d9b85c 100%);
  color: #0b1f3a;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, opacity .15s;
  flex-shrink: 0;
}
.ab-send:hover:not(:disabled) { transform: scale(1.06); }
.ab-send:disabled { opacity: 0.5; cursor: not-allowed; }
.ab-send svg { width: 18px; height: 18px; }

/* Footnote */
.ab-foot {
  font-size: .62rem;
  color: rgba(107,122,147,.7);
  text-align: center;
  padding: 0 1rem .65rem;
  background: #fff;
  letter-spacing: .02em;
}

/* Mobile tightening */
@media (max-width: 480px) {
  .ab-launcher { right: 16px; bottom: 16px; width: 54px; height: 54px; padding: 0; gap: 0; border-radius: 50%; }
  .ab-panel {
    right: 8px; bottom: 78px;
    width: calc(100vw - 16px);
    height: calc(100vh - 96px);
    border-radius: 14px;
  }
  .ab-launcher-label { display: none; }
}

/* Hide on print */
@media print {
  .ab-launcher, .ab-panel, .ab-launcher-tip { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ab-launcher::before { animation: none; }
  .ab-panel { animation: none; }
  .ab-typing span { animation: none; }
}
