/* ---------------------------------------------------------------------------
   AllInOneMonitor - Website, server & infrastructure monitoring
   Author: MD OMAR FARUK | www.faruk.bd | Copyright (c) 2026
   --------------------------------------------------------------------------- */
/* AllInOneMonitor - /docs extras: share bar, "Was this helpful?" and the Admin -> Docs feedback report.
   Loaded only on the docs pages and that admin page; everything follows the app.css variables (light/dark). */

.docx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.docx-share [hidden], .dfb [hidden] { display: none !important; }

/* ---------------------------------------------------------------- top row */
.docx-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: -6px 0 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); min-width: 0; }
.docx-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.docx-crumb a { color: var(--accent); font-weight: 600; }
.docx-crumb span[aria-hidden] { opacity: .5; }

/* ------------------------------------------------------------ share buttons */
.docx-share { min-width: 0; }
.docx-share-b { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.sh { --sh: var(--accent); --sh-ink: #fff; position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: none; transition: background-color .18s, color .18s, transform .18s, box-shadow .18s; }
.sh:hover, .sh:focus-visible { background: var(--sh); color: var(--sh-ink); text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 14px -6px var(--sh); }
.sh:focus-visible { outline: 2px solid var(--sh); outline-offset: 2px; }
.sh:active { transform: translateY(0) scale(.94); }
.sh .sh-ic { display: block; flex: none; }
.sh-x { --sh: #0f1419; } .sh-facebook { --sh: #1877f2; } .sh-linkedin { --sh: #0a66c2; } .sh-whatsapp { --sh: #1fa855; } .sh-telegram { --sh: #229ed9; } .sh-reddit { --sh: #ff4500; }
[data-theme="dark"] .sh-x { --sh: #e7e9ea; --sh-ink: #0f1419; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .sh-x { --sh: #e7e9ea; --sh-ink: #0f1419; } }

/* the compact dock at the top right of the article */
.docx-share.is-top { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 3px 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.docx-share-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.is-top .sh-more { display: none; }
.is-top .sh-native .sh-n { display: none; }
.sh-tip { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 4px 9px; border-radius: 7px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 5; }
.sh-tip::before { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.sh-copy.is-copied { background: var(--accent); color: #fff; }
.sh-copy.is-copied .sh-tip { display: block; animation: docx-tip .22s ease-out; }
@keyframes docx-tip { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------- the end of the article */
.docx-end { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; margin-top: 40px; align-items: stretch; }

/* share card */
.docx-share.is-bottom { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.docx-share-h { display: flex; flex-direction: column; gap: 2px; }
.docx-share-t { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.docx-share-t .sh-ic { color: var(--accent); }
.docx-link { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--line-2); }
.docx-link-u { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); overflow-wrap: normal; }
.docx-copy-l { flex: none; display: inline-flex; align-items: center; padding: 7px 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .18s, transform .18s; }
.docx-copy-l:hover { filter: brightness(1.06); }
.docx-copy-l:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docx-copy-l .sh-cp-a, .docx-copy-l .sh-cp-b { display: inline-flex; align-items: center; gap: 6px; }
.docx-copy-l .sh-cp-b { display: none; }
.docx-copy-l.is-copied { background: var(--green); animation: docx-pop .35s ease-out; }
.docx-copy-l.is-copied .sh-cp-a { display: none; }
.docx-copy-l.is-copied .sh-cp-b { display: inline-flex; }
.docx-copy-l .sh-ic { width: 16px; height: 16px; }
.is-bottom .docx-share-b { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.is-bottom .sh { display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: auto; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.is-bottom .sh .sh-ic { color: var(--sh); transition: color .18s; }
.is-bottom .sh:hover .sh-ic, .is-bottom .sh:focus-visible .sh-ic { color: inherit; }
.is-bottom .sh-n { overflow: hidden; text-overflow: ellipsis; }
.is-bottom .sh-native { grid-column: 1 / -1; justify-content: center; background: var(--accent); color: #fff; border-color: var(--accent); }
.is-bottom .sh-native .sh-ic { color: #fff; }
@keyframes docx-pop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* ------------------------------------------------- "Was this page helpful?" */
.dfb { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--accent-soft), transparent 120px), var(--card); }
.dfb-q { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.dfb-sub { margin: 4px 0 14px !important; font-size: 13.5px; color: var(--muted); }
.dfb-faces { display: flex; gap: 8px; }
.dfb-face { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink-2); font: inherit; cursor: pointer; transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), border-color .18s, box-shadow .18s, background-color .18s, opacity .25s, filter .25s; }
.dfb-e { display: block; font-size: 28px; line-height: 1; transition: transform .28s cubic-bezier(.34, 1.56, .64, 1); font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.dfb-l { font-size: 11.5px; font-weight: 600; line-height: 1.15; text-align: center; }
.dfb-face:not(:disabled):hover, .dfb-face:not(:disabled):focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 18px -10px var(--accent); }
.dfb-face:not(:disabled):hover .dfb-e, .dfb-face:not(:disabled):focus-visible .dfb-e { transform: scale(1.2) rotate(-8deg); }
.dfb-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dfb-face:disabled { cursor: default; }
.dfb-face.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); opacity: 1; filter: none; }
.dfb-face.on .dfb-e { animation: dfb-pop .55s cubic-bezier(.34, 1.56, .64, 1); }
.dfb.is-done .dfb-face:not(.on), .dfb.is-busy .dfb-face:not(.on) { opacity: .42; filter: grayscale(1); }
.dfb-burst { position: absolute; left: 50%; top: 4px; font-size: 22px; line-height: 1; pointer-events: none; animation: dfb-burst .9s ease-out forwards; }
@keyframes dfb-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45) rotate(8deg); } 65% { transform: scale(.92); } 100% { transform: scale(1.12); } }
@keyframes dfb-burst { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -44px) scale(1.3); } }
.dfb-more { margin-top: 14px; animation: dfb-in .25s ease-out; }
.dfb-more label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }
.dfb-more textarea { display: block; width: 100%; box-sizing: border-box; min-height: 74px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; resize: vertical; }
.dfb-more textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dfb-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dfb-btns { display: flex; gap: 6px; }
.dfb-count { font-size: 12px; }
.dfb-count.is-near { color: var(--yellow); }
.dfb-stat { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.dfb-meter { flex: 0 0 84px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.dfb-meter i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .5s ease; }
.dfb-msg { margin: 10px 0 0 !important; font-size: 13px; color: var(--accent); font-weight: 600; }
.dfb-msg:empty { display: none; }
.dfb-msg.is-err { color: var(--red); }
@keyframes dfb-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .docx-share.is-top { padding: 3px; }
  .docx-share-lbl { display: none; }
  .is-top .sh:not(.sh-copy):not(.sh-native):not(.sh-more) { display: none; }
  .is-top .sh-more { display: inline-grid; }
  .dfb, .docx-share.is-bottom { padding: 14px; }
  .dfb-faces { gap: 5px; }
  .dfb-face { padding: 9px 2px 7px; border-radius: 12px; }
  .dfb-e { font-size: 24px; }
  .dfb-l { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .docx-share *, .dfb, .dfb * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------- Admin -> Website -> Docs feedback */
.dfba-bar { display: flex; height: 8px; min-width: 120px; border-radius: 6px; overflow: hidden; background: var(--line); }
.dfba-bar i { display: block; height: 100%; }
.dfba-love { background: #059669; } .dfba-helpful { background: #34d399; } .dfba-okay { background: #fbbf24; } .dfba-confusing { background: #f97316; } .dfba-unhelpful { background: #ef4444; }
.dfba-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.dfba-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dfba-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.dfba-pct { font-weight: 700; }
.dfba-pct.good { color: var(--green); } .dfba-pct.mid { color: var(--yellow); } .dfba-pct.bad { color: var(--red); }
.dfba-com { list-style: none; margin: 0; padding: 0; }
.dfba-com li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.dfba-com li:first-child { border-top: 0; }
.dfba-com .e { flex: none; font-size: 22px; line-height: 1.2; }
.dfba-com .b { flex: 1 1 auto; min-width: 0; }
.dfba-com p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dfba-com .act { flex: none; }

/* the prev/next pager under the feedback: two long titles wrap instead of running past the card on phones */
.doc-pager { flex-wrap: wrap; }
.doc-pager .btn { max-width: 100%; white-space: normal; text-align: left; }
.doc-pager .btn:last-child { margin-left: auto; text-align: right; }
