/* ════════════════════════════════════════════════════════════
   SANGHELIOS · campana.css
   Vista Campaña: formulario de parámetros + chat del Agente de
   Marketing (burbujas, typing, pósters generados, acciones).
   ════════════════════════════════════════════════════════════ */

#view-publicidad { background: var(--bg); }
.pub-wrap {
  display: grid; grid-template-columns: 390px 1fr; gap: 16px;
  max-width: 1460px; margin: 0 auto;
  padding: calc(var(--nav-h) + 16px) 24px 16px;
  height: 100vh;
}

/* ── Formulario lateral ── */
.pub-form {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 26px; overflow-y: auto;
}
.pub-form-title { font-size: 19px; font-weight: 800; letter-spacing: -0.4px; }
.pub-form-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 20px; }
.pub-grid { grid-template-columns: 1fr; gap: 16px; }
.pub-generate { width: 100%; justify-content: center; margin-top: 20px; padding: 15px; font-size: 14.5px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-secondary); }
.form-hint { font-size: 10px; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-input, .form-select {
  font-family: 'Inter', sans-serif; font-size: 13px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 12px; background: white; outline: none;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.form-input:focus, .form-select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(191,18,18,0.1); }

.seg { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button {
  flex: 1; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  padding: 9px 6px; border: none; background: white; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--red); color: white; }

.check-row { display: flex; gap: 9px; flex-wrap: wrap; }
.check-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 7px 14px; cursor: pointer; transition: all .15s; user-select: none;
}
.check-pill input { display: none; }
.check-pill.checked { border-color: var(--red); color: var(--red); background: rgba(191,18,18,0.06); }

.btn-generate {
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 700;
  background: var(--red); color: white; border: none; border-radius: 8px;
  padding: 10px 24px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s;
}
.btn-generate:hover { background: var(--red-hover); }

/* ── Chat ── */
.pub-chat {
  display: flex; flex-direction: column; min-width: 0;
  background: white; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.chat-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-name { font-size: 16px; font-weight: 800; }
.chat-status { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.chat-scroll {
  flex: 1; overflow-y: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-section);
}

/* burbujas */
.bub {
  max-width: 76%; border-radius: 16px; padding: 14px 18px;
  font-size: 14.5px; line-height: 1.65;
  animation: bub-in .25s ease;
}
@keyframes bub-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bub.bot { background: white; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bub.user { background: var(--red); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.bub.wide { max-width: 94%; }
.bub .msg-block { margin-top: 10px; margin-bottom: 0; background: white; }
.bub-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.bub.typing { display: flex; gap: 4px; padding: 14px 16px; }
.tdot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
  animation: tblink 1.2s infinite;
}
.tdot:nth-child(2) { animation-delay: .2s; }
.tdot:nth-child(3) { animation-delay: .4s; }
@keyframes tblink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* acciones rápidas dentro del chat */
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 700;
  background: white; color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: 22px;
  padding: 10px 19px; cursor: pointer; transition: all .15s;
}
.chip-btn:hover { border-color: var(--red); color: var(--red); }
.chip-btn.primary { background: var(--red); border-color: var(--red); color: white; }
.chip-btn.primary:hover { background: var(--red-hover); }

/* barra de entrada */
.chat-inputbar {
  display: flex; gap: 9px; padding: 12px 14px;
  border-top: 1px solid var(--border); background: white;
}
.chat-inputbar .form-input { flex: 1; }
.chat-send {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--red); border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.chat-send:hover { background: var(--red-hover); }

/* ── Mensajes por canal (bloques copiables) ── */
.msg-block { border: 1px solid var(--border); border-radius: 11px; margin-bottom: 10px; overflow: hidden; }
.msg-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-section); padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.msg-channel { font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-secondary); }
.msg-copy {
  font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600;
  color: var(--text-secondary); background: white;
  border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 3px 9px; cursor: pointer; transition: all .15s;
}
.msg-copy:hover { color: var(--red); border-color: var(--red); }
.msg-body { padding: 12px 14px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }

/* ── Pieza gráfica generada ("imagen") ── */
.poster {
  width: 340px; aspect-ratio: 4 / 5;
  border-radius: 16px; padding: 26px;
  display: flex; flex-direction: column;
  margin-top: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
}
.poster-brand { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; opacity: .92; }
.poster-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.poster-give { font-size: 38px; font-weight: 900; letter-spacing: 4px; line-height: 1; opacity: .92; }
.poster-type { font-size: 68px; font-weight: 900; letter-spacing: -2.5px; line-height: 1.05; margin: 5px 0 12px; word-break: break-word; }
.poster-type.small { font-size: 33px; letter-spacing: -0.5px; }
.poster-tag { font-size: 15.5px; font-weight: 600; opacity: .85; line-height: 1.5; }
.poster-foot { font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; opacity: .92; }
.poster-hash { margin-top: 7px; font-weight: 800; letter-spacing: 0.5px; }

@media (max-width: 880px) {
  .pub-wrap { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .pub-form { max-height: none; }
  .pub-chat { min-height: 70vh; }
  .form-grid { grid-template-columns: 1fr; }
}
