/* ── Trust Media Chat Widget ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --tmc-accent: #7c3aed;
  --tmc-accent2: #2563eb;
  --tmc-dark: #0a0a0f;
  --tmc-dark2: #161625;
  --tmc-dark3: #0f0f1a;
  --tmc-border: rgba(139,92,246,0.22);
  --tmc-text: #e2e8f0;
  --tmc-muted: rgba(148,163,184,0.55);
  --tmc-radius: 16px;
}

/* ── Floating Button ── */
#tmc-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--tmc-accent), var(--tmc-accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 8px 28px rgba(124,58,237,0.55);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  outline: none;
}
#tmc-fab:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(124,58,237,0.65); }
#tmc-fab svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#tmc-badge {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: #ef4444;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  border: 2px solid #fff;
  transition: opacity 0.2s;
}

/* ── Chat Window ── */
#tmc-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 440px;
  height: 680px;
  border-radius: var(--tmc-radius);
  background: var(--tmc-dark);
  border: 1px solid var(--tmc-border);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1), opacity 0.22s ease;
  font-family: 'DM Sans', sans-serif;
}
#tmc-window.tmc-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
#tmc-header {
  background: linear-gradient(135deg, #1a0533 0%, #0d1a3a 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--tmc-border);
  flex-shrink: 0;
}
#tmc-header-avatar {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--tmc-accent), var(--tmc-accent2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}
#tmc-header-info { flex: 1; }
#tmc-header-name {
  font-family: 'Syne', sans-serif;
  font-weight: 600; font-size: 14px; color: #f8fafc; margin: 0 0 2px;
}
#tmc-header-status {
  font-size: 11px; color: rgba(200,200,220,0.65);
  display: flex; align-items: center; gap: 6px;
}
.tmc-online-dot {
  width: 7px; height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: tmcPulse 2s infinite;
}
@keyframes tmcPulse { 0%,100%{opacity:1} 50%{opacity:0.45} }

.tmc-lang-pill {
  background: rgba(139,92,246,0.18);
  border: 1px solid rgba(139,92,246,0.3);
  color: #c4b5fd; font-size: 10px;
  padding: 2px 7px; border-radius: 20px;
}
#tmc-close-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(196,181,253,0.6); font-size: 20px; line-height: 1;
  padding: 4px; border-radius: 6px; transition: color 0.15s;
}
#tmc-close-btn:hover { color: #fff; }

/* ── Messages ── */
#tmc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--tmc-dark);
  scrollbar-width: thin;
  scrollbar-color: #1e1e2e transparent;
}
#tmc-messages::-webkit-scrollbar { width: 4px; }
#tmc-messages::-webkit-scrollbar-track { background: transparent; }
#tmc-messages::-webkit-scrollbar-thumb { background: #1e1e2e; border-radius: 4px; }

.tmc-msg-row { display: flex; gap: 8px; align-items: flex-end; }
.tmc-msg-row.tmc-user { flex-direction: row-reverse; }

.tmc-msg-av {
  width: 30px; height: 30px; border-radius: 9px;
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600;
}
.tmc-bot-av  { background: linear-gradient(135deg, var(--tmc-accent), var(--tmc-accent2)); color: #fff; }
.tmc-user-av { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }

.tmc-bubble {
  max-width: 80%; padding: 11px 14px;
  border-radius: 14px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.tmc-bot-bubble {
  background: var(--tmc-dark2); color: var(--tmc-text);
  border: 1px solid var(--tmc-border);
  border-bottom-left-radius: 4px;
}
.tmc-user-bubble {
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  color: #fff; border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(109,40,217,0.35);
}
.tmc-time { font-size: 10px; color: var(--tmc-muted); margin-top: 4px; }
.tmc-msg-row.tmc-user .tmc-time { text-align: right; }

/* Typing dots */
.tmc-typing { display: flex; gap: 4px; padding: 6px 2px; align-items: center; }
.tmc-dot {
  width: 6px; height: 6px;
  background: var(--tmc-accent); border-radius: 50%;
  animation: tmcBounce 1.2s ease-in-out infinite;
}
.tmc-dot:nth-child(2) { animation-delay: 0.18s; }
.tmc-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes tmcBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-7px)} }

/* ── Quick Replies ── */
#tmc-quick {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 0 14px 12px;
  flex-shrink: 0;
}
.tmc-qr {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.28);
  color: #c4b5fd; font-size: 12px; font-family: 'DM Sans', sans-serif;
  padding: 6px 13px; border-radius: 20px;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.tmc-qr:hover { background: rgba(139,92,246,0.25); border-color: var(--tmc-accent); color: #fff; }

/* ── Lead Form ── */
.tmc-lead-form {
  background: #12122a;
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  max-width: 85%;
}
.tmc-lead-title {
  font-family: 'Syne', sans-serif; font-weight: 600;
  font-size: 13px; color: #c4b5fd;
}
.tmc-lead-input {
  background: #0a0a1a; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 8px 11px;
  color: var(--tmc-text); font-size: 13px; font-family: 'DM Sans', sans-serif;
  outline: none; width: 100%; box-sizing: border-box; transition: border-color 0.18s;
}
.tmc-lead-input:focus { border-color: rgba(139,92,246,0.5); }
.tmc-lead-input::placeholder { color: rgba(148,163,184,0.35); }
.tmc-lead-submit {
  background: linear-gradient(135deg, var(--tmc-accent), var(--tmc-accent2));
  border: none; border-radius: 7px; padding: 10px;
  color: #fff; font-family: 'Syne', sans-serif; font-weight: 600;
  font-size: 13px; cursor: pointer; transition: opacity 0.18s;
}
.tmc-lead-submit:hover { opacity: 0.88; }

/* ── Input Bar ── */
#tmc-input-bar {
  background: var(--tmc-dark3);
  border-top: 1px solid rgba(139,92,246,0.13);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
#tmc-input {
  flex: 1; background: var(--tmc-dark2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px; padding: 10px 13px;
  color: var(--tmc-text); font-size: 13.5px; font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color 0.18s;
}
#tmc-input::placeholder { color: rgba(148,163,184,0.38); }
#tmc-input:focus { border-color: rgba(139,92,246,0.48); }
#tmc-send {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--tmc-accent), var(--tmc-accent2));
  border: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}
#tmc-send:hover { transform: scale(1.06); }
#tmc-send svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#tmc-powered {
  text-align: center; font-size: 10px;
  color: rgba(148,163,184,0.25);
  padding: 5px 0 9px;
  font-family: 'DM Sans', sans-serif;
}

/* ── Responsive ── */
@media (min-width: 1280px) {
  #tmc-window { width: 480px; height: 720px; }
}
@media (max-width: 440px) {
  #tmc-window { width: calc(100vw - 20px); right: 10px; bottom: 88px; height: 75vh; }
  #tmc-fab    { right: 18px; bottom: 18px; }
}
