/* GT Assistant - Frontend (Premium) */

:root{
  --gta-accent:#3b82f6;
  --gta-bg:#ffffff;
  --gta-fg:#0f172a;
  --gta-muted:#64748b;
  --gta-card:#ffffff;
  --gta-border:rgba(15,23,42,.12);
  --gta-shadow:0 12px 30px rgba(2,6,23,.16);
  --gta-radius:16px;
  --gta-font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
}

#gt-assistant-root,
#gt-assistant-root .gta{
  position:fixed;
  bottom:18px;
  z-index:999999;
  font-family:var(--gta-font);
}

/* allow only widget to receive clicks */
#gt-assistant-root,
#gt-assistant-root .gta { pointer-events:none; }
#gt-assistant-root .gta__launcher,
#gt-assistant-root .gta__panel,
#gt-assistant-root .gta__panel * { pointer-events:auto; }

.gta--right{ right:18px; left:auto; }
.gta--left{ left:18px; right:auto; }

.gta__launcher{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--gta-card);
  color:var(--gta-fg);
  border:1px solid var(--gta-border);
  border-radius:999px;
  padding:10px 14px;
  box-shadow:var(--gta-shadow);
  cursor:pointer;
  user-select:none;
}

.gta__dot{
  width:10px;height:10px;border-radius:50%;
  background:var(--gta-accent);
  box-shadow:0 0 0 6px rgba(59,130,246,.14);
}

.gta__label{
  font-weight:600;
  font-size:13px;
  letter-spacing:.2px;
  color: var(--gta-fg) !important;
}

.gta__panel{
  position:absolute;
  bottom:56px;
  width:360px;
  max-width: calc(100vw - 36px);
  background:var(--gta-card);
  border:1px solid var(--gta-border);
  border-radius:var(--gta-radius);
  box-shadow:var(--gta-shadow);
  overflow:hidden;
  opacity:0;
  transform: translateY(10px);
  pointer-events:none;
  transition: opacity .22s ease, transform .22s ease;
}

.gta--left .gta__panel{ left:0; }
.gta--right .gta__panel{ right:0; }

.gta.is-open .gta__panel{
  opacity:1;
  transform: translateY(0);
  pointer-events:auto;
}

.gta__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border-bottom:1px solid var(--gta-border);
  background:linear-gradient(180deg, rgba(59,130,246,.07), rgba(59,130,246,0));
}

.gta__brand{ display:flex; gap:10px; align-items:flex-start; }
.gta__headText{ min-width:0; }

.gta__avatar{
  width:34px;height:34px;border-radius:12px;
  border:1px solid var(--gta-border);
  display:flex;align-items:center;justify-content:center;
  background:rgba(2,6,23,.04);
  overflow:hidden;
  flex:0 0 auto;
}

.gta__avatarDot{
  width:10px;height:10px;border-radius:50%;
  background:var(--gta-accent);
}

.gta__avatarImg{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.gta__title{
  font-size:13px;
  font-weight:800;
  line-height:1.15;
  color: var(--gta-fg) !important; /* FIX theme override */
}

.gta__sub{
  font-size:12px;
  color:var(--gta-muted) !important; /* FIX theme override */
  margin-top:3px;
  max-width:240px;
  white-space:normal;   /* FIX wrap */
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2; /* keep header tidy */
  -webkit-box-orient:vertical;
}

.gta__headerActions{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding-top:2px;
}

.gta__close{
  text-decoration:none !important;
  color:var(--gta-muted) !important;
  font-size:20px;
  line-height:1;
  padding:6px 10px;
  border-radius:10px;
}

.gta__close:hover{ background:rgba(2,6,23,.06); color:var(--gta-fg) !important; }

.gta__reset{
  text-decoration:none !important;
  color:var(--gta-muted) !important;
  font-size:18px;
  line-height:1;
  padding:6px 8px;
  border-radius:10px;
  opacity:.9;
}

.gta__reset:hover{ background:rgba(2,6,23,.06); color:var(--gta-fg) !important; opacity:1; }

.gta__body{ padding:10px 10px 12px; }

/* MESSAGES area: hide scrollbars but keep scroll */
.gta__messages{
  height:260px;
  overflow:auto;
  overflow-x:hidden;     /* FIX horizontal */
  padding:4px 2px;

  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* IE/Edge legacy */
}
.gta__messages::-webkit-scrollbar{ width:0; height:0; } /* Webkit */

.gta__msg{ display:flex; margin:8px 0; }
.gta__msg.is-user{ justify-content:flex-end; }
.gta__msg.is-operator,
.gta__msg.is-system{ justify-content:flex-start; }

.gta__bubble{
  max-width: 86%;
  border:1px solid var(--gta-border);
  border-radius:14px;
  padding:10px 10px;
  background:#fff;
  word-break: break-word;     /* FIX overflow */
  overflow-wrap: anywhere;
}

.gta__msg.is-user .gta__bubble{
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.22);
}

.gta__msg.is-system .gta__bubble{
  background: rgba(2,6,23,.04);
}

.gta__text{
  font-size:13px;
  color:var(--gta-fg) !important;
  line-height:1.35;
}

.gta__attachments{ margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.gta__attachment{
  display:inline-flex;
  padding:6px 8px;
  border-radius:10px;
  border:1px solid var(--gta-border);
  text-decoration:none !important;
  color:var(--gta-fg) !important;
  font-size:12px;
}
.gta__attachment:hover{ border-color: rgba(59,130,246,.35); color: var(--gta-accent) !important; }

.gta__typing{
  display:flex;
  gap:6px;
  padding:6px 2px 10px;
}
.gta__typing[aria-hidden="true"]{ display:none; }
.gta__typing span{
  width:6px;height:6px;border-radius:50%;
  background:rgba(2,6,23,.24);
  animation: gtaDot 1s infinite ease-in-out;
}
.gta__typing span:nth-child(2){ animation-delay:.15s; }
.gta__typing span:nth-child(3){ animation-delay:.3s; }
@keyframes gtaDot{
  0%, 80%, 100%{ transform: translateY(0); opacity:.55; }
  40%{ transform: translateY(-4px); opacity:1; }
}

/* CHOICES: text-only, no borders, no underline */
.gta__choices{ padding:6px 0 8px; }
.gta__choiceList{ display:flex; flex-direction:column; gap:10px; padding:2px 2px 6px; }
.gta__choiceLink{ display:block; padding:7px 0; border:0; border-radius:0; text-decoration:none; background:transparent; color:var(--gta-muted); font-weight:600; }
.gta__choiceLink:hover{ color: var(--gta-accent); text-decoration:none; }
.gta__choiceLink:focus{ outline:none; }
.gta__choiceLink:hover{
  color: var(--gta-accent) !important;
  opacity:1;
}

/* Conversational input box */
.gta__convBox{
  margin-top:6px;
  border:1px solid var(--gta-border);
  border-radius:14px;
  padding:10px;
  background: rgba(2,6,23,.02);
}
.gta__convInput{
  width:100%;
  border:0;
  outline:none;
  background:transparent;
  color: var(--gta-fg) !important;
  font-size:14px;
  padding:4px 0;
}
.gta__convHint{
  margin-top:6px;
  font-size:11px;
  color: var(--gta-muted) !important;
}
.gta__convCancel{
  display:inline-block;
  margin-top:10px;
  font-size:12px;
  text-decoration:none !important;
  color: var(--gta-muted) !important;
}
.gta__convCancel:hover{ color: var(--gta-accent) !important; }

.gta__footer{
  padding:8px 12px;
  border-top:1px solid var(--gta-border);
  font-size:11px;
  color:var(--gta-muted) !important;
}

/* Themes */
.gta--theme-dark{
  --gta-bg:#0b1220;
  --gta-fg:#e5e7eb;
  --gta-muted:#a3a3a3;
  --gta-card:#0f172a;
  --gta-border:rgba(255,255,255,.10);
}
.gta--theme-dark .gta__bubble{ background: rgba(255,255,255,.04); }

.gta--theme-apple{
  --gta-bg:#ffffff;
  --gta-fg:#111827;
  --gta-muted:#6b7280;
  --gta-card:#ffffff;
  --gta-border:rgba(17,24,39,.12);
  --gta-radius:18px;
}
.gta--theme-minimal{
  --gta-shadow:0 8px 18px rgba(2,6,23,.12);
  --gta-radius:14px;
}

/* Responsive */
@media (max-width: 420px){
  .gta__panel{ width: min(360px, calc(100vw - 24px)); }
  .gta--right{ right:12px; }
  .gta--left{ left:12px; }
}


#gt-assistant-root .gta__messages{ -ms-overflow-style:none; scrollbar-width:none; }
#gt-assistant-root .gta__messages::-webkit-scrollbar{ width:0; height:0; }
