/* JComputer IA - Widget estilos (identidade JComputer) */
.jcia-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2147483000;
  padding: 0;
  transition: transform 0.2s ease;
}
.jcia-btn:hover { transform: scale(1.07); }
.jcia-btn.jcia-active { transform: scale(0.92); }

.jcia-btn-avatar {
  display: block;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(2, 8, 20, 0.55), 0 0 0 3px rgba(56, 189, 248, 0.55);
}
.jcia-btn-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.jcia-btn-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jcia-btn-badge svg { width: 14px; height: 14px; }

.jcia-panel {
  position: fixed;
  bottom: 102px;
  right: 22px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: #f5f8fc;
  border-radius: 18px;
  border: 1px solid rgba(14, 74, 158, 0.25);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483001;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.jcia-panel.jcia-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.jcia-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  background: linear-gradient(120deg, #050b18 0%, #0a1e3d 55%, #0d3a6e 100%);
  border-bottom: 2px solid #38bdf8;
  flex-shrink: 0;
}
.jcia-header-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.7);
}
.jcia-header-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcia-header-info { flex: 1; min-width: 0; }
.jcia-header-info strong { display: block; color: #f1f5f9; font-size: 14.5px; font-weight: 700; }
.jcia-header-info strong em { font-style: normal; color: #38bdf8; }
.jcia-status { display: flex; align-items: center; gap: 5px; color: #a5f3fc; font-size: 11.5px; }
.jcia-status i {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: jciaPulse 2s infinite;
}
@keyframes jciaPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.jcia-close {
  background: none; border: none; color: #cbd5e1;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px;
}
.jcia-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.jcia-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f8fc;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 116, 200, 0.35) transparent;
}
.jcia-row { display: flex; gap: 7px; align-items: flex-end; }
.jcia-row-user { justify-content: flex-end; }
.jcia-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.5);
}
.jcia-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.jcia-msg {
  max-width: 78%;
  padding: 9px 12px 5px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 40, 80, 0.08);
}
.jcia-bot { background: #ffffff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.jcia-user {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-bottom-right-radius: 4px;
  color: #fff;
}
.jcia-msg-text { margin-bottom: 2px; }
.jcia-msg-time { display: block; text-align: right; font-size: 10px; opacity: 0.55; }

.jcia-typing { display: flex; align-items: flex-end; gap: 7px; }
.jcia-typing.jcia-hidden { display: none; }
.jcia-typing-avatar {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.5);
}
.jcia-typing-avatar img { width: 100%; height: 100%; object-fit: cover; }
.jcia-typing-bubbles {
  display: flex; gap: 4px; padding: 12px 14px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; border-bottom-left-radius: 4px;
}
.jcia-typing-bubbles span {
  width: 7px; height: 7px; border-radius: 50%; background: #0ea5e9; opacity: 0.4;
  animation: jciaBlink 1.2s infinite;
}
.jcia-typing-bubbles span:nth-child(2) { animation-delay: 0.2s; }
.jcia-typing-bubbles span:nth-child(3) { animation-delay: 0.4s; }
@keyframes jciaBlink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.jcia-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 4px 12px 10px;
  background: #f5f8fc;
  flex-shrink: 0;
}
.jcia-chips.jcia-hidden { display: none; }
.jcia-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; border: none;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 116, 200, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
  font-family: inherit;
}
.jcia-chip:hover { transform: translateY(-1px); filter: brightness(1.1); }
.jcia-chip i { font-style: normal; font-size: 13px; }

.jcia-foot {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.jcia-input {
  flex: 1;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  color: #1e293b;
  padding: 10px 15px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
.jcia-input:focus { border-color: #0ea5e9; background: #fff; }
.jcia-input::placeholder { color: #94a3b8; }
.jcia-send {
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: filter 0.15s ease;
}
.jcia-send:hover { filter: brightness(1.12); }
.jcia-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
  .jcia-panel { bottom: 84px; right: 10px; width: calc(100vw - 20px); height: calc(100vh - 110px); }
  .jcia-btn { bottom: 14px; right: 14px; }
}
