/* ============================================================================
   Capi Când-IA Pro — Shell overrides (Fase 1)
   Aplica visual novo a markup JS-renderizado que usa classes legadas.
   Hides banner strips, conversa items, etc.
   ============================================================================ */

/* ─── Hide legacy banners (migração pendente: conteúdo vai pro sino) ─── */
#bannerFundadores,
#bannerCapiTreino,
#renewalBanner,
#upgradeBanner {
  display: none !important;
}

/* ─── Conversations rendered by JS (.conv-item) → estilo Codex ─── */
#chatScreen.ds-shell #convList {
  padding: 0;
  flex: 0 0 auto;
}

#chatScreen.ds-shell .conv-item {
  padding: 6px 12px;
  margin: 0 10px 1px;
  border-radius: var(--ds-radius);
  background: transparent !important;
  border: none !important;
  border-left: 2px solid transparent !important;
  color: var(--ds-text-2);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  transition: background 0.15s ease;
  position: relative;
}

#chatScreen.ds-shell .conv-item:hover {
  background: rgba(255,255,255,0.04) !important;
  color: var(--ds-text) !important;
}

#chatScreen.ds-shell .conv-item.active {
  background: var(--ds-gold-dim) !important;
  border-left-color: var(--ds-gold) !important;
  color: var(--ds-gold) !important;
  padding-left: 10px;
}

#chatScreen.ds-shell .conv-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#chatScreen.ds-shell .conv-item-title {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  color: inherit !important;
}

#chatScreen.ds-shell .conv-item-date {
  font-family: var(--ds-font-mono);
  font-size: 10px;
  color: #555 !important;
  margin-top: 0;
  flex-shrink: 0;
  letter-spacing: 0;
  transition: opacity 0.15s ease;
}

#chatScreen.ds-shell .conv-item.active .conv-item-date {
  color: #8a6810 !important;
}

#chatScreen.ds-shell .conv-item:hover .conv-item-date {
  opacity: 0;
}

/* Legacy action buttons (pin/move/rename/delete inline) — agora consolidados no menu ⋮ */
#chatScreen.ds-shell .conv-item .conv-pin,
#chatScreen.ds-shell .conv-item .conv-move,
#chatScreen.ds-shell .conv-item .conv-folder,
#chatScreen.ds-shell .conv-item .conv-edit,
#chatScreen.ds-shell .conv-item .conv-rename,
#chatScreen.ds-shell .conv-item .conv-delete {
  display: none !important;
}

/* Botão ⋮ (3 pontinhos) — abre dropdown liquid glass */
#chatScreen.ds-shell .conv-item .conv-item-menu-btn {
  background: transparent;
  border: none;
  padding: 4px 5px;
  border-radius: 5px;
  color: var(--ds-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .12s ease, color .12s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#chatScreen.ds-shell .conv-item:hover .conv-item-menu-btn,
#chatScreen.ds-shell .conv-item.active .conv-item-menu-btn {
  opacity: 1;
}

#chatScreen.ds-shell .conv-item .conv-item-menu-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--ds-text);
}

#chatScreen.ds-shell .conv-item .conv-item-menu-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Empty state */
#chatScreen.ds-shell .conv-empty {
  padding: 20px 14px !important;
  font-family: var(--ds-font-sans) !important;
  font-size: 12px !important;
  color: var(--ds-text-muted) !important;
  text-align: center !important;
  line-height: 1.5;
  background: transparent !important;
  border: none !important;
}

/* ─── Projects list rendering ─── */
#chatScreen.ds-shell .projects-header {
  padding: 6px 16px 4px !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
}

#chatScreen.ds-shell .projects-label {
  font-family: var(--ds-font-mono) !important;
  font-size: 10px !important;
  color: var(--ds-text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-weight: 500 !important;
}

#chatScreen.ds-shell #projectsList .project-item,
#chatScreen.ds-shell #projectsList > div {
  padding: 4px 14px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-2);
  cursor: pointer;
}

/* ─── Favoritos section ─── */
#chatScreen.ds-shell .fav-section-title {
  background: transparent !important;
  font-weight: 500 !important;
}

/* ─── chat-messages container ajusta padding ─── */
#chatScreen.ds-shell #chatMessages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: transparent;
}

/* ─── Welcome avatar override pra usar o ds-welcome-avatar (vencer regra existing) ─── */
#chatScreen.ds-shell .welcome-avatar.ds-welcome-avatar {
  width: 76px;
  height: 76px;
  border-radius: var(--ds-radius-full);
  object-fit: cover;
  border: 2px solid rgba(212,160,23,0.45);
  box-shadow:
    0 0 32px rgba(212,160,23,0.22),
    0 4px 16px rgba(0,0,0,0.45);
  margin: 0 auto 20px;
  display: block;
}

/* welcome title h3 override pra Inter Tight */
#chatScreen.ds-shell .ds-welcome-title {
  font-family: var(--ds-font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--ds-text);
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  line-height: 1.1;
  text-align: center;
}

#chatScreen.ds-shell .ds-welcome-title-accent,
#chatScreen.ds-shell .ds-welcome-title .hl,
#chatScreen.ds-shell .ds-welcome-title .ds-welcome-title-accent,
#chatScreen.ds-shell h3.ds-welcome-title .hl {
  color: var(--ds-gold) !important;
}

/* ─── Topbar status: remove pill bg legacy ─── */
#chatScreen.ds-shell .header-status.ds-topbar-status,
#chatScreen.ds-shell .ds-topbar-status {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* ─── PROJETOS: substituir + button por chevron + count (estilo collapsible) ─── */
#chatScreen.ds-shell .projects-header.ds-section-label {
  cursor: pointer;
  user-select: none;
}

#chatScreen.ds-shell .projects-header .btn-new-project {
  margin-left: auto;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--ds-text-muted) !important;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#chatScreen.ds-shell .projects-header .btn-new-project:hover {
  border-color: var(--ds-gold-border) !important;
  color: var(--ds-gold) !important;
}

#chatScreen.ds-shell .ds-welcome-sub {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-md);
  color: var(--ds-text-2);
  line-height: 1.6;
  margin: 0 auto 32px;
  text-align: center;
  max-width: 520px;
}

/* welcome pills container */
#chatScreen.ds-shell .ds-welcome-pills.suggestion-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  max-width: 720px;
  margin: 0 auto;
}

#chatScreen.ds-shell .welcome-screen,
#chatScreen.ds-shell .chat-welcome.ds-welcome {
  background: transparent !important;
  padding: 20px 32px !important;
}

#chatScreen.ds-shell .chat-welcome.ds-welcome {
  position: relative;
}

#chatScreen.ds-shell .chat-welcome.ds-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center top, rgba(212,160,23,0.07) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

#chatScreen.ds-shell .chat-welcome.ds-welcome > * {
  position: relative;
  z-index: 1;
}

/* ─── Mobile: padding-top no chat-main pra topbar sticky ─── */
@media (max-width: 900px) {
  #chatScreen.ds-shell .chat-main { padding-top: 0 }
}
