/* ============================================================
   RRSS Panel — Antimio con la ELA
   ============================================================ */

/* Header */
.rrss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.rrss-btn-refresh {
  background: none;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
}
.rrss-btn-refresh:hover { background: var(--bg2, #f5f5f5); }

/* KPI color overrides */
.rrss-kpi-green  { color: #16a34a; }
.rrss-kpi-blue   { color: #1d4ed8; }
.rrss-kpi-orange { color: #d97706; }
.rrss-kpi-red    { color: #dc2626; }

/* Tema CEO */
.rrss-tema {
  background: var(--bg2, #f5f5f5);
  border-left: 3px solid #6366f1;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  font-size: 14px;
}
.rrss-tema.hidden { display: none; }

/* Pipeline */
.rrss-pipeline-section { margin-bottom: 24px; }
.rrss-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rrss-pipeline-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg2, #f5f5f5);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: default;
}
.rrss-pipeline-name { font-weight: 600; }

/* Borradores grid */
.rrss-borradores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Card */
.rrss-card {
  background: var(--bg2, #fafafa);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rrss-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e0e0e0);
  flex-wrap: wrap;
}
.rrss-card-titulo {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rrss-card-thumb {
  height: 160px;
  overflow: hidden;
  background: var(--bg3, #ececec);
}
.rrss-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rrss-card-body {
  padding: 12px;
  flex: 1;
}
.rrss-copy-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 110px;
  overflow: hidden;
}
.rrss-hashtags {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #888);
}
.rrss-card-meta {
  padding: 4px 12px 6px;
  font-size: 12px;
  color: var(--muted, #888);
}
.rrss-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, #e0e0e0);
  flex-wrap: wrap;
}
.rrss-card-actions button {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border, #ccc);
  background: var(--bg, #fff);
}
.rrss-btn-aprobar  { border-color: #22c55e !important; color: #16a34a; }
.rrss-btn-rechazar { border-color: #ef4444 !important; color: #dc2626; }
.rrss-btn-editar   { border-color: #3b82f6 !important; color: #2563eb; }
.rrss-card-actions button:hover   { opacity: 0.8; }
.rrss-card-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.rrss-card-msg {
  margin: 0;
  padding: 4px 12px 8px;
  font-size: 12px;
  min-height: 20px;
}

/* Red badges */
.rrss-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.rrss-badge-ig       { background: #f09433; color: #fff; }
.rrss-badge-fb       { background: #1877f2; color: #fff; }
.rrss-badge-tiktok   { background: #010101; color: #fff; }
.rrss-badge-linkedin { background: #0a66c2; color: #fff; }
.rrss-badge-x        { background: #14171a; color: #fff; }

/* Estado badges */
.rrss-estado {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.rrss-estado-propuesto                  { background: #fef3c7; color: #d97706; }
.rrss-estado-revision_requerida         { background: #fee2e2; color: #dc2626; }
.rrss-estado-aprobado_pendiente_publicar{ background: #dcfce7; color: #16a34a; }
.rrss-estado-publicado                  { background: #dbeafe; color: #1d4ed8; }
.rrss-estado-pospuesto                  { background: #f3f4f6; color: #6b7280; }
.rrss-estado-descartado                 { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }

/* Historial / Audit collapsibles */
.rrss-details {
  margin-top: 20px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  overflow: hidden;
}
.rrss-details summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  background: var(--bg2, #f5f5f5);
  list-style: none;
}
.rrss-details summary::-webkit-details-marker { display: none; }
.rrss-details summary::before { content: '▶ '; font-size: 10px; }
.rrss-details[open] summary::before { content: '▼ '; }
.rrss-details[open] summary { border-bottom: 1px solid var(--border, #e0e0e0); }
.rrss-details table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rrss-details td, .rrss-details th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #f0f0f0);
  text-align: left;
}

/* ── Mockup toggle ─────────────────────────────── */
.rrss-mock-toggle {
  border-top: 1px solid var(--border, #e0e0e0);
}
.rrss-mock-toggle summary {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted, #888);
  list-style: none;
  user-select: none;
}
.rrss-mock-toggle summary::-webkit-details-marker { display: none; }
.rrss-mock-toggle[open] summary { border-bottom: 1px solid var(--border, #e0e0e0); }

/* ── Base mockup ────────────────────────────────── */
.rrss-mock {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
}
.mock-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.mock-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.mock-avatar-li { background: #0a66c2; border-radius: 4px; }
.mock-avatar-fb { background: #1877f2; }
.mock-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mock-handle { font-weight: 700; font-size: 12px; }
.mock-sub    { font-size: 11px; color: var(--muted, #888); }
.mock-more   { font-weight: 700; color: var(--muted, #888); cursor: default; }
.mock-caption { padding: 6px 10px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.mock-tags    { padding: 0 10px 6px; font-size: 12px; color: #00376b; }
.mock-time    { padding: 0 10px 8px; font-size: 11px; color: var(--muted, #999); }
.mock-media   { line-height: 0; }
.mock-img-placeholder {
  height: 120px; background: var(--bg3, #ececec);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted, #999); font-size: 13px;
}

/* ── Instagram ──────────────────────────────────── */
.mock-ig { background: #fff; border: 1px solid #dbdbdb; }
.mock-ig-actions {
  display: flex; gap: 14px; padding: 8px 10px;
  font-size: 20px;
}
.mock-ig-actions .mock-bookmark { margin-left: auto; }

/* ── LinkedIn ───────────────────────────────────── */
.mock-linkedin { background: #fff; border: 1px solid #e0e0e0; }
.mock-follow-btn {
  font-size: 12px; padding: 4px 10px;
  border: 1px solid #0a66c2; border-radius: 14px;
  color: #0a66c2; background: none; cursor: default;
}
.mock-tags-li { color: #0a66c2; }
.mock-li-engage {
  display: flex; gap: 6px; padding: 8px 10px;
  font-size: 12px; color: var(--muted, #666);
  border-top: 1px solid #e0e0e0; margin-top: 4px;
}
.mock-li-engage span { cursor: default; }

/* ── TikTok ─────────────────────────────────────── */
.mock-tiktok {
  background: #000; color: #fff;
  position: relative; min-height: 220px;
  display: flex; align-items: stretch;
}
.mock-tt-video { flex: 1; overflow: hidden; position: relative; }
.mock-tt-video img { width: 100%; height: 220px; object-fit: cover; display: block; }
.mock-tt-placeholder {
  height: 220px; display: flex; align-items: center; justify-content: center;
  background: #111; font-size: 36px; color: #555;
}
.mock-tt-sidebar {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 10px 8px; position: absolute; right: 0; bottom: 40px;
  z-index: 2;
}
.mock-tt-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fe2c55; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; border: 2px solid #fff;
}
.mock-tt-stat { text-align: center; font-size: 18px; line-height: 1.2; }
.mock-tt-stat small { font-size: 10px; color: #ccc; }
.mock-tt-bottom {
  position: absolute; left: 0; bottom: 0; right: 50px;
  padding: 8px 10px; z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.mock-tt-caption { font-size: 12px; line-height: 1.4; max-height: 60px; overflow: hidden; }
.mock-tt-music   { font-size: 11px; color: #eee; margin-top: 4px; }
.mock-tiktok .mock-tags { color: #aef; padding: 2px 0; font-size: 11px; }

/* ── Facebook ───────────────────────────────────── */
.mock-fb { background: #fff; border: 1px solid #ddd; }
.mock-fb-engage {
  display: flex; gap: 4px; padding: 6px 10px;
  font-size: 12px; color: var(--muted, #666);
  border-top: 1px solid #e0e0e0; margin-top: 4px;
}
.mock-fb-engage span { cursor: default; flex: 1; text-align: center; }

/* ── Generic (X / otros) ────────────────────────── */
.mock-generic { background: #fff; border: 1px solid #e0e0e0; }
.mock-generic .mock-tags { color: #1d9bf0; }

/* Edit modal */
.rrss-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rrss-modal.hidden { display: none; }
.rrss-modal-content {
  background: var(--bg, #fff);
  border-radius: 8px;
  padding: 24px;
  width: min(90vw, 480px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.rrss-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.rrss-modal-head h3 { margin: 0; }
.rrss-modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}
.rrss-modal-content textarea {
  width: 100%;
  font-size: 13px;
  padding: 8px;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
