/* ==========================================================================
   Publisher (post composer) UI/UX enhancement — scoped override.
   Loaded after style.min.css. Everything is scoped under #publisher-box so it
   cannot leak elsewhere. No markup/JS changes: pill active states use :has().
   ========================================================================== */

/* ---- modal shell: wider + responsive (composer modal only) ---- */
.modal-dialog:has(#publisher-wapper-modal) {
  max-width: 680px !important;
  width: 96% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.modal-dialog:has(#publisher-wapper-modal) .modal-content {
  width: 100%;
}
#publisher-wapper-modal,
#publisher-wapper-modal #publisher-box {
  width: 100%;
}
#publisher-wapper-modal #publisher-box,
#publisher-box[data-modal-mode="true"] {
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

/* ---- avatar ---- */
#publisher-box .publisher-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

/* ---- author header (modal): avatar + name on top ---- */
#publisher-box[data-modal-mode="true"] .publisher-author {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px 2px;
}
#publisher-box .publisher-author-avatar {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  max-width: 44px;
  border-radius: 50%;
  border: 1px solid #eef2f7;
  object-fit: cover;
  flex: 0 0 44px;
}
#publisher-box[data-modal-mode="true"] .publisher-author-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}
body.night-mode #publisher-box[data-modal-mode="true"] .publisher-author-name {
  color: var(--body-color-dark);
}

/* ---- message editor: full-width text field below the header ---- */
#publisher-box[data-modal-mode="true"] .publisher-message {
  padding: 8px 18px 10px;
}
#publisher-box[data-modal-mode="true"] .publisher-message:not(.colored) > .publisher-avatar {
  display: none;   /* avatar now lives in the header above */
}
#publisher-box[data-modal-mode="true"] .ql-editor {
  min-height: 130px;
  font-size: 17px !important;
}
#publisher-box[data-modal-mode="true"] .publisher-message:not(.colored) .colored-text-wrapper {
  background: #f6f8fc;
  border: 1px solid #e8eef6;
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 160px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
#publisher-box[data-modal-mode="true"] .publisher-message:not(.colored) .colored-text-wrapper:focus-within {
  background: #fff;
  border-color: #93b4f0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
/* clearer, friendlier placeholder cue */
#publisher-box .ql-editor.ql-blank::before {
  color: #94a3b8 !important;
}
body.night-mode #publisher-box[data-modal-mode="true"] .publisher-message:not(.colored) .colored-text-wrapper {
  background: var(--card-dark-hover);
  border-color: var(--card-dark-divider);
}
body.night-mode #publisher-box[data-modal-mode="true"] .publisher-message:not(.colored) .colored-text-wrapper:focus-within {
  background: var(--card-dark-input);
  border-color: #3b4d80;
}
#publisher-box .publisher-close .btn-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #f1f5f9;
  opacity: 1;
  background-size: 12px;
}
#publisher-box .publisher-close .btn-close:hover {
  background-color: #e2e8f0;
}

/* ==========================================================================
   Action grid — clean cards with colour-coded icons
   ========================================================================== */
#publisher-box .publisher-tools-tabs {
  border-top-color: #f1f5f9;
  border-bottom: 0;
}
#publisher-box .publisher-tools-tabs > ul.row {
  margin: 0 -6px;
}
#publisher-box .publisher-tools-tabs > ul.row > li {
  padding: 0 6px;
}

#publisher-box .publisher-tools-tab {
  display: flex !important;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 11px;
  padding: 7px 10px;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
#publisher-box .publisher-tools-tab:hover {
  background: #fff;
  border-color: #c7d6f5;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.10);
  transform: translateY(-1px);
  color: #1e293b;
}
#publisher-box .publisher-tools-tab.activated {
  background: #eef4ff;
  border-color: #bcd0fb;
}

/* icon chip behind each action icon */
#publisher-box .publisher-tools-tab .main-icon {
  box-sizing: border-box;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px;
  padding: 6px;
  border-radius: 9px;
  background: #eef2ff;
  margin-right: 0 !important;
  flex: 0 0 auto;
}

/* per-action colours: tinted chip + matching icon */
#publisher-box .publisher-tools-tab[data-tab="photos"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="album"] .main-icon { background: #e7f6ee; }
#publisher-box .publisher-tools-tab[data-tab="photos"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="album"] .main-icon * { fill: #0f9d58 !important; color: #0f9d58 !important; }

#publisher-box .publisher-tools-tab[data-tab="video"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="reel"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="live"] .main-icon { background: #fdeaea; }
#publisher-box .publisher-tools-tab[data-tab="video"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="reel"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="live"] .main-icon * { fill: #e23b3b !important; color: #e23b3b !important; }

#publisher-box .publisher-tools-tab[data-tab="audio"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="voice_notes"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="ai"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="ai_image"] .main-icon { background: #f0eafc; }
#publisher-box .publisher-tools-tab[data-tab="audio"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="voice_notes"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="ai"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="ai_image"] .main-icon * { fill: #7c3aed !important; color: #7c3aed !important; }

#publisher-box .publisher-tools-tab[data-tab="file"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="blog"] .main-icon { background: #e6f0fb; }
#publisher-box .publisher-tools-tab[data-tab="file"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="blog"] .main-icon * { fill: #2563eb !important; color: #2563eb !important; }

#publisher-box .publisher-tools-tab[data-tab="location"] .main-icon,
#publisher-box .publisher-tools-tab[data-tab="gif"] .main-icon { background: #e3f5f1; }
#publisher-box .publisher-tools-tab[data-tab="location"] .main-icon *,
#publisher-box .publisher-tools-tab[data-tab="gif"] .main-icon * { fill: #0d9488 !important; color: #0d9488 !important; }

#publisher-box .publisher-tools-tab[data-tab="colored"] .main-icon { background: #fceaf1; }
#publisher-box .publisher-tools-tab[data-tab="colored"] .main-icon * { fill: #db2777 !important; color: #db2777 !important; }

#publisher-box .publisher-tools-tab[data-tab="poll"] .main-icon { background: #eaeefc; }
#publisher-box .publisher-tools-tab[data-tab="poll"] .main-icon * { fill: #4f46e5 !important; color: #4f46e5 !important; }

#publisher-box .publisher-tools-tab[data-tab="feelings"] .main-icon,
#publisher-box .publisher-tools-tab.js_publisher-feelings .main-icon { background: #fcf3e2; }
#publisher-box .publisher-tools-tab[data-tab="feelings"] .main-icon *,
#publisher-box .publisher-tools-tab.js_publisher-feelings .main-icon * { fill: #d97706 !important; color: #d97706 !important; }

/* ==========================================================================
   Footer options — compact pill toggles
   ========================================================================== */
#publisher-box .publisher-footer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 2px 2px;
}
#publisher-box .publisher-footer-options .form-table-row {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto !important;
  margin: 0 !important;
  padding: 6px 12px 6px 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 999px;
  cursor: pointer;
}
#publisher-box .publisher-footer-options .form-table-row:hover {
  background: #f1f5f9;
  border-color: #dbe3ee;
}
/* active (checked) pill highlight via :has */
#publisher-box .publisher-footer-options .form-table-row:has(input:checked) {
  background: #eef2ff;
  border-color: #c7d2fe;
}
#publisher-box .publisher-footer-options .form-table-row:has(input:checked) .form-label {
  color: #4338ca;
}
/* hide the descriptive sub-text inside pills */
#publisher-box .publisher-footer-options .form-table-row .form-text {
  display: none !important;
}
#publisher-box .publisher-footer-options .form-table-row .avatar {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0;
}
#publisher-box .publisher-footer-options .form-table-row .avatar .main-icon {
  width: 18px !important;
  height: 18px !important;
}
#publisher-box .publisher-footer-options .form-table-row .form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
/* shrink the switch to a compact toggle inside the pill */
#publisher-box .publisher-footer-options .form-table-row .switch {
  transform: scale(0.72);
  transform-origin: center;
  margin: -6px -4px;
}
/* expandable sub-panels (schedule date, subscribers image, etc.) break to full width */
#publisher-box .publisher-footer-options > .form-group,
#publisher-box .publisher-footer-options > [id$="-wrapper"]:not(.form-table-row) {
  flex: 1 0 100%;
}

/* ==========================================================================
   Footer buttons — privacy pill + prominent Post
   ========================================================================== */
#publisher-box .publisher-footer-buttons {
  padding: 12px 2px 4px;
  gap: 10px;
}
#publisher-box .publisher-footer-buttons .btn-primary {
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 14px;
}

/* ==========================================================================
   Night mode
   ========================================================================== */
body.night-mode #publisher-box .publisher-tools-tab {
  background: var(--card-dark-input);
  border-color: var(--card-dark-divider);
  color: var(--body-color-dark);
}
body.night-mode #publisher-box .publisher-tools-tab:hover {
  border-color: #3b4d80;
  box-shadow: none;
}
body.night-mode #publisher-box .publisher-tools-tab .main-icon {
  background: rgba(255, 255, 255, 0.06);
}
body.night-mode #publisher-box .publisher-footer-options .form-table-row {
  background: var(--card-dark-hover);
  border-color: var(--card-dark-divider);
}
body.night-mode #publisher-box .publisher-footer-options .form-table-row:has(input:checked) {
  background: rgba(79, 70, 229, 0.18);
  border-color: #4f46e5;
}
