/* =========================================================
   /assets/css/home-misc.css  (FULL - REVISED)
   - Toast
   - Login modal
   - Admin online list (desktop right widget)
   - Mobile topbar icon button
   - Mobile safe padding (bottom nav + toast)
   - liveChatPanel open/close
   - Missing small blocks from old inline style
   - FIX FINAL: Card header badges (Disematkan/Channel/Trending)
   ========================================================= */

/* === topbar icon button === */
.mtIconBtn{
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(11,18,38,.85);
  display:grid;
  place-items:center;
  cursor:pointer;
  flex:0 0 auto;
  position:relative;
}
.mtIconBtn svg{ width:18px; height:18px; opacity:.95; }

/* === toast === */
#toastWrap{
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 200000;
  display: none;
  max-width: min(520px, calc(100vw - 24px));
}
#toastWrap.show{ display:block; }

#toastBox{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.78);
  color:#fff;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
  box-shadow:0 18px 60px rgba(0,0,0,.55);
  text-align:center;
  line-height:1.35;
}
#toastBox.ok{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.14); }
#toastBox.err{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.14); }

/* === login modal === */
#loginModal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:99999;
  padding:16px;
}
.loginModalCard{
  max-width:420px;
  margin:10vh auto;
  padding:16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(11,18,38,.95);
  color:var(--text);
}
.loginModalTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.loginModalClose{
  padding:6px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}
.loginModalBtn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(58,160,255,.22);
  color:var(--text);
  cursor:pointer;
  font-weight:900;
}

/* === admin online list (desktop right widget) === */
.onlineList{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.onlineItem{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.12);
}
.onlineLeft{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.onlineAv{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  object-fit:cover;
  background:rgba(58,160,255,.14);
  flex:0 0 auto;
}
.onlineFallback{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(58,160,255,.14);
  display:grid;
  place-items:center;
  font-weight:900;
  color:#fff;
  flex:0 0 auto;
}
.onlineName{
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dotGreen{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.12);
  flex:0 0 auto;
  margin-top:4px;
}
.dotRed{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#ef4444;
  box-shadow:0 0 0 3px rgba(239,68,68,.12);
  flex:0 0 auto;
  margin-top:4px;
}
.adminStatusTxt{
  margin-top:6px;
  color:rgba(168,179,207,.92);
  font-size:12px;
  line-height:1.35;
}

/* === live chat panel open/close === */
#liveChatPanel{ display:none; }
#liveChatPanel.open{ display:block; }

/* =========================
   Missing small blocks from old inline style
   ========================= */

/* meta title byline (oleh admin) */
.metaTitle .by{
  margin-top:4px;
  font-size:12px;
  color:rgba(168,179,207,.92);
  line-height:1.25;
}

/* kecilkan dot admin online di tombol bell topbar */
#badgeAdminOnline{
  top:6px !important;
  right:6px !important;
  min-width:10px !important;
  height:10px !important;
  padding:0 !important;
  border-radius:50% !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18) !important;
  border:0 !important;
  font-size:0 !important;
  line-height:0 !important;
}

/* =========================
   FIX FINAL: badges di header card (paksa jadi pill rapi)
   - Menghindari override dari CSS lain
   ========================= */
.card .cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.card .cardHead .metaLeft{
  display:flex;
  gap:10px;
  min-width:0;
  flex:1;
}

.card .cardHead .badges{
  margin-left:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  flex:0 0 auto !important;
}

.card .cardHead .badges .badge{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:6px 10px !important;
  height:auto !important;
  line-height:1 !important;
  border-radius:999px !important;
  font-size:12px !important;
  white-space:nowrap !important;
  border:1px solid var(--border) !important;
  background: rgba(255,255,255,.04) !important;
  color: var(--muted) !important;
}

.card .cardHead .badges .badge.pin{
  color:#ffe08a !important;
  border-color: rgba(255,224,138,.25) !important;
  background: rgba(255,224,138,.08) !important;
}

/* =========================
   MOBILE safe padding + topbar spacing
   ========================= */
@media (max-width: 760px){
  /* bottom nav safe */
  .twViewportScroll{
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    padding-top: 78px !important; /* konten turun agar tidak ketiban topbar */
  }
  body{
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
  #toastWrap{
    bottom: 120px;
  }
}
