/* =========================
 * Inline Copy Button — CSS
 * ========================= */

/* ---- Wrapper ---- */
.icb-wrap{
  --icb-bar-bg: rgba(0,0,0,.04);
  --icb-bar-border: rgba(0,0,0,.08);
  --icb-lang-cl: #888;
  --icb-btn-bg: transparent;
  --icb-btn-cl: #666;
  --icb-btn-hover-bg: rgba(0,0,0,.06);
  --icb-btn-copied-bg: rgba(46,125,50,.12);
  --icb-btn-copied-cl: #2e7d32;
  --icb-radius: 8px;

  position:relative;
  border-radius:var(--icb-radius);
  overflow:hidden;
  margin:16px 0;
}

/* ---- Dark Mode ---- */
.icb-wrap[data-icb-theme="dark"],
body.pcdark-mode .icb-wrap,
body.pcdm-enable.pcdark-mode .icb-wrap,
body.dark-mode .icb-wrap,
body.dark .icb-wrap,
html[data-theme="dark"] .icb-wrap{
  --icb-bar-bg: rgba(255,255,255,.06);
  --icb-bar-border: rgba(255,255,255,.08);
  --icb-lang-cl: #8892a4;
  --icb-btn-bg: transparent;
  --icb-btn-cl: #aab4c6;
  --icb-btn-hover-bg: rgba(255,255,255,.08);
  --icb-btn-copied-bg: rgba(46,125,50,.2);
  --icb-btn-copied-cl: #81c784;
}

/* ---- Bar (language + button) ---- */
.icb__bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 12px;
  background:var(--icb-bar-bg);
  border-bottom:1px solid var(--icb-bar-border);
}

/* ---- Language label ---- */
.icb__lang{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--icb-lang-cl);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Copy Button ---- */
.icb__btn{
  appearance:none;
  border:none;
  background:var(--icb-btn-bg);
  color:var(--icb-btn-cl);
  padding:4px 10px;
  border-radius:6px;
  font-size:12px;
  font-weight:500;
  cursor:pointer;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:5px;
  line-height:1.4;
  transition: background .15s ease, color .15s ease;
  font-family:inherit;
}

.icb__btn:hover{
  background:var(--icb-btn-hover-bg);
}

.icb__btn--copied{
  background:var(--icb-btn-copied-bg) !important;
  color:var(--icb-btn-copied-cl) !important;
}

/* ---- Icons ---- */
.icb__icon{
  width:14px;
  height:14px;
  flex-shrink:0;
}

.icb__icon--check{
  display:none;
}

.icb__btn--copied .icb__icon--copy{
  display:none;
}

.icb__btn--copied .icb__icon--check{
  display:inline-block;
}

.icb__label{
  pointer-events:none;
}

/* ---- Content protector bypass ---- */
.icb-wrap pre,
.icb-wrap pre *,
.icb-wrap code,
.icb-wrap code *{
  -webkit-user-select:text !important;
  -moz-user-select:text !important;
  -ms-user-select:text !important;
  user-select:text !important;
}

/* Make sure pre/code fills the wrapper nicely */
.icb-wrap pre{
  margin:0 !important;
  border-radius:0 !important;
  border:none !important;
}

/* ---- Print: hide button ---- */
@media print{
  .icb__bar{
    display:none;
  }
}
