/* ===== META-BYTE CHAT WIDGET ===== */

/* Floating trigger button */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: linear-gradient(135deg, #0e7490, #7c3aed);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 2rem;
  color: #e2e8f0;
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.25), 0 0 0 1px rgba(124, 58, 237, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(6, 182, 212, 0.4), 0 0 0 1px rgba(124, 58, 237, 0.35);
}
.chat-fab-icon {
  font-size: 1rem;
  line-height: 1;
}
.chat-fab-label {
  white-space: nowrap;
}

/* Chat panel */
.chat-panel {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  z-index: 9000;
  width: 340px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 0.75rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(124, 58, 237, 0.15);
  overflow: hidden;
  transform-origin: bottom right;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.chat-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateY(8px);
}

/* Panel header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.5), rgba(124, 58, 237, 0.35));
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  flex-shrink: 0;
}
.chat-header-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #06b6d4;
  font-family: 'Segoe UI', sans-serif;
}
.chat-header-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  flex-shrink: 0;
}
.chat-header-sub {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.chat-close-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  transition: color 0.15s;
  line-height: 1;
}
.chat-close-btn:hover {
  color: #94a3b8;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.2) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(6, 182, 212, 0.2); border-radius: 2px; }

/* Message bubbles */
.chat-msg {
  max-width: 88%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
  font-family: 'Segoe UI', sans-serif;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg-bot {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #cbd5e1;
  border-bottom-left-radius: 0.15rem;
}
.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.6), rgba(124, 58, 237, 0.4));
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #e2e8f0;
  border-bottom-right-radius: 0.15rem;
}

/* Typing indicator */
.chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 0.6rem;
  border-bottom-left-radius: 0.15rem;
}
.chat-typing span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #06b6d4;
  animation: chat-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Contact suggestion */
.chat-contact-hint {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.chat-contact-btn {
  background: none;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 0.35rem;
  color: #a855f7;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: 'Segoe UI', sans-serif;
}
.chat-contact-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.7);
}

/* Input area */
.chat-input-area {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  border-top: 1px solid rgba(6, 182, 212, 0.15);
  background: rgba(2, 8, 23, 0.6);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 0.4rem;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-family: 'Segoe UI', sans-serif;
  padding: 0.45rem 0.65rem;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}
.chat-input::placeholder { color: #475569; }
.chat-input:focus { border-color: rgba(6, 182, 212, 0.5); }

.chat-send-btn {
  background: linear-gradient(135deg, #0e7490, #7c3aed);
  border: none;
  border-radius: 0.4rem;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send-btn:hover:not(:disabled) { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: default; }

/* Disclaimer footer */
.chat-disclaimer {
  text-align: center;
  font-size: 0.6rem;
  color: #334155;
  padding: 0.3rem 0.5rem;
  border-top: 1px solid rgba(6, 182, 212, 0.08);
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: 0.04em;
}

/* Responsive: shrink on small screens */
@media (max-width: 400px) {
  .chat-panel { width: calc(100vw - 2rem); right: 1rem; }
  .chat-fab   { right: 1rem; bottom: 1rem; }
}
