/* ════════════════════════════════════════
   chat.css — کارت مدل‌ها، چت، input
   ════════════════════════════════════════ */

/* ─── گرید مدل‌ها ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
}
.model-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}
/* مدل قفل‌شده (Pro) */
.model-card.locked {
  opacity: 0.6;
}
.model-card.locked:hover {
  opacity: 0.8;
  border-color: rgba(255,255,255,0.15);
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}

/* آیکون هر provider */
.ic-claude   { background: rgba(217,119,81,0.12); color: var(--claude);   }
.ic-openai   { background: rgba(16,163,127,0.12); color: var(--openai);   }
.ic-gemini   { background: rgba(66,133,244,0.12); color: var(--gemini);   }
.ic-deepseek { background: rgba(74,158,255,0.12); color: var(--deepseek); }
.ic-grok     { background: rgba(170,170,170,0.08); color: var(--grok);    }

.pro-tag {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px;
  letter-spacing: 0.5px; white-space: nowrap;
}

.card-name   { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.card-desc   { font-size: 11px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.card-select {
  font-size: 11px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px; transition: color 0.15s;
}
.model-card:hover .card-select { color: var(--text-primary); }
.card-select i  { font-size: 13px; }
.provider-dot   { width: 6px; height: 6px; border-radius: 50%; }

/* ─── سرچ ─── */
.search-wrap  { position: relative; margin-bottom: 20px; }
.search-icon  { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
.search-input {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 38px 9px 14px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  outline: none; direction: rtl; transition: border-color 0.15s;
}
.search-input:focus       { border-color: var(--border-hover); }
.search-input::placeholder { color: var(--text-muted); }

/* ─── صفحه چت ─── */
.chat-area         { flex: 1; display: none; flex-direction: column; overflow: hidden; }
.chat-area.active  { display: flex; }
.content.hidden    { display: none; }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: thin; scrollbar-color: var(--bg-hover) transparent;
}

.msg { display: flex; gap: 12px; align-items: flex-start; animation: fadeUp 0.25s ease; }
.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.msg-avatar.ai      { background: var(--accent-dim); border: 1px solid var(--border); color: var(--text-secondary); }
.msg-avatar.user-av { background: var(--text-primary); color: #000; }

.msg-bubble {
  max-width: 72%; padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.msg.ai   .msg-bubble { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); border-top-right-radius: 3px; }
.msg.user .msg-bubble { background: var(--accent-dim); border: 1px solid var(--border-hover); color: var(--text-primary); border-top-left-radius: 3px; }

/* تایپ‌اینگ ─── */
.typing       { display: flex; gap: 5px; align-items: center; padding: 4px 0; }
.typing span  {
  width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* ─── نوار input ─── */
.input-bar  { padding: 14px 24px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.input-wrap {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 13px; padding: 10px 12px;
  transition: border-color 0.15s;
}
.input-wrap:focus-within { border-color: var(--border-hover); }

.chat-input {
  flex: 1; background: transparent; border: none;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  resize: none; outline: none; line-height: 1.6;
  max-height: 140px; min-height: 22px;
  direction: rtl; scrollbar-width: none;
}
.chat-input::placeholder { color: var(--text-muted); }

.input-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.send-btn {
  width: 34px; height: 34px;
  background: var(--text-primary); border: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #000; font-size: 16px;
  transition: opacity 0.15s; flex-shrink: 0;
}
.send-btn:hover    { opacity: 0.8; }
.send-btn:disabled { opacity: 0.25; cursor: default; }

.input-hint { text-align: center; font-size: 10px; color: var(--text-muted); margin-top: 8px; }