.welcome-core { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.core-ring {
  position: absolute; border-radius: 50%; border: 2px solid var(--brand);
  animation: spin 8s linear infinite;
}
.core-ring--outer { width: 120px; height: 120px; border-color: rgba(139,92,246,0.4); border-top-color: var(--brand); }
.core-ring--inner { width: 80px; height: 80px; border-color: rgba(34,211,238,0.3); border-top-color: var(--neon); animation-direction: reverse; animation-duration: 5s; }
.core-pulse {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand), transparent 70%);
  box-shadow: var(--shadow-glow);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 1; } }

.brand-title {
  font-family: var(--font-en); font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800; letter-spacing: 0.08em; margin: 0;
  background: linear-gradient(135deg, var(--brand), var(--neon));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-tagline {
  font-family: var(--font-en); font-size: 0.8rem; letter-spacing: 0.35em;
  color: var(--text-secondary); margin: 0; text-transform: uppercase;
}
.welcome-status { color: var(--text-secondary); font-size: 0.9rem; }
.suggested-prompts { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; max-width: 640px; }
.prompt-chip {
  padding: 0.6rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(139,92,246,0.08);
  color: var(--text-primary); font-size: 0.85rem; transition: border-color 0.2s, background 0.2s;
}
.prompt-chip:hover { border-color: var(--brand); background: rgba(139,92,246,0.18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.2rem; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.9rem; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-block { width: 100%; }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--error); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center; font-size: 1.2rem;
  color: var(--text-secondary); border: 1px solid transparent;
}
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; }
.sidebar-brand { font-family: var(--font-en); font-weight: 800; letter-spacing: 0.15em; color: var(--brand); }
.sidebar-section { flex: 1; overflow-y: auto; }
.sidebar-section h3 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin: 0 0 0.5rem; }
.conversation-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }

/* استایل‌های جدید برای آیتم‌های گفتگو و دکمه حذف */
.conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.conversation-item:hover, .conversation-item.active {
  background: rgba(139,92,246,0.12);
  color: var(--text-primary);
}
.conversation-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: start;
}
.delete-chat-btn {
  display: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}
.conversation-item:hover .delete-chat-btn {
  display: block;
}
.delete-chat-btn:hover {
  color: var(--error);
  background: rgba(239,68,68,0.1);
}
/* ---------------------------------------------- */

.sidebar-footer { display: flex; flex-direction: column; gap: 0.25rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.sidebar-link { text-align: start; padding: 0.45rem 0.5rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.85rem; }
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.model-indicator {
  flex: 1; text-align: center; font-size: 0.8rem; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-actions { display: flex; gap: 0.25rem; }

.message { display: flex; flex-direction: column; max-width: min(720px, 100%); }
.message--user { align-self: flex-end; align-items: flex-end; }
.message--assistant { align-self: flex-start; align-items: flex-start; }
.message-bubble {
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.92rem; word-break: break-word; white-space: pre-wrap;
}
.message--user .message-bubble { background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(59,130,246,0.2)); border: 1px solid rgba(139,92,246,0.3); }
.message--assistant .message-bubble { background: var(--bg-secondary); border: 1px solid var(--border); }
.message-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; opacity: 0; transition: opacity 0.2s; }
.message:hover .message-actions { opacity: 1; }
.message-action {
  font-size: 0.7rem; color: var(--text-secondary); padding: 0.15rem 0.4rem;
  border-radius: 4px; border: 1px solid var(--border);
}
.message-action:hover { color: var(--text-primary); border-color: var(--brand); }

.chat-input-form textarea, .welcome-input-form textarea {
  flex: 1; resize: none; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.7rem 1rem; color: var(--text-primary); font-size: 0.92rem;
  max-height: 200px; min-height: 44px; outline: none;
}
.chat-input-form textarea:focus, .welcome-input-form textarea:focus { border-color: var(--brand); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 100; padding: 1rem;
}
.modal-content {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  width: min(720px, 100%); max-height: 85vh; overflow-y: auto;
}

.model-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem; margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.model-card.selected { border-color: var(--brand); background: rgba(139,92,246,0.05); }
.model-card-header { display: flex; justify-content: space-between; align-items: center; }
.model-card-name { font-weight: 600; font-size: 0.95rem; }
.model-card-meta { font-size: 0.75rem; color: var(--text-secondary); }
.model-card-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

.progress-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--neon)); transition: width 0.3s; }

.tool-result {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.2);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin-top: 0.25rem;
}
.error-box {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md); padding: 0.75rem 1rem; color: var(--error); font-size: 0.85rem;
}