/**
 * social.css — the "LinkedIn" screen of the chat (social.js; user, 21.10.2026, AGENTMOB D-080, D-101).
 * 1.3.0 (user, 22.10.2026): full screen on the phone and the laptop; campaign drop-down on top, "+ Campanie nouă"
 * under it, the short list of posts; the post popup also full screen. VOGO style: Material Design outlined fields
 * (the rag-ai.css .md-field pattern), VOGO blue (--vogo-icon-blue), flat outline icons, 7px corners; light and dark.
 * 1.4.0: the post preview before publishing ("Publică").
 * 1.5.0: the planned date as a button opening the VOGO picker (dtpicker.css).
 * 1.6.0: the channel drop-down with logos, left of the campaign.
 * @file_version 1.6.0
 */
.soc, .soc-dlg {
  --soc-blue: var(--vogo-icon-blue, #0F6CBD);
  --md-outline: var(--line); --md-outline-hover: var(--muted); --md-primary: var(--soc-blue);
  --md-error: var(--off); --md-label: var(--muted);
}

/* The screen: the whole window, its content centred up to a readable width */
.soc { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; background: var(--bg); }
.soc-card { position: relative; width: 100%; max-width: 1100px; height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
  gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--panel); }
body.soc-open { overflow: hidden; }

/* Top bar: the campaign drop-down (or the post's title), then the icons, X always last */
.soc-bar { display: flex; align-items: center; gap: 6px; flex: none; padding-top: 8px; }
.soc-bar .md-field { flex: 1 1 auto; min-width: 0; margin: 0; }
.soc-icon { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
  color: var(--soc-blue); background: transparent; border: 0; border-radius: 7px; cursor: pointer; position: relative; }
.soc-icon:hover { background: var(--bg); }
.soc-icon:disabled { opacity: .5; cursor: default; }
.soc-close { color: var(--muted); }
.soc-connect.off::after { content: ''; position: absolute; top: 8px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--off); }

/* Material outlined fields (VOGO field style): label inside when empty, on the border when focused or filled */
.soc .md-field, .soc-dlg .md-field { position: relative; display: flex; flex-direction: column; }
.soc .md-field :is(input, select, textarea), .soc-dlg .md-field input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 12px;
  font: inherit; font-size: 15px; line-height: 20px; color: var(--fg); background: var(--panel); border: 1px solid var(--md-outline);
  border-radius: 7px; transition: border-color .15s, box-shadow .15s; }
.soc .md-field select { appearance: auto; cursor: pointer; }
.soc .md-field:hover :is(input, select, textarea), .soc-dlg .md-field:hover input { border-color: var(--md-outline-hover); }
.soc .md-field:focus-within :is(input, select, textarea), .soc-dlg .md-field:focus-within input { outline: 0; border-color: var(--md-primary);
  box-shadow: 0 0 0 1px var(--md-primary); }
.soc .md-field :is(input, textarea):disabled { opacity: .7; }
.soc .md-label, .soc-dlg .md-label { position: absolute; top: 13px; left: 13px; z-index: 2; max-width: calc(100% - 40px); padding: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 18px; color: var(--md-label);
  pointer-events: none; background: transparent; transition: top .15s, left .15s, font-size .15s, color .15s; }
.soc .md-field:is(.is-filled, :focus-within) .md-label, .soc-dlg .md-field:is(.is-filled, :focus-within) .md-label { top: -8px; left: 10px;
  padding: 0 4px; font-size: 12px; background: var(--panel); }
.soc .md-field:focus-within .md-label, .soc-dlg .md-field:focus-within .md-label { color: var(--md-primary); }

/* Buttons: text (VOGO blue), outlined, filled, danger — flat, 7px corners, icon + word */
.soc-text-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; font: inherit; font-size: 14px;
  font-weight: 600; color: var(--soc-blue); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.soc-text-btn:hover { background: var(--bg); }
.soc-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  font: inherit; font-size: 14px; font-weight: 600; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.soc-btn.outlined { color: var(--soc-blue); background: transparent; border: 1px solid var(--line); }
.soc-btn.outlined:hover { border-color: var(--soc-blue); }
.soc-btn.filled { color: #fff; background: var(--soc-blue); border: 1px solid var(--soc-blue); }
.soc-btn.danger { color: var(--off); background: transparent; border: 0; padding: 0 8px; }
.soc-btn:disabled { opacity: .55; cursor: default; }

/* The posts of the campaign: the only scrolling part */
.soc-list-head { display: flex; align-items: center; justify-content: space-between; flex: none; border-top: 1px solid var(--line); padding-top: 6px; }
.soc-count { font-size: 13px; color: var(--muted); }
.soc-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.soc-empty { padding: 18px 4px; color: var(--muted); font-size: 14px; }
.soc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; min-height: 48px;
  padding: 4px 4px 4px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
.soc-row:hover { background: var(--bg); }
.soc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.soc-chip { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); border: 1px solid var(--line); }
.soc-chip.published { color: var(--soc-blue); border-color: var(--soc-blue); }
.soc-chip.failed { color: var(--off); border-color: var(--off); }
.soc-edit { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--soc-blue); background: transparent; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.soc-edit:hover { border-color: var(--soc-blue); }
.soc-more { display: block; width: 100%; padding: 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--soc-blue);
  background: transparent; border: 0; cursor: pointer; }

/* Snackbar */
.soc-snack { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3;
  max-width: calc(100% - 32px); padding: 10px 16px; font-size: 14px; color: #fff; background: #2b3240; border-radius: 7px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.soc-snack.bad { background: var(--off); }

/* The post popup: full screen above the list; the text takes all the height left */
.socp { z-index: 31; }
.socp-body-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; padding-top: 8px; }
.socp-body-field { flex: 1 1 auto; }
.socp-body-field textarea { height: 100%; resize: none; padding-bottom: 52px; line-height: 1.5; }
.socp-mic { position: absolute; right: 8px; bottom: 8px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.socp-mic.on { color: #fff; background: var(--soc-blue); border-color: var(--soc-blue); }
.socp-read { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.socp-read-meta { font-size: 13px; color: var(--muted); }
.socp-read-meta a { color: var(--soc-blue); }
.socp-read-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
.socp-foot { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; }
/* The channel drop-down: the logo and name like an outlined field, the menu under it */
.soc-bar .soc-chan-field { flex: none; width: 170px; }
.soc-chan-btn { width: 100%; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  font: inherit; font-size: 15px; color: var(--fg); text-align: left; background: var(--panel); border: 1px solid var(--md-outline);
  border-radius: 7px; cursor: pointer; transition: border-color .15s; }
.soc-chan-btn:hover { border-color: var(--md-outline-hover); }
.soc-chan-btn[aria-expanded="true"] { border-color: var(--md-primary); box-shadow: 0 0 0 1px var(--md-primary); }
.soc-chan-btn > .bi:first-child, .soc-chan-item .bi { color: var(--soc-blue); font-size: 18px; }
.soc-chan-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-chan-caret { color: var(--muted); font-size: 13px; }
.soc-chan-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; min-width: 100%; box-sizing: border-box; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.soc-chan-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; font: inherit;
  font-size: 15px; color: var(--fg); text-align: left; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.soc-chan-item:hover { background: var(--bg); }
.soc-chan-item.on { font-weight: 700; color: var(--soc-blue); }
.socp-planned-field { width: 240px; }
.socp-planned { width: 100%; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  font: inherit; font-size: 15px; color: var(--fg); text-align: left; background: var(--panel); border: 1px solid var(--md-outline);
  border-radius: 7px; cursor: pointer; transition: border-color .15s; }
.socp-planned i { color: var(--soc-blue); font-size: 17px; }
.socp-planned.empty { color: var(--muted); }
.socp-planned:hover { border-color: var(--md-outline-hover); }
.socp-planned:focus-visible { outline: 0; border-color: var(--md-primary); box-shadow: 0 0 0 1px var(--md-primary); }
.socp-count { margin-left: auto; font-size: 12px; color: var(--muted); }
/* The preview: the post as on LinkedIn, then "Înapoi la editare" / "Publică pe LinkedIn" */
.socp-preview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.socp-prev-card { flex: 1 1 auto; min-height: 0; overflow-y: auto; width: 100%; max-width: 640px; margin: 0 auto;
  box-sizing: border-box; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.socp-prev-who { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--soc-blue); }
.socp-prev-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.socp-prev-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; flex-wrap: wrap; }
.socp-prev-q { margin-right: auto; font-size: 14px; font-weight: 600; }

/* The small dialog: new campaign, the app's keys */
.soc-dlg { position: fixed; inset: 0; z-index: 32; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .45); }
.soc-dlg-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.soc-dlg-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; }
.soc-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; }
.soc-dlg-error { font-size: 13px; color: var(--off); }

@media (max-width: 600px) {
  .soc-card { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .soc .md-field :is(input, select, textarea), .soc-dlg .md-field input { font-size: 16px; }   /* no iPhone zoom on focus */
  /* A post on two lines: the title, then date · status · Edit */
  .soc-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'title title title' 'when chip edit';
    row-gap: 4px; padding: 8px 4px; }
  .soc-title { grid-area: title; }
  .soc-when { grid-area: when; }
  .soc-chip { grid-area: chip; }
  .soc-edit { grid-area: edit; }
  /* On the phone the channel shows its logo only; the menu keeps the names */
  .soc-bar .soc-chan-field { width: 76px; }
  .soc-chan-name { display: none; }
  .soc-chan-menu { min-width: 180px; }
  .socp-foot { gap: 8px; }
  .socp-planned-field { order: -1; width: 100%; }
  .socp-count { display: none; }
  .socp-foot .soc-btn.outlined, .socp-foot .soc-btn.filled { flex: 1 1 0; }
  .socp-prev-q { width: 100%; }
  .socp-prev-foot .soc-btn { flex: 1 1 0; }
}

/* The LinkedIn row of the menu button's long-press pop-up (rag-ai.js) */
.font-pop-social button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.font-pop-social .bi { color: var(--vogo-icon-blue, #0F6CBD); }
