/* ================================================================
   MSN ULTRA COMPOSER - msn-ultra-composer.css
   Works with Feed 1 (includes/feed/views/post-form.php)
   ================================================================ */

/* ── COLLAPSED CARD ── */
.msn-uc-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  border: 1px solid #e4e6ea;
  overflow: hidden;
  margin-bottom: 0;
  transition: box-shadow .2s ease;
}
.msn-uc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.13); }

.msn-uc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
}
.msn-uc-top .msn-avatar img,
.msn-uc-top img { border-radius: 50%; }

.msn-uc-prompt-btn {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: #f0f2f5;
  border: 1.5px solid #e4e6ea;
  padding: 0 18px;
  text-align: left;
  font-size: 15px;
  color: #65676b;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: background .15s, border-color .15s;
}
.msn-uc-prompt-btn:hover { background: #e9ebee; border-color: #bdbfc2; }

.msn-uc-sep { height: 1px; background: #e4e6ea; margin: 2px 0; }

.msn-uc-shortcuts {
  display: flex;
  padding: 4px 6px 10px;
}
.msn-uc-shortcut {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  font-family: inherit;
  transition: background .15s;
}
.msn-uc-shortcut:hover { background: #f0f2f5; }
.msn-uc-shortcut svg {
  width: 22px; height: 22px;
  fill: none; stroke: #65676b; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.msn-uc-shortcut:nth-child(1) svg { stroke: #f40002; }
.msn-uc-shortcut:nth-child(2) svg { stroke: #45bd62; }
.msn-uc-shortcut:nth-child(3) svg { stroke: #f7b928; }

/* ── BACKDROP ── */
.msn-uc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  transition: background .28s ease;
  /* CRITICAL: when hidden, never block clicks */
  pointer-events: none;
  visibility: hidden;
}
.msn-uc-backdrop.msn-uc-vis {
  background: rgba(0,0,0,.65);
  pointer-events: auto;
  visibility: visible;
}
/* Also ensure hidden attribute fully removes it from interaction */
.msn-uc-backdrop[hidden] {
  display: none !important;
}
body.msn-uc-open { overflow: hidden; }

/* ── MODAL ── */
.msn-uc-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.24), 0 6px 20px rgba(0,0,0,.14);
  transform: translateY(28px) scale(.96);
  opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
  overflow: hidden;
  z-index: 99999;
}
.msn-uc-modal.msn-uc-in { transform: translateY(0) scale(1); opacity: 1; }

.msn-uc-mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 13px;
  border-bottom: 1.5px solid #e4e6ea;
  flex-shrink: 0;
}
.msn-uc-mhead h2 { margin: 0; font-size: 18px; font-weight: 800; color: #050505; letter-spacing: -.02em; }
.msn-uc-close {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: #f0f2f5;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.msn-uc-close:hover { background: #e4e6ea; }
.msn-uc-close svg { width: 17px; height: 17px; fill: none; stroke: #050505; stroke-width: 2.5; stroke-linecap: round; }

.msn-uc-mbody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: #dadde1 transparent;
}

/* ── AUTHOR ROW ── */
.msn-uc-author {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0 8px;
}
.msn-uc-author .msn-avatar img,
.msn-uc-author img { border-radius: 50%; }
.msn-uc-ainfo { display: flex; flex-direction: column; gap: 5px; }
.msn-uc-ainfo strong { font-size: 15px; font-weight: 800; color: #050505; }

/* Audience button */
.msn-uc-audwrap { position: relative; }
.msn-uc-audbtn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px;
  border: none; border-radius: 8px;
  background: #f0f2f5;
  font-size: 12.5px; font-weight: 700;
  color: #050505; cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.msn-uc-audbtn:hover { background: #e4e6ea; }
.msn-uc-audbtn svg { width: 14px; height: 14px; fill: none; stroke: #050505; stroke-width: 2; stroke-linecap: round; }
.msn-uc-caret { width: 13px !important; height: 13px !important; }

.msn-uc-audmenu {
  position: absolute;
  top: calc(100% + 5px); left: 0; z-index: 200;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  border: 1px solid #e4e6ea;
  min-width: 260px;
  overflow: hidden;
  animation: ucddIn .18s ease;
}
@keyframes ucddIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

.msn-uc-audopt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  border: none; background: transparent;
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.msn-uc-audopt:hover { background: #f0f2f5; }
.msn-uc-audopt.active { background: #e7f0fd; }
.msn-uc-audico { font-size: 22px; flex-shrink: 0; }
.msn-uc-audtxt { flex: 1; display: flex; flex-direction: column; }
.msn-uc-audtxt strong { font-size: 14px; font-weight: 700; color: #050505; }
.msn-uc-audtxt small  { font-size: 12px; color: #65676b; }
.msn-uc-tick { width: 18px; height: 18px; fill: none; stroke: #1877f2; stroke-width: 2.5; opacity: 0; }
.msn-uc-audopt.active .msn-uc-tick { opacity: 1; }

/* ── TEXT ZONE ── */
.msn-uc-txtwrap {
  position: relative; border-radius: 12px; overflow: hidden;
  margin: 4px 0; transition: background .3s ease, min-height .3s ease;
}
.msn-uc-txtwrap.has-bg {
  min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px 14px;
}
#msn-post-textarea {
  width: 100%; min-height: 80px;
  border: none; outline: none; resize: none;
  background: transparent;
  font-size: 17px; font-family: inherit;
  color: #050505; line-height: 1.5; padding: 4px 0;
}
.msn-uc-txtwrap.has-bg #msn-post-textarea {
  font-size: 22px; font-weight: 800; text-align: center;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.35); caret-color: #fff;
}
#msn-post-textarea::placeholder { color: #bec3c9; }
.msn-uc-txtwrap.has-bg #msn-post-textarea::placeholder { color: rgba(255,255,255,.7); }

.msn-uc-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.msn-uc-chip-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px; background: #e7f0fd;
  color: #1877f2; font-size: 13px; font-weight: 700;
}
.msn-uc-chip-pill button {
  border: none; background: none; color: #1877f2; cursor: pointer; padding: 0; font-size: 13px;
}

/* ── BG COLOR STRIP ── */
.msn-uc-bgs {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; overflow-x: auto; scrollbar-width: none;
}
.msn-uc-bgs::-webkit-scrollbar { display: none; }
.msn-uc-bg {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s, border-color .18s;
}
.msn-uc-bg:hover { transform: scale(1.12); }
.msn-uc-bg.active { border-color: #1877f2; transform: scale(1.18); }
.msn-uc-bg:first-child { background: #f0f2f5; }
.msn-uc-bg:first-child svg { width: 16px; height: 16px; fill: none; stroke: #65676b; stroke-width: 2.5; stroke-linecap: round; }

/* ── MEDIA ZONE ── */
.msn-uc-mediazone {
  position: relative; background: #f0f2f5; border-radius: 12px;
  padding: 10px; margin: 8px 0;
  border: 2px dashed #e4e6ea;
}
.msn-uc-mediax {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msn-uc-mediax svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.msn-uc-mgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 6px;
}
.msn-uc-mitem {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1; background: #000;
}
.msn-uc-mitem img, .msn-uc-mitem video { width: 100%; height: 100%; object-fit: cover; }
.msn-uc-mitem-rm {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msn-uc-mitem-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; letter-spacing: .04em;
}
.msn-uc-addmore {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; padding: 10px; border-radius: 10px;
  background: #fff; border: 1.5px dashed #e4e6ea; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #65676b;
  transition: background .15s;
}
.msn-uc-addmore:hover { background: #e4e6ea; }
.msn-uc-addmore svg { width: 16px; height: 16px; fill: none; stroke: #65676b; stroke-width: 2; }

/* ── PANELS ── */
.msn-uc-panel {
  background: #f0f2f5; border-radius: 12px; padding: 14px; margin: 8px 0;
  animation: ucPanelIn .2s ease;
}
@keyframes ucPanelIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.msn-uc-phead {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.msn-uc-phead strong { font-size: 15px; font-weight: 800; color: #050505; }
.msn-uc-pback {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.msn-uc-pback:hover { background: #e4e6ea; }
.msn-uc-pback svg { width: 16px; height: 16px; fill: none; stroke: #050505; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.msn-uc-psearch-row {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 10px;
  padding: 10px 14px; border: 1.5px solid #e4e6ea; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-psearch-row:focus-within { border-color: #1877f2; }
.msn-uc-psearch-row svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: #65676b; stroke-width: 2; stroke-linecap: round; }
.msn-uc-psearch-row input { flex: 1; border: none; outline: none; background: transparent; font-size: 14.5px; font-family: inherit; }

/* Feeling search */
.msn-uc-fq {
  width: 100%; background: #fff; border: 1.5px solid #e4e6ea;
  border-radius: 10px; padding: 10px 14px;
  font-size: 14px; font-family: inherit; outline: none; margin-bottom: 12px;
  transition: border-color .15s;
}
.msn-uc-fq:focus { border-color: #1877f2; }

.msn-uc-fgrid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 6px;
  max-height: 240px; overflow-y: auto; scrollbar-width: thin;
}
.msn-uc-fbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border-radius: 10px; border: none;
  background: #fff; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s;
}
.msn-uc-fbtn:hover { background: #e7f0fd; transform: scale(1.06); }
.msn-uc-fbtn span { font-size: 24px; }
.msn-uc-fbtn small { font-size: 11px; color: #65676b; font-weight: 600; }

/* GPS button */
.msn-uc-gps {
  width: 100%; padding: 12px 14px; border: none; border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 700; color: #1877f2;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  transition: background .15s;
}
.msn-uc-gps:hover { background: #e7f0fd; }
.msn-uc-gps svg { width: 18px; height: 18px; fill: none; stroke: #1877f2; stroke-width: 2; flex-shrink: 0; }
.msn-uc-loc-item {
  width: 100%; padding: 10px 14px; border: none; border-radius: 8px;
  background: #fff; text-align: left; font-size: 14px; cursor: pointer;
  font-family: inherit; display: block; margin-bottom: 4px;
  transition: background .15s;
}
.msn-uc-loc-item:hover { background: #e7f0fd; color: #1877f2; }

/* Tag panel */
.msn-uc-tag-results { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.msn-uc-tag-person {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: none; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 14px; font-family: inherit; text-align: left;
  transition: background .15s;
}
.msn-uc-tag-person:hover { background: #e7f0fd; }
.msn-uc-tchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msn-uc-tchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: #1877f2; color: #fff; font-size: 13px; font-weight: 700;
}
.msn-uc-tchip button { border: none; background: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 12px; }
.msn-uc-no-results { padding: 12px; color: #65676b; font-size: 14px; text-align: center; }

/* GIF grid */
.msn-uc-gif-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 5px;
  max-height: 240px; overflow-y: auto;
}
.msn-uc-gif-img {
  width: 100%; border-radius: 6px; cursor: pointer; aspect-ratio: 1; object-fit: cover;
  transition: transform .18s, opacity .18s;
}
.msn-uc-gif-img:hover { transform: scale(1.04); opacity: .9; }
.msn-uc-hint { grid-column:1/-1; color:#65676b; font-size:14px; text-align:center; padding:20px 0; }

/* Poll */
.msn-uc-pq {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-pq:focus { border-color: #1877f2; }
.msn-uc-popt {
  width: 100%; padding: 10px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none; margin-bottom: 6px;
  transition: border-color .15s; display: block;
}
.msn-uc-popt:focus { border-color: #1877f2; }
.msn-uc-padd {
  padding: 10px 16px; border: none; border-radius: 10px; background: #fff;
  color: #1877f2; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.msn-uc-padd:hover { background: #e7f0fd; }
.msn-uc-pdur { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: #65676b; }
.msn-uc-pdur select { border: 1.5px solid #e4e6ea; border-radius: 8px; padding: 6px 10px; font-size: 14px; outline: none; background: #fff; }

/* Live */
.msn-uc-livecam {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9; margin-bottom: 12px;
}
#msn-uc-live-vid { width: 100%; height: 100%; object-fit: cover; }
.msn-uc-livebadge {
  position: absolute; top: 12px; left: 12px;
  background: #f40002; color: #fff; font-size: 11px; font-weight: 900;
  border-radius: 6px; padding: 4px 10px;
  display: flex; align-items: center; gap: 5px; letter-spacing: .08em;
}
.msn-uc-livebadge span {
  width: 7px; height: 7px; background: #fff; border-radius: 50%;
  animation: liveblink 1.2s ease-in-out infinite;
}
@keyframes liveblink { 0%,100%{opacity:1;} 50%{opacity:.2;} }
.msn-uc-livetitle {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e4e6ea; border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; margin-bottom: 10px;
  transition: border-color .15s;
}
.msn-uc-livetitle:focus { border-color: #f40002; }
.msn-uc-livechecks { display: flex; gap: 16px; margin-bottom: 12px; }
.msn-uc-livechecks label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #65676b; cursor: pointer; }
.msn-uc-golivebtn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #f40002; color: #fff; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.msn-uc-golivebtn:hover { background: #d50002; }
.msn-uc-golivebtn svg { width: 14px; height: 14px; fill: #fff; animation: liveblink 1.2s ease-in-out infinite; }

/* ── TOOLBAR ── */
.msn-uc-toolbar {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #e4e6ea; border-radius: 12px;
  padding: 10px 14px; margin: 10px 0 8px;
}
.msn-uc-toolbar-label { font-size: 14px; font-weight: 700; color: #050505; flex-shrink: 0; }
.msn-uc-tools {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none; flex: 1;
}
.msn-uc-tools::-webkit-scrollbar { display: none; }
.msn-uc-tool {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 9px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s; flex-shrink: 0;
}
.msn-uc-tool:hover { background: #f0f2f5; transform: scale(1.06); }
.msn-uc-tool svg {
  width: 22px; height: 22px;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.msn-uc-tool > span:last-child { font-size: 10px; font-weight: 700; color: #65676b; }
.msn-gif-lbl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 22px; background: #0866ff; color: #fff;
  font-size: 10px; font-weight: 900; border-radius: 6px; letter-spacing: .06em;
}

/* ── SUBMIT ── */
.msn-uc-post-btn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #1877f2; color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit; letter-spacing: .01em;
  transition: background .15s, opacity .15s, transform .12s;
}
.msn-uc-post-btn:hover:not(:disabled) { background: #1565d8; transform: translateY(-1px); }
.msn-uc-post-btn:disabled { background: #e4e6ea; color: #bec3c9; cursor: not-allowed; transform: none; }
.msn-uc-status { min-height: 18px; font-size: 13px; color: #d32f2f; margin-top: 8px; text-align: center; }

/* ── MOBILE ── */
@media (max-width: 540px) {
  .msn-uc-modal { border-radius: 20px 20px 0 0; margin: auto 0 0; max-height: 95vh; }
  .msn-uc-backdrop { align-items: flex-end; padding: 0; }
  .msn-uc-toolbar-label { display: none; }
  .msn-uc-fgrid { grid-template-columns: repeat(3,1fr); }
  .msn-uc-gif-grid { grid-template-columns: repeat(2,1fr); }
  .msn-uc-shortcut > span { display: none; }
}
