/* JComputer IA - Widget estilos v6 (tema dark premium, identidade JComputer) */
.jcia-btn {
  position: fixed;
  bottom: 96px;
  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), 0 0 22px rgba(56, 189, 248, 0.25);
}
.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: 178px;
  right: 22px;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 545px;
  max-height: calc(100vh - 130px);
  background: linear-gradient(165deg, #060d1c 0%, #081430 60%, #0a1e3d 100%);
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(14, 116, 200, 0.18), inset 0 1px 0 rgba(125, 211, 252, 0.15);
  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: 14px 15px;
  background: linear-gradient(120deg, #050b18 0%, #0a1e3d 55%, #0d3a6e 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
  position: relative;
}
.jcia-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 30%, #2563eb 70%, transparent);
  opacity: 0.85;
}
.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), 0 0 14px rgba(56, 189, 248, 0.35);
}
.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; letter-spacing: 0.01em; }
.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(56, 189, 248, 0.15); }

.jcia-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(14, 116, 200, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}
.jcia-msgs::-webkit-scrollbar { width: 6px; }
.jcia-msgs::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.35); border-radius: 999px; }
.jcia-row { display: flex; gap: 7px; align-items: flex-end; animation: jciaIn 0.25s ease; }
.jcia-row-user { justify-content: flex-end; }
@keyframes jciaIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.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: 10px 13px 5px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 10px rgba(2, 8, 20, 0.35);
}
.jcia-bot {
  background: linear-gradient(160deg, rgba(15, 40, 80, 0.85) 0%, rgba(10, 30, 61, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-bottom-left-radius: 4px;
}
.jcia-user {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-bottom-right-radius: 4px;
  color: #fff;
  box-shadow: 0 3px 14px rgba(14, 116, 200, 0.4);
}
.jcia-msg-text { margin-bottom: 2px; }
.jcia-play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.jcia-play:hover { background: rgba(56, 189, 248, 0.26); }
.jcia-playing { background: rgba(56, 189, 248, 0.32); color: #e0f2fe; }
.jcia-msg-time { display: block; text-align: right; font-size: 10px; opacity: 0.55; }

.jcia-typing { display: flex; align-items: flex-end; gap: 7px; animation: jciaIn 0.25s ease; }
.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: linear-gradient(160deg, rgba(15, 40, 80, 0.85) 0%, rgba(10, 30, 61, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px; border-bottom-left-radius: 4px;
}
.jcia-typing-bubbles span {
  width: 7px; height: 7px; border-radius: 50%; background: #38bdf8; 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: transparent;
  flex-shrink: 0;
}
.jcia-chips.jcia-hidden { display: none; }
.jcia-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(14, 116, 200, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(2, 8, 20, 0.3);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.jcia-chip:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14, 116, 200, 0.45);
}
.jcia-chip i { font-style: normal; font-size: 13px; }

.jcia-foot {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(5, 11, 24, 0.75);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}
.jcia-input {
  flex: 1;
  background: rgba(8, 20, 48, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  color: #e2e8f0;
  padding: 10px 15px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.jcia-input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
.jcia-input::placeholder { color: #64748b; }
.jcia-mic {
  width: 42px; height: 42px;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 50%;
  background: rgba(8, 20, 48, 0.9);
  color: #7dd3fc; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.jcia-mic:hover { background: rgba(56, 189, 248, 0.15); }
.jcia-mic.jcia-rec {
  background: rgba(220, 38, 38, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  animation: jciaRec 1.1s infinite;
}
@keyframes jciaRec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}
.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;
  box-shadow: 0 3px 12px rgba(14, 116, 200, 0.45);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.jcia-send:hover { filter: brightness(1.12); transform: scale(1.05); }
.jcia-send:disabled { opacity: 0.5; cursor: default; }

.jcia-teaser {
  position: fixed;
  bottom: 178px;
  right: 22px;
  max-width: 290px;
  background: linear-gradient(165deg, #0a1e3d 0%, #060d1c 100%);
  border-radius: 14px 14px 4px 14px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(2, 8, 20, 0.5), 0 0 24px rgba(14, 116, 200, 0.2);
  padding: 12px 16px 12px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  z-index: 2147482999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.jcia-teaser.jcia-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.jcia-teaser-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55);
}
.jcia-teaser-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcia-teaser-text { font-size: 12.8px; color: #dbeafe; line-height: 1.45; }
.jcia-teaser-text strong { color: #38bdf8; font-size: 13px; }
.jcia-teaser-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: none;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.jcia-teaser-close:hover { color: #e2e8f0; }

@media (max-width: 480px) {
  .jcia-panel { bottom: 166px; right: 10px; width: calc(100vw - 20px); height: calc(100vh - 200px); }
  .jcia-btn { bottom: 86px; right: 14px; }
  .jcia-teaser { bottom: 166px; right: 10px; max-width: calc(100vw - 80px); }
}
