/* ══ JUST CLEANING — Chat Bubble (Dark/Teal Theme) ══ */

.jc-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #00e5c3;
  box-shadow: 0 8px 32px rgba(0, 229, 195, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  border: none;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
  animation: jc-float 3s ease-in-out infinite;
}
@keyframes jc-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.jc-chat-bubble:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 40px rgba(0, 229, 195, 0.55);
  animation-play-state: paused;
}
.jc-chat-bubble svg {
  width: 26px;
  height: 26px;
  color: #07080e;
  stroke-width: 2.2;
}
.jc-chat-bubble.open svg.icon-chat { display: none; }
.jc-chat-bubble:not(.open) svg.icon-close { display: none; }

.jc-chat-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 229, 195, 0.5);
  animation: jc-chat-pulse 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes jc-chat-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}

.jc-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: #0d0f1e;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 4px 16px rgba(0, 229, 195, 0.08);
  border: 1px solid rgba(0, 229, 195, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: 'DM Sans', sans-serif;
}
.jc-chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.jc-chat-header {
  background: linear-gradient(135deg, #0e1122 0%, #131728 100%);
  padding: 16px 18px;
  color: #f3f5f8;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 229, 195, 0.15);
}
.jc-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5c3 0%, #00b89a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #07080e;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 229, 195, 0.3);
}
.jc-chat-header-info { flex: 1; min-width: 0; }
.jc-chat-header-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: #f3f5f8;
}
.jc-chat-header-status {
  font-size: 11px;
  color: #8692a6;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}
.jc-chat-header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00e5c3;
  box-shadow: 0 0 8px #00e5c3;
}
.jc-chat-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  color: #8692a6;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.jc-chat-close:hover {
  background: rgba(0, 229, 195, 0.1);
  color: #00e5c3;
  border-color: rgba(0, 229, 195, 0.3);
}

.jc-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #07080e;
}
.jc-chat-body::-webkit-scrollbar { width: 6px; }
.jc-chat-body::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 195, 0.2);
  border-radius: 3px;
}
.jc-chat-body::-webkit-scrollbar-track { background: transparent; }

.jc-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: jc-msg-in 0.22s ease-out;
  font-family: 'DM Sans', sans-serif;
}
@keyframes jc-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.jc-msg.user {
  align-self: flex-end;
  background: #00e5c3;
  color: #07080e;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.jc-msg.assistant {
  align-self: flex-start;
  background: #0e1122;
  color: #f3f5f8;
  border: 1px solid rgba(255,255,255,0.07);
  border-bottom-left-radius: 4px;
}

.jc-msg-typing {
  align-self: flex-start;
  background: #0e1122;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 13px 16px;
  display: flex;
  gap: 5px;
}
.jc-msg-typing span {
  width: 7px;
  height: 7px;
  background: #00e5c3;
  border-radius: 50%;
  animation: jc-typing-bounce 1.1s ease-in-out infinite;
  opacity: 0.4;
}
.jc-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.jc-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes jc-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.jc-chat-input-row {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 12px;
  background: #0d0f1e;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.jc-chat-input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 22px;
  padding: 11px 16px;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  max-height: 100px;
  line-height: 1.4;
  background: #07080e;
  color: #f3f5f8;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.jc-chat-input::placeholder { color: #454e64; }
.jc-chat-input:focus {
  border-color: rgba(0, 229, 195, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 229, 195, 0.1);
}
.jc-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #00e5c3;
  border: none;
  color: #07080e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.jc-chat-send:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 229, 195, 0.5);
}
.jc-chat-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.jc-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #07080e;
}

.jc-chat-footer {
  text-align: center;
  font-size: 10px;
  color: #454e64;
  padding: 6px 0 10px;
  background: #0d0f1e;
  flex-shrink: 0;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 500;
}
.jc-chat-footer strong { color: #00e5c3; font-weight: 600; }

/* Mobile: near full-screen panel */
@media (max-width: 480px) {
  .jc-chat-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .jc-chat-bubble {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }
  .jc-chat-bubble svg {
    width: 24px;
    height: 24px;
  }
}