/* ══════════════════════════════════════════
   MozProTech AI — CORE AI Chatbot
   chatbot.css — Estilos isolados
══════════════════════════════════════════ */

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

:root {
  --moz-cyan: #00ffe0;
  --moz-cyan-dim: rgba(0, 255, 224, 0.12);
  --moz-cyan-glow: rgba(0, 255, 224, 0.35);
  --moz-dark: #080d12;
  --moz-surface: #0e1520;
  --moz-surface2: #141e2d;
  --moz-border: rgba(0, 255, 224, 0.12);
  --moz-border-bright: rgba(0, 255, 224, 0.35);
  --moz-text: #e8f4f1;
  --moz-muted: rgba(232, 244, 241, 0.5);
  --moz-font-display: 'Syne', sans-serif;
  --moz-font-body: 'DM Sans', sans-serif;
}

/* ─── Launcher Button ─── */
#moz-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--moz-dark);
  border: 1.5px solid var(--moz-border-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 var(--moz-cyan-glow);
  animation: mozLauncherPulse 3s ease-in-out infinite;
  transition: transform 0.2s, border-color 0.2s;
  overflow: visible;
}

#moz-launcher::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 224, 0.15);
  animation: mozRingExpand 3s ease-in-out infinite;
  pointer-events: none;
}

#moz-launcher:hover {
  transform: scale(1.07);
  border-color: var(--moz-cyan);
}

#moz-launcher img.moz-ico-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

#moz-launcher .moz-ico-close {
  display: none;
  width: 20px;
  height: 20px;
}

#moz-launcher.moz-open img.moz-ico-logo {
  display: none;
}

#moz-launcher.moz-open .moz-ico-close {
  display: block;
}

/* ─── Widget Container ─── */
#moz-widget {
  position: fixed;
  bottom: 104px;
  right: 28px;
  z-index: 9998;
  width: 380px;
  height: 580px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--moz-dark);
  border: 1px solid var(--moz-border-bright);
  box-shadow:
    0 0 60px rgba(0, 255, 224, 0.07),
    0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

#moz-widget.moz-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Scanlines overlay */
#moz-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 224, 0.013) 2px,
    rgba(0, 255, 224, 0.013) 4px
  );
}

/* ─── Header ─── */
#moz-header {
  flex-shrink: 0;
  padding: 16px 18px 14px;
  background: var(--moz-surface);
  border-bottom: 1px solid var(--moz-border);
  position: relative;
  z-index: 2;
}

.moz-hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.moz-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.moz-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--moz-border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moz-surface2);
  box-shadow: 0 0 12px rgba(0, 255, 224, 0.15);
  overflow: hidden;
}

.moz-logo-wrap img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.moz-brand-text {
  display: flex;
  flex-direction: column;
}

.moz-brand-name {
  font-family: var(--moz-font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.moz-brand-sub {
  font-size: 10px;
  color: var(--moz-cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Online indicator */
.moz-online-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.moz-online-ring {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moz-online-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--moz-cyan);
  animation: mozRingPing 2s ease-in-out infinite;
}

.moz-online-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--moz-cyan);
  box-shadow: 0 0 6px var(--moz-cyan);
  animation: mozDotBlink 2s ease-in-out infinite;
}

.moz-online-text {
  font-size: 11px;
  color: var(--moz-cyan);
  font-weight: 500;
  letter-spacing: 0.5px;
  font-family: var(--moz-font-body);
}

/* Language bar */
.moz-lang-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.moz-lb {
  background: transparent;
  border: 1px solid rgba(0, 255, 224, 0.2);
  color: rgba(232, 244, 241, 0.5);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.8px;
  font-family: var(--moz-font-display);
}

.moz-lb:hover {
  border-color: var(--moz-cyan);
  color: var(--moz-cyan);
}

.moz-lb.moz-active {
  background: var(--moz-cyan-dim);
  border-color: var(--moz-cyan);
  color: var(--moz-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 224, 0.2);
}

.moz-lang-cur {
  font-size: 10px;
  color: var(--moz-muted);
  margin-left: auto;
  letter-spacing: 0.5px;
  font-family: var(--moz-font-body);
}

/* ─── Messages ─── */
#moz-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--moz-dark);
  position: relative;
  z-index: 2;
}

#moz-messages::-webkit-scrollbar { width: 3px; }
#moz-messages::-webkit-scrollbar-track { background: transparent; }
#moz-messages::-webkit-scrollbar-thumb { background: var(--moz-border-bright); border-radius: 2px; }

.moz-msg-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.moz-msg-wrap.moz-user {
  flex-direction: row-reverse;
}

.moz-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
}

.moz-av.moz-ai {
  background: var(--moz-surface2);
  border: 1px solid var(--moz-border-bright);
  box-shadow: 0 0 8px rgba(0, 255, 224, 0.15);
}

.moz-av.moz-ai img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.moz-av.moz-usr {
  background: var(--moz-cyan);
  color: var(--moz-dark);
  font-family: var(--moz-font-display);
}

.moz-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 16px;
  font-family: var(--moz-font-body);
}

.moz-ai-b {
  background: var(--moz-surface);
  border: 1px solid var(--moz-border);
  color: var(--moz-text);
  border-bottom-left-radius: 4px;
}

.moz-user-b {
  background: var(--moz-cyan);
  color: var(--moz-dark);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.moz-msg-time {
  font-size: 10px;
  color: var(--moz-muted);
  margin-top: 4px;
  font-family: var(--moz-font-body);
}

.moz-user .moz-msg-time {
  text-align: right;
}

.moz-error-text {
  color: #ff6b6b !important;
  font-size: 12px;
  font-style: italic;
}

/* Typing indicator */
.moz-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 14px;
}

.moz-td {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--moz-cyan);
  animation: mozTyping 1.4s ease-in-out infinite;
  box-shadow: 0 0 4px var(--moz-cyan);
}

.moz-td:nth-child(2) { animation-delay: 0.2s; }
.moz-td:nth-child(3) { animation-delay: 0.4s; }

/* ─── Quick Chips ─── */
#moz-chips {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  background: var(--moz-surface);
  border-top: 1px solid var(--moz-border);
  position: relative;
  z-index: 2;
}

#moz-chips::-webkit-scrollbar { height: 0; }

.moz-chip {
  white-space: nowrap;
  background: transparent;
  border: 1px solid rgba(0, 255, 224, 0.25);
  color: var(--moz-cyan);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: var(--moz-font-body);
}

.moz-chip:hover {
  background: var(--moz-cyan-dim);
  border-color: var(--moz-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 224, 0.2);
}

/* ─── Input Bar ─── */
#moz-input-bar {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 14px;
  background: var(--moz-surface);
  border-top: 1px solid var(--moz-border);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

#moz-input {
  flex: 1;
  border: 1px solid var(--moz-border);
  border-radius: 22px;
  padding: 9px 15px;
  font-size: 13px;
  font-family: var(--moz-font-body);
  background: var(--moz-dark);
  color: var(--moz-text);
  outline: none;
  resize: none;
  max-height: 72px;
  line-height: 1.45;
  transition: border-color 0.2s;
}

#moz-input::placeholder {
  color: var(--moz-muted);
}

#moz-input:focus {
  border-color: var(--moz-cyan);
  box-shadow: 0 0 0 3px rgba(0, 255, 224, 0.06);
}

#moz-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--moz-cyan);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 0 12px rgba(0, 255, 224, 0.3);
}

#moz-send-btn:hover {
  background: #00ccb4;
  box-shadow: 0 0 20px rgba(0, 255, 224, 0.5);
  transform: scale(1.06);
}

#moz-send-btn svg {
  width: 15px;
  height: 15px;
  fill: var(--moz-dark);
}

/* ─── Footer ─── */
#moz-footer {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: rgba(232, 244, 241, 0.2);
  letter-spacing: 0.3px;
  background: var(--moz-surface);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--moz-border);
  font-family: var(--moz-font-body);
}

/* ─── Animations ─── */
.moz-fade-up {
  animation: mozFadeUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mozFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes mozLauncherPulse {
  0%,100% { box-shadow: 0 0 0 0 var(--moz-cyan-glow), 0 8px 30px rgba(0,255,224,0.15); }
  50%     { box-shadow: 0 0 0 10px rgba(0,255,224,0), 0 8px 30px rgba(0,255,224,0.3); }
}

@keyframes mozRingExpand {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50%     { transform: scale(1.22); opacity: 0; }
}

@keyframes mozRingPing {
  0%,100% { transform: scale(1); opacity: 1; }
  60%     { transform: scale(1.75); opacity: 0; }
}

@keyframes mozDotBlink {
  0%,100% { opacity: 1; box-shadow: 0 0 6px var(--moz-cyan); }
  50%     { opacity: 0.55; box-shadow: 0 0 14px var(--moz-cyan); }
}

@keyframes mozTyping {
  0%,60%,100% { opacity: 0.25; transform: scale(1) translateY(0); }
  30%         { opacity: 1; transform: scale(1.2) translateY(-2px); }
}

/* ─── Responsive ─── */
@media (max-width: 440px) {
  #moz-widget  { width: calc(100vw - 20px); right: 10px; bottom: 88px; height: 520px; }
  #moz-launcher { right: 10px; bottom: 14px; }
}
