/* Tamebillow Chatbot — frontend styles */

/* ---- Variables ---- */
:root {
  --tbc-accent:     #042C53;
  --tbc-accent-lt:  #E6F1FB;
  --tbc-accent-mid: #185FA5;
  --tbc-radius:     14px;
  --tbc-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Floating bubble ---- */
#tbc-float-root { position: fixed; bottom: 24px; right: 24px; z-index: 99999; font-family: var(--tbc-font); }

.tbc-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--tbc-accent, #042C53);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(4,44,83,.35);
  transition: transform .15s;
}
.tbc-fab:hover  { transform: scale(1.07); }
.tbc-fab svg    { width: 24px; height: 24px; fill: #fff; }
.tbc-fab-badge  { position: absolute; top: 0; right: 0; width: 14px; height: 14px; border-radius: 50%; background: #E24B4A; border: 2px solid #fff; display: none; }

/* ---- Chat window (shared by float + embed) ---- */
.tbc-window {
  width: 360px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: var(--tbc-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  font-family: var(--tbc-font);
}

/* float window */
#tbc-float-root .tbc-window {
  position: absolute; bottom: 68px; right: 0;
  height: 520px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: none;
}
#tbc-float-root .tbc-window.tbc-open { display: flex; }

/* embed window */
.tbc-embed-root .tbc-window {
  width: 100%; height: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.tbc-embed-root { border-radius: var(--tbc-radius); overflow: hidden; }

/* ---- Header ---- */
.tbc-header {
  background: var(--tbc-accent, #042C53);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.tbc-header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.tbc-header-text p   { font-size: 14px; font-weight: 600; color: #fff; margin: 0; }
.tbc-header-text span{ font-size: 11px; color: rgba(255,255,255,.7); }
.tbc-header-close    { margin-left: auto; background: none; border: none; cursor: pointer; color: rgba(255,255,255,.7); font-size: 20px; line-height: 1; padding: 0; }
.tbc-header-close:hover { color: #fff; }

/* ---- Messages ---- */
.tbc-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}

.tbc-row-bot { display: flex; gap: 7px; align-items: flex-end; }
.tbc-row-usr { display: flex; justify-content: flex-end; }

.tbc-mini {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--tbc-accent, #042C53);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff; flex-shrink: 0;
}

.tbc-bubble-bot {
  background: #f4f5f7;
  border-radius: 14px 14px 14px 4px;
  padding: 9px 13px; max-width: 82%;
  font-size: 13px; line-height: 1.6; color: #1a1a1a;
}
.tbc-bubble-usr {
  background: var(--tbc-accent, #042C53);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 13px; max-width: 78%;
  font-size: 13px; line-height: 1.6; color: #fff;
}

/* ---- Quick buttons ---- */
.tbc-qb-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tbc-qb {
  background: #fff; border: 1px solid #cbd5e1;
  border-radius: 20px; padding: 4px 11px;
  font-size: 12px; color: #1e3a5f; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.tbc-qb:hover { background: var(--tbc-accent-lt, #E6F1FB); border-color: var(--tbc-accent-mid, #185FA5); color: var(--tbc-accent, #042C53); }

/* ---- Product card ---- */
.tbc-prod-card {
  background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 10px 12px; margin-top: 8px;
  font-size: 12px;
}
.tbc-prod-name    { font-weight: 600; font-size: 13px; color: #111; margin-bottom: 2px; }
.tbc-prod-price   { font-weight: 600; color: var(--tbc-accent-mid, #185FA5); margin-bottom: 3px; }
.tbc-prod-benefit { color: #555; line-height: 1.5; margin-bottom: 7px; }
.tbc-prod-cta {
  display: inline-block;
  background: var(--tbc-accent, #042C53);
  color: #fff; border-radius: 20px;
  padding: 5px 14px; font-size: 12px;
  text-decoration: none; font-weight: 500;
}
.tbc-prod-cta:hover { background: var(--tbc-accent-mid, #185FA5); color: #fff; }

/* ---- Redirect notice ---- */
.tbc-redirect {
  background: #fff8ed; border: 1px solid #f6c06b;
  border-radius: 8px; padding: 9px 11px;
  font-size: 12px; color: #7a4a00; margin-top: 6px; line-height: 1.6;
}
.tbc-redirect a { color: #854F0B; font-weight: 500; }

/* ---- Typing ---- */
.tbc-typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.tbc-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #888;
  animation: tbcBop 1.2s infinite;
}
.tbc-typing span:nth-child(2) { animation-delay: .2s; }
.tbc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes tbcBop { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* ---- Input bar ---- */
.tbc-input-bar {
  border-top: 1px solid #e5e7eb; background: #fff;
  padding: 9px 12px; display: flex; gap: 8px; align-items: center;
  flex-shrink: 0;
}
.tbc-input-bar input {
  flex: 1; border: 1px solid #e5e7eb; border-radius: 20px;
  padding: 7px 13px; font-size: 13px; outline: none;
  font-family: var(--tbc-font); color: #111;
}
.tbc-input-bar input:focus { border-color: var(--tbc-accent-mid, #185FA5); }
.tbc-send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--tbc-accent, #042C53); border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tbc-send-btn svg { width: 14px; height: 14px; fill: #fff; }
.tbc-send-btn:hover { background: var(--tbc-accent-mid, #185FA5); }

/* ---- Responsive ---- */
@media (max-width: 420px) {
  #tbc-float-root .tbc-window { width: calc(100vw - 24px); right: 0; }
}
