/* ═══════════════════════════════════════════════
   Tec AI Chat — Widget Styles
   Plugin Version: 1.0.0
   © Tec The Education Consultancy
═══════════════════════════════════════════════ */

/* ── Root / tokens ── */
#tec-popup-root {
  --tec-navy:     #0B1D3A;
  --tec-blue:     #1A3A6B;
  --tec-teal:     #00B4D0;
  --tec-teal-dk:  #007B96;
  --tec-purple:   #3D3A8C;
  --tec-purp-mid: #534AB7;
  --tec-purp-lt:  #EEEDFE;
  --tec-bg:       #F5F8FB;
  --tec-surface:  #FFFFFF;
  --tec-border:   #D0DCE8;
  --tec-border-s: #E4EDF5;
  --tec-t1:       #0B1D3A;
  --tec-t2:       #2C4A6B;
  --tec-t3:       #6B87A8;
  --tec-sh-md: 0 8px 32px rgba(11,29,58,.22);
  --tec-sh-lg: 0 16px 56px rgba(11,29,58,.28);

  /* Override with admin colour picks (set via inline style by JS) */
  --tec-accent: var(--tec-teal);
  --tec-dark:   var(--tec-navy);

  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'Inter', sans-serif;
}

/* ── Tooltip ── */
#tec-tooltip {
  background: var(--tec-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 99px;
  border: 1px solid rgba(0,180,208,.35);
  white-space: nowrap;
  box-shadow: var(--tec-sh-md);
  cursor: pointer;
  animation: tec-tooltip-in .35s ease;
}
@keyframes tec-tooltip-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── FAB ── */
#tec-fab {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3px solid var(--tec-teal);
  background: linear-gradient(135deg, var(--tec-navy) 0%, var(--tec-blue) 100%);
  box-shadow: var(--tec-sh-md), 0 0 0 0 rgba(0,180,208,.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
  animation: tec-fab-pulse 3s infinite;
  padding: 0;
}
@keyframes tec-fab-pulse {
  0%,100% { box-shadow: var(--tec-sh-md), 0 0 0 0 rgba(0,180,208,.35); }
  60%      { box-shadow: var(--tec-sh-md), 0 0 0 14px rgba(0,180,208,0); }
}
#tec-fab:hover { transform: scale(1.1); animation: none; }
#tec-fab img   { height: 34px; width: auto; display: block; }
#tec-fab-fb    { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; color: var(--tec-teal); display: none; }
.tec-fab-close { display: none; font-size: 26px; color: #fff; }

/* Notification badge */
#tec-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #E8533A;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  transition: transform .2s, opacity .2s;
}
#tec-badge.tec-badge-hide { transform: scale(0); opacity: 0; }

/* ── Chat Window ── */
#tec-chat-window {
  width: 380px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--tec-surface);
  box-shadow: var(--tec-sh-lg);
  border: 1.5px solid var(--tec-border);
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
}
#tec-chat-window.tec-hidden {
  transform: scale(.7) translateY(24px);
  opacity: 0;
  pointer-events: none;
}
#tec-chat-window.tec-visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
#tec-chat-window.tec-minimised .tec-messages,
#tec-chat-window.tec-minimised .tec-chips,
#tec-chat-window.tec-minimised .tec-input-row {
  display: none;
}

/* ── Header ── */
.tec-chat-header {
  background: linear-gradient(135deg, var(--tec-navy) 0%, var(--tec-blue) 70%, #1E4E8C 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--tec-teal);
  flex-shrink: 0;
  cursor: pointer;
}
.tec-chat-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 90% 20%, rgba(0,180,208,.18) 0%, transparent 60%);
  pointer-events: none;
}
.tec-chat-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.tec-chat-avatar img { height: 28px; width: auto; display: block; }
#tec-avatar-fb {
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--tec-teal);
  display: none;
}
.tec-chat-info  { flex: 1; position: relative; }
.tec-chat-name  { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.tec-chat-org   { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 1px; }
.tec-chat-status{ font-size: 11px; color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.tec-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5DCAA5;
  flex-shrink: 0;
  animation: tec-pulse-dot 2.5s infinite;
}
@keyframes tec-pulse-dot {
  0%,100% { box-shadow: 0 0 0 2px rgba(93,202,165,.3); }
  50%      { box-shadow: 0 0 0 5px rgba(93,202,165,.08); }
}
.tec-ctrl-group { display: flex; gap: 5px; position: relative; }
.tec-ctrl {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
  padding: 0;
}
.tec-ctrl:hover { background: rgba(255,255,255,.24); }
.tec-ctrl i { font-size: 15px; color: rgba(255,255,255,.8); }

/* ── Messages ── */
.tec-messages {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--tec-bg);
  scroll-behavior: smooth;
  flex: 1;
}
.tec-messages::-webkit-scrollbar { width: 4px; }
.tec-messages::-webkit-scrollbar-thumb { background: var(--tec-border); border-radius: 99px; }

.tec-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 90%;
  animation: tec-msg-in .2s ease;
}
@keyframes tec-msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tec-msg.tec-bot  { align-self: flex-start; }
.tec-msg.tec-user { align-self: flex-end; }

.tec-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tec-t1);
}
.tec-msg.tec-bot .tec-bubble {
  background: var(--tec-surface);
  border: 1.5px solid var(--tec-border);
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(11,29,58,.07);
}
.tec-msg.tec-user .tec-bubble {
  background: linear-gradient(135deg, var(--tec-purp-mid), var(--tec-purple));
  color: #fff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 3px 10px rgba(83,74,183,.32);
}
.tec-time { font-size: 10px; color: var(--tec-t3); padding: 0 3px; }
.tec-msg.tec-user .tec-time { text-align: right; }

/* Typing dots */
.tec-typing { display: flex; align-items: center; gap: 4px; padding: 10px 13px; }
.tec-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tec-border);
  animation: tec-bounce .9s infinite;
}
.tec-typing span:nth-child(2) { animation-delay: .2s; }
.tec-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes tec-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* Product card */
.tec-product-card {
  margin-top: 8px;
  border: 1.5px solid var(--tec-border);
  border-radius: 10px;
  overflow: hidden;
}
.tec-pc-head {
  padding: 7px 11px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.tec-pc-body {
  padding: 8px 11px;
  font-size: 12px;
  color: var(--tec-t2);
  line-height: 1.5;
  background: var(--tec-surface);
}
.tec-pc-feat {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}
.tec-pc-dot { font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* Contact card */
.tec-contact-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 11px;
  border-top: 1px solid var(--tec-border-s);
  font-size: 12px; color: var(--tec-t1);
  line-height: 1.45;
  background: var(--tec-surface);
}
.tec-contact-row:first-child { border-top: none; }
.tec-contact-row i { font-size: 13px; color: var(--tec-purp-mid); flex-shrink: 0; margin-top: 1px; }

/* Product grid */
.tec-list-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.tec-list-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px;
  border: 1.5px solid var(--tec-border);
  border-radius: 10px;
  background: var(--tec-surface);
}
.tec-list-item i { font-size: 14px; color: var(--tec-purp-mid); flex-shrink: 0; }
.tec-li-name { font-size: 12px; font-weight: 600; color: var(--tec-t1); line-height: 1.2; }
.tec-li-desc { font-size: 10px; color: var(--tec-t3); margin-top: 1px; }

/* ── Chips ── */
.tec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px;
  border-top: 1px solid var(--tec-border-s);
  background: var(--tec-surface);
}
.tec-chip {
  font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  border: 1.5px solid var(--tec-border);
  border-radius: 99px;
  cursor: pointer;
  color: var(--tec-t2);
  background: var(--tec-surface);
  font-family: 'Inter', sans-serif;
  transition: all .15s;
  white-space: nowrap;
}
.tec-chip:hover {
  background: var(--tec-purp-lt);
  border-color: var(--tec-purp-mid);
  color: var(--tec-purple);
}

/* ── Input row ── */
.tec-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1.5px solid var(--tec-border);
  background: var(--tec-surface);
  flex-shrink: 0;
}
#tec-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--tec-border);
  border-radius: 99px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--tec-bg);
  color: var(--tec-t1);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#tec-input::placeholder { color: var(--tec-t3); }
#tec-input:focus {
  border-color: var(--tec-purp-mid);
  box-shadow: 0 0 0 3px rgba(83,74,183,.1);
  background: var(--tec-surface);
}
#tec-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tec-purp-mid), var(--tec-purple));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(83,74,183,.35);
  transition: transform .15s;
  padding: 0;
}
#tec-send:hover { transform: scale(1.08); }
#tec-send i { font-size: 18px; color: #fff; }

/* ── Mobile ── */
@media (max-width: 480px) {
  #tec-popup-root { bottom: 16px; right: 16px; }
  #tec-chat-window { width: calc(100vw - 32px); }
}
