/* ============================================================================
   Capi Când-IA Pro — Welcome State v2 (Cursor/Linear-inspired)
   Avatar discreto + saudação dinâmica + grid de starter cards + chips secundários.
   ============================================================================ */

.ds-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 32px;
  position: relative;
  text-align: center;
}

.ds-welcome > * {
  position: relative;
  z-index: 1;
}

/* ─── Galaxy motion (back + front) — agora dentro de .chat-main, cobre full main area ─── */
.ds-galaxy-bg,
.ds-galaxy-fg {
  position: absolute !important;
  top: 52px !important;  /* abaixo do topbar (52px alto) */
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  pointer-events: none !important;
  display: block;
}
.ds-galaxy-bg { z-index: 2 !important; }
.ds-galaxy-fg {
  z-index: 3 !important;
  mix-blend-mode: screen;
}

/* Light mode: galaxy mais discreta (fundo claro mata contraste) */
body:not(.dark-mode) .ds-galaxy-bg,
body:not(.dark-mode) .ds-galaxy-fg {
  opacity: 0.4;
}

/* Wrapper do avatar — necessário pra ancorar o balão de fala que aparece
   quando uma estrela cadente passa. Wrapper = inline-block do tamanho do
   avatar; balão é absolute relativo a ele. */
.ds-welcome-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}
.ds-welcome-avatar-wrap .ds-welcome-avatar {
  margin-bottom: 0;
}

/* Balão de fala da Capi — direita do avatar, seta apontando esquerda.
   Aparece quando uma estrela cadente passa, com 1 frase rotativa. */
.ds-capi-bubble {
  position: absolute;
  top: 50%;
  left: calc(100% + 16px);
  transform: translateY(-50%) translateX(-8px) scale(0.85);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
  background: linear-gradient(135deg, rgba(28,22,12,0.92), rgba(40,30,15,0.9));
  border: 1px solid rgba(232,192,104,0.45);
  color: #f5e6c4;
  font: 500 13px ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.45),
    0 0 16px rgba(212,160,23,0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  will-change: transform, opacity;
}
/* Seta apontando pra esquerda (pro avatar) */
.ds-capi-bubble::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid rgba(28,22,12,0.92);
  margin-right: -1px;
  filter: drop-shadow(-1px 0 0 rgba(232,192,104,0.45));
}
.ds-capi-bubble.show {
  animation: dsCapiBubble 3600ms cubic-bezier(0.16, 1.2, 0.3, 1) forwards;
}
@keyframes dsCapiBubble {
  0%   { opacity: 0; transform: translateY(-50%) translateX(-12px) scale(0.85); }
  10%  { opacity: 1; transform: translateY(-50%) translateX(0)     scale(1.04); }
  18%  { opacity: 1; transform: translateY(-50%) translateX(0)     scale(1); }
  85%  { opacity: 1; transform: translateY(-50%) translateX(0)     scale(1); }
  100% { opacity: 0; transform: translateY(-50%) translateX(8px)   scale(0.95); }
}

/* Light mode */
body:not(.dark-mode) .ds-capi-bubble {
  background: linear-gradient(135deg, rgba(255,250,240,0.96), rgba(252,245,230,0.96));
  border-color: rgba(212,160,23,0.55);
  color: #2a1c00;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.12),
    0 0 16px rgba(212,160,23,0.25);
}
body:not(.dark-mode) .ds-capi-bubble::before {
  border-right-color: rgba(255,250,240,0.96);
}

/* Mobile: balão sumido (não cabe ao lado do avatar centralizado) */
@media (max-width: 600px) {
  .ds-capi-bubble { display: none; }
}

/* ─── Avatar (menor, mais refinado) ─── */
.ds-welcome-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--ds-radius-full);
  object-fit: cover;
  border: 1.5px solid rgba(212,160,23,0.55);
  box-shadow:
    0 0 24px rgba(212,160,23,0.20),
    0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 18px;
  display: block;
  animation: dsWelcomePulse 4s ease-in-out infinite;
}

@keyframes dsWelcomePulse {
  0%, 100% { box-shadow: 0 0 24px rgba(212,160,23,0.20), 0 2px 8px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 32px rgba(212,160,23,0.32), 0 2px 8px rgba(0,0,0,0.5); }
}

/* ─── Saudação dinâmica (linha mono pequena, estilo Linear) ─── */
.ds-welcome-greeting {
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ds-welcome-greeting .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ds-gold);
  box-shadow: 0 0 8px rgba(212,160,23,0.6);
}

/* ─── Título compacto ─── */
.ds-welcome-title {
  font-family: var(--ds-font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--ds-text);
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  line-height: 1.15;
}

.ds-welcome-title-accent {
  color: var(--ds-gold);
  font-weight: 600;
}

.ds-welcome-sub {
  font-family: var(--ds-font-sans);
  font-size: 13px;
  color: var(--ds-text-2);
  line-height: 1.5;
  margin: 0 0 32px;
  max-width: 480px;
}

/* ─── Grid de Starter Cards (2x2) ─── */
.ds-welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  gap: 10px;
  width: 100%;
  max-width: 580px;
  margin-bottom: 16px;
}

.ds-starter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 180ms ease;
  font-family: var(--ds-font-sans);
  overflow: hidden;
}

/* Linha dourada animada no hover (sutil) */
.ds-starter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(212,160,23,0) 0%, rgba(212,160,23,0) 50%, rgba(212,160,23,0.35) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.ds-starter-card:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.10);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(212,160,23,0.08);
}

.ds-starter-card:hover::before {
  opacity: 1;
}

.ds-starter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ds-starter-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212,160,23,0.08);
  border: 1px solid rgba(212,160,23,0.18);
  color: var(--ds-gold);
  flex-shrink: 0;
}

.ds-starter-card-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.ds-starter-card-cat {
  font-family: var(--ds-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ds-gold);
  opacity: 0.75;
}

.ds-starter-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

/* ─── Linha secundária (mini chips) ─── */
.ds-welcome-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 580px;
  margin-bottom: 20px;
}

.ds-starter-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  color: var(--ds-text-2);
  font-family: var(--ds-font-sans);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all 160ms ease;
}

.ds-starter-mini:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(212,160,23,0.25);
  color: var(--ds-text);
}

.ds-starter-mini svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  opacity: 0.6;
}

/* ─── Footer hint (atalhos de teclado) ─── */
.ds-welcome-hint {
  font-family: var(--ds-font-mono);
  font-size: 10.5px;
  color: var(--ds-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0.75;
}

.ds-welcome-hint kbd {
  font-family: var(--ds-font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--ds-text-2);
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .ds-welcome { padding: 14px 16px }
  .ds-welcome-avatar { width: 48px; height: 48px; margin-bottom: 10px }
  .ds-welcome-title { font-size: 22px }
  .ds-welcome-sub { font-size: 12px; margin-bottom: 16px }
  .ds-welcome-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .ds-welcome-hint { display: none }
}

/* ─── Legacy pills (mantém compat se algo ainda renderiza) ─── */
.ds-welcome-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
}
