/* ══════════════════════════════════════════════════════
   chat-widget.css — Floating support chat
   ══════════════════════════════════════════════════════ */

/* ── Floating button ─────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(230,57,70,.45);
  z-index: 1000;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(230,57,70,.55);
}
.chat-fab .chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.chat-badge.visible { display: flex; }

/* ── Chat panel ──────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 340px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  transform: translateY(16px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}
.chat-panel-header .chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-panel-header .chat-info h4 { font-size: .875rem; font-weight: 600; }
.chat-panel-header .chat-info p  { font-size: .72rem; opacity: .85; }
.chat-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  line-height: 1;
  transition: color .15s;
}
.chat-close-btn:hover { color: #fff; }

/* ── Messages area ───────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.chat-msg.user  { align-self: flex-end; align-items: flex-end; }
.chat-msg.op    { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: .84rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.op .chat-bubble {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 2px;
}

.chat-typing {
  font-size: .78rem;
  color: var(--text-muted);
  padding: 4px 2px;
  display: none;
}
.chat-typing.visible { display: block; }

/* ── Input area ──────────────────────────────────────── */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: .84rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  resize: none;
  transition: border-color .2s;
}
.chat-input:focus { border-color: rgba(230,57,70,.4); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  align-self: flex-end;
}
.chat-send-btn:hover { background: var(--accent-dark); }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 88px; }
  .chat-fab   { right: 16px; bottom: 20px; }
}
