/* assets/css/short.css
   Target:
   - Mobile: TANPA header (topbar hidden), layout full-bleed ala YouTube (no blank space),
            player nempel atas, tanpa rounded, bottom-nav tetap ada.
   - Desktop: tetap center + comments panel kanan + shift player saat komentar open.
   - Cocok dengan global.css: body padding-bottom footer global dimatikan khusus page-short.

   JS sets:
   --browser-b  : bottom browser toolbar height (Samsung Internet)
   --vvh        : 1% visual viewport height (px)
   --topbar-h   : header height (px)
*/

:root{
  --browser-b: 0px;
  --vvh: 1vh;
  --topbar-h: 0px;

  --bn-h: 64px;            /* bottom nav height */
  --accent: var(--accent, #ff3b3b);

  --card-radius: 18px;     /* desktop only */
  --card-shadow: 0 18px 60px rgba(0,0,0,.55);

  --shift-on-comments: 110px; /* desktop shift when comments open */
}

/* ===== Override global footer padding khusus shorts ===== */
body.page-short{
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 0 !important; /* global.css punya padding-bottom footer */
}
body.page-short .site-footer{ display:none !important; }

/* =========================================================
   MOBILE: HIDE HEADER (topbar) + FORCE topbar-h = 0
   (biar stage tidak "kepotong" karena JS sempat baca tinggi header)
========================================================= */
@media (max-width: 980px){
  body.page-short .topbar{ display:none !important; }
  :root{ --topbar-h: 0px !important; }
}

/* =========================================================
   Stage / Feed
========================================================= */
.short-main{ padding: 0; margin: 0; }

/* default (desktop): viewport - header */
.short-stage{
  position: relative;
  width: 100%;
  height: calc((var(--vvh) * 100) - var(--topbar-h, 0px));
  min-height: calc(100vh - var(--topbar-h, 0px));
}

/* mobile: fullscreen (header gone) */
@media (max-width: 980px){
  .short-stage{
    height: calc(var(--vvh) * 100);
    min-height: 100vh;
  }
}

.short-feed{
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;

  background: #000;

  /* Hide scrollbar but keep scroll */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.short-feed::-webkit-scrollbar{ width:0; height:0; }

.short-card{
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;

  /* MOBILE: jangan center (ini biang space) */
  display: block;
  padding: 0;
  background: #000;
}

/* =========================================================
   Desktop framing (tetap rapi)
========================================================= */
@media (min-width: 981px){
  .short-stage{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0;
    background: var(--bg);
  }

  .short-feed{
    width: min(560px, 92vw);
    height: 100%;
    background: transparent;
  }

  .short-card{
    display: grid;
    place-items: center;
    padding: 0;
    background: transparent;
  }
}

/* =========================================================
   Shell + shift when comments open (desktop)
========================================================= */
.yt-shell{
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform .22s ease;
  will-change: transform;
}

@media (min-width: 981px){
  body.is-comments-open .yt-shell{
    transform: translateX(calc(-1 * var(--shift-on-comments)));
  }
}

/* =========================================================
   PLAYER
   - Mobile: full-bleed (no rounded, no shadow), start from top, stop above bottom-nav
   - Desktop: card 9/16 with rounded + shadow
========================================================= */
.yt-player{
  position: relative;
  width: 100%;
  height: calc(100% - (var(--bn-h) + env(safe-area-inset-bottom) + var(--browser-b)));
  background: #000;
  overflow: hidden;

  /* MOBILE look: YouTube-like */
  border-radius: 0;
  box-shadow: none;
}

/* Desktop: keep card style */
@media (min-width: 981px){
  /* Desktop: restore proper framed shorts (no mobile calc, no full-bleed) */
  .yt-player{
    width: min(480px, 92vw);
    height: 100%;
    max-height: 100%;
    aspect-ratio: 9 / 16;

    /* important: override mobile full width/height rules */
    margin: 0 auto;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
  }

  /* Desktop: ensure feed is a frame box (not stretching weird) */
  .short-feed{
    width: min(560px, 92vw);
    height: 100%;
  }

  .short-card{
    display: grid;
    place-items: center;
    padding: 0;
  }

  /* Desktop: actions centered vertically like before */
  .yt-actions{
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }


  

  /* Desktop: meta sits at bottom inside card */
  .yt-meta{
    bottom: 12px;
  }
}

/* Center Play/Pause button */
.yt-player .yt-center-btn{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: 72px;
  height: 72px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: #fff;
  z-index: 8;

  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.yt-player.is-paused .yt-center-btn{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* =========================
   VOLUME UI (ALL SIZES)
   - icon kiri atas
   - bar horizontal di kanan icon
   - muncul saat .is-open (auto-hide via JS)
========================= */
.yt-volwrap{
  position: absolute;
  left: 10px;
  top: max(10px, env(safe-area-inset-top));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.yt-volbtn{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
}

.yt-volbtn .bi{
  font-size: 18px;
  line-height: 1;
}

/* panel slider default hidden */
.yt-volpanel{
  width: min(240px, 58vw);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

.yt-volwrap.is-open .yt-volpanel{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.yt-volrange{
  width: 100%;
  height: 24px;
  writing-mode: horizontal-tb;
  direction: ltr;
  -webkit-appearance: auto;
  appearance: auto;
}


.yt-center-btn .bi{
  font-size: 30px;
  line-height: 1;
}


/* Video */
.short-video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* YouTube feel: cover */
  background: #000;
}

/* If kamu tetap mau "zoom out / contain", ganti ke contain:
.short-video{ object-fit: contain; }
*/

/* readability gradient bottom */
.yt-player::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 42%;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  pointer-events:none;
  z-index: 2;
}

/* =========================================================
   Progress bar
========================================================= */
.yt-progress{
  position:absolute;
  left:0; right:0; bottom:0;
  height:3px;
  background: rgba(255,255,255,.22);
  z-index: 6;
}
.yt-progress-fill{
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* =========================================================
   Right actions (YouTube-ish)
========================================================= */
.yt-actions{
  position:absolute;
  right: 10px;
  bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + var(--browser-b) + 110px);
  z-index: 7;

  display: grid;
  gap: 14px;
}

@media (min-width: 981px){
  .yt-actions{
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

.yt-act{
  width: 56px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;

  display: grid;
  place-items: center;
  gap: 6px;

  padding: 4px 0;
  text-align: center;
}

.yt-act .bi{
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.55));
}
.yt-count,
.yt-label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,.95);
  text-shadow: 0 4px 10px rgba(0,0,0,.55);
}
.yt-act.is-on{ filter: drop-shadow(0 0 18px rgba(255,255,255,.18)); }

/* =========================================================
   Bottom-left meta (account + title/desc)
   - Mobile: tepat di atas bottom-nav
========================================================= */
.yt-meta{
  position:absolute;
  left: 12px;
  right: 96px;
  bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + var(--browser-b) + 12px);
  z-index: 7;
}

@media (min-width: 981px){
  .yt-meta{
    bottom: 12px;
  }
}

/* Account row */
.yt-account{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}

.yt-avatar{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  object-fit: cover;
}

.yt-accinfo{
  display:grid;
  gap:2px;
  min-width:0;
}

.yt-handle{
  font-weight:900;
  color:#fff;
  text-shadow: 0 4px 10px rgba(0,0,0,.55);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 240px;
}

.yt-subhint{
  font-size:12px;
  color: rgba(255,255,255,.72);
  text-shadow: 0 4px 10px rgba(0,0,0,.55);
}



/* Title + desc expandable */
.yt-caption{
  cursor:pointer;
  user-select:none;
}

.yt-title{
  font-weight:900;
  font-size:14px;
  line-height:1.25;
  color:#fff;
  text-shadow: 0 4px 10px rgba(0,0,0,.55);

  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.yt-desc{
  margin-top:4px;
  font-size:13px;
  line-height:1.35;
  color: rgba(255,255,255,.92);
  text-shadow: 0 4px 10px rgba(0,0,0,.55);

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* "… lainnya" default hidden, JS yang nyalain kalau overflow */
.yt-more{
  display: none;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,.82);
  text-shadow: 0 4px 10px rgba(0,0,0,.55);
}

/* saat open, tetap disembunyikan */
.yt-caption.is-open .yt-more{ display: none !important; }


/* =========================================================
   Bottom nav (MOBILE) — ini yang kamu bilang bug
   Pastikan rapi & selalu tampil di mobile, hilang di desktop.
========================================================= */
/* ===== Bottom nav (MOBILE) — refined + active indicator ===== */
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + var(--browser-b));
  height: var(--bn-h);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;

  display: grid;
  grid-template-columns: repeat(4, 1fr);

  background: rgba(16,16,18,.92);
  border-top: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bottom-nav .bn-item{
  position: relative;
  height: var(--bn-h);
  display: grid;
  place-items: center;
  gap: 6px;

  text-decoration: none;
  color: rgba(255,255,255,.70);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
}

.bottom-nav .bn-item .bn-ic{
  width: 18px;
  height: 18px;
  opacity: .92;
}

.bottom-nav .bn-item span{
  line-height: 1;
  transform: translateY(-1px);
}

/* ACTIVE state */
.bottom-nav .bn-item.active,
.bottom-nav .bn-item.is-active{
  color: #fff;
}

.bottom-nav .bn-item.active::before,
.bottom-nav .bn-item.is-active::before{
  content:"";
  position:absolute;
  top: 4px;
  left: 18%;
  right: 18%;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(255,59,59,.20);
}

/* Optional: icon a bit brighter when active */
.bottom-nav .bn-item.active .bn-ic,
.bottom-nav .bn-item.is-active .bn-ic{
  opacity: 1;
}

/* Desktop hide */
@media (min-width: 981px){
  .bottom-nav{ display:none !important; }
}


/* =========================================================
   Comments panel (tetap)
========================================================= */
.c-overlay[hidden]{ display:none !important; }
.c-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.35);
}
.c-panel{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 72vh;
  background: rgba(16,16,18,.96);
  border-top: 1px solid rgba(255,255,255,.10);
  border-radius: 16px 16px 0 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;

  display: grid;
  grid-template-rows: auto 1fr auto;
}
@media (min-width: 981px){
  .c-overlay{ background: rgba(0,0,0,.18); }
  .c-panel{
    top: var(--topbar-h, 0px);
    bottom: 0;
    right: 0;
    left: auto;

    width: 360px;
    max-height: calc(100vh - var(--topbar-h, 0px));
    border-radius: 16px 0 0 16px;
    border-left: 1px solid rgba(255,255,255,.10);
    border-top: none;
  }
}



/* ==============================
   DESKTOP FIX (HARD OVERRIDE)
   tempel PALING BAWAH file
============================== */
@media (min-width: 981px){
  /* pastikan stage & feed benar-benar jadi “frame area” */
  body.page-short .short-stage{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 0 !important;
    background: var(--bg) !important;
  }

  body.page-short .short-feed{
    width: min(560px, 92vw) !important;
    height: 100% !important;
    background: transparent !important;
  }

  body.page-short .short-card{
    display: grid !important;
    place-items: center !important;
    height: 100% !important;
    min-height: 100% !important;
    padding: 0 !important;
    background: transparent !important;
  }

  /* KUNCI kartu 9:16 (ini yang bikin desktop balik normal) */
  body.page-short .yt-player{
    width: auto !important;
    height: min(100%, calc((var(--vvh) * 100) - var(--topbar-h, 0px) - 28px)) !important;
    aspect-ratio: 9 / 16 !important;

    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
    overflow: hidden !important;
  }

  /* actions & meta desktop */
  body.page-short .yt-actions{
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }

  body.page-short .yt-meta{
    bottom: 12px !important;
  }

  /* Desktop: jangan terpengaruh bottom-nav mobile */
  body.page-short .bottom-nav{
    display: none !important;
  }
}










