/* =========================================================
   Fallahi Exchange — Support chat widget
   ========================================================= */

.chat-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 9999;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--gold-grad);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s;
}
.chat-fab:hover { transform: translateY(-3px); }
.chat-fab svg { width: 26px; height: 26px; }

.chat-panel {
  position: fixed;
  right: 22px; bottom: 94px;
  z-index: 9999;
  width: 340px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.chat-header {
  background: var(--gold-grad);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.chat-title { font-weight: 700; font-size: 1rem; }
.chat-close {
  background: none; border: none;
  color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; padding: 0 2px;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--cream);
}

.chat-identify { display: flex; flex-direction: column; gap: 10px; }
.chat-identify input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}
.chat-identify input:focus { border-color: var(--gold); }
.chat-submit {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--gold-grad);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.chat-captcha-row { display: flex; align-items: center; gap: 8px; }
.chat-captcha-row img {
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  cursor: pointer;
  background: #ffffff;
}
.chat-captcha-row input { flex: 1; min-width: 0; text-align: center; letter-spacing: 0.15em; text-transform: uppercase; }

.chat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.visitor {
  align-self: flex-end;
  background: var(--gold-grad);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-msg.support {
  align-self: flex-start;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--gold-light);
  border-bottom-left-radius: 3px;
}

.chat-input-row {
  display: flex; gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--gold-light);
  background: #ffffff;
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1; min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--gold); }
.chat-send {
  width: 44px; flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--gold-grad);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-send svg { width: 18px; height: 18px; }
