/* assets/css/short.css */

:root{
  --header-h: 0px;

  /* Ukuran frame Shorts (auto di semua layar) */
  --short-w: clamp(320px, 30vw, 460px); /* kecil–sedang–besar */
  --short-aspect: 9 / 16;               /* Shorts/TikTok */
}



/* Body dikunci (biar gak ada double scroll) */
body.page-short{
  overflow: hidden;
  padding-bottom: 0 !important;
}

/* Main: 1 layar penuh dikurangi tinggi header */
.short-stage{
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  padding: 8px 0 calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Feed scroll area */
.short-feed{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;

  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;

  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.short-feed::-webkit-scrollbar{
  width: 0;
   height: 0;
}

/* 1 card = 1 layar feed */
.short-card{
  scroll-snap-align: start;
  scroll-snap-stop: always;

  /* card ikut tinggi feed, bukan ikut viewport lagi */
  height: 100%;
  min-height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}


/* Layout video + action */
.short-shell{
  width: 100%;
  height: 100%;
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 18px;

  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Phone frame */
/* Phone frame (auto-fit viewport, recommended Shorts/TikTok 9:16) */
.short-media{
  position: relative;
  margin: 0 auto;

  /* target lebar ideal */
  --short-w: clamp(320px, 30vw, 460px);

  /* batas tinggi frame supaya gak “kebawah” */
  --short-max-h: calc(100% - 16px);


  /* width dibatasi juga oleh tinggi layar (pakai rasio 9:16 => width = height * 9/16) */
  width: min(
    var(--short-w),
    92vw,
    calc(var(--short-max-h) * 9 / 16)
  );

  aspect-ratio: 9 / 16;
  

  max-height: var(--short-max-h);

  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);

  /* fallback background kalau video gagal */
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(135deg, rgba(255,59,59,.14), rgba(255,139,61,.10)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}



/* Dummy backgrounds per short */
.short-bg-1{
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(135deg, rgba(255,59,59,.18), rgba(255,139,61,.12)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}
.short-bg-2{
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(135deg, rgba(27,102,209,.18), rgba(255,59,59,.10)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}
.short-bg-3{
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(135deg, rgba(0,220,130,.14), rgba(255,59,59,.08)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}
.short-bg-4{
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(135deg, rgba(160,90,255,.16), rgba(255,139,61,.10)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}

/* Bottom title only */
.short-ui-bottom{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));

  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.35) 35%, rgba(0,0,0,.72) 100%);
  z-index: 2;
}
.short-title{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
  margin: 0;
  color: #fff;
  text-shadow: 0 10px 24px rgba(0,0,0,.55);
}

/* Actions */
.short-actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
  padding-right: 6px;
}

.sact{
  height: 68px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(20,20,22,.68);
  box-shadow: 0 12px 24px rgba(0,0,0,.45);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  user-select: none;
}
.sact:hover{
  transform: translateY(-1px);
  background: rgba(26,26,29,.78);
  border-color: rgba(255,255,255,.18);
}
.sact:active{
  transform: translateY(0px) scale(.98);
}
.sact i{
  font-size: 18px;
  line-height: 1;
}
.sact span{
  font-size: 12px;
  font-weight: 900;
  color: #e9e9ea;
}

/* Responsive */
@media (max-width: 980px){
  .short-shell{
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px 0;
  }
  .short-actions{
    flex-direction: row;
    justify-content: center;
    padding-right: 0;
  }
  .sact{
    width: 78px;
    height: 64px;
  }
}

/* =========================
   REAL SHORTS (video + states)
   ========================= */

/* Video fill the phone frame */
.short-media video.short-video{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;   /* memenuhi frame 9:16, aman untuk Shorts */
  object-position: 50% 30%;
}


/* Fallback kalau poster/video gagal: tetap kelihatan “ada isi” */
.short-media{
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(135deg, rgba(255,59,59,.14), rgba(255,139,61,.10)),
    linear-gradient(180deg, #2a2a2f, #1b1b1f);
}

/* Loader di dalam feed */
.short-loading{
  height: 100%;
  min-height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  color: var(--muted2);
  font-weight: 900;
}
.short-loading .spinner{
  width:18px;height:18px;border-radius:999px;
  border:2px solid rgba(255,255,255,.18);
  border-top-color: rgba(255,255,255,.85);
  animation: tsSpin .8s linear infinite;
}
@keyframes tsSpin{ to{ transform: rotate(360deg);} }

/* State tombol (like/dislike aktif) */
.sact.is-on{
  border-color: rgba(255,59,59,.35);
  background: rgba(255,59,59,.10);
}
.sact.is-on i,
.sact.is-on span{
  color: #fff;
}

/* =========================
   COMMENTS MODAL (short.html)
   ========================= */
.c-overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.c-overlay[hidden]{ display:none !important; }

.c-panel{
  width: min(680px, calc(100vw - 20px));
  max-height: min(80vh, 720px);
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  box-shadow: var(--shadow2);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.c-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.c-title{ font-weight: 900; }
.c-close{
  width:36px; height:36px; border-radius: 12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  cursor:pointer;
}
.c-close:hover{ background: rgba(255,255,255,.06); }

.c-list{
  padding: 12px 14px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.c-item{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 10px 12px;
}
.c-meta{
  display:flex; gap:10px; align-items:baseline;
  color: var(--muted2);
  font-weight: 900;
  font-size: 12px;
}
.c-body{
  margin-top:6px;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
}

.c-form{
  display:flex;
  gap:10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.c-name,.c-text{
  height:40px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding: 0 12px;
  outline:none;
}
.c-name{ width: 160px; }
.c-text{ flex: 1 1 auto; }

.c-send{
  height:40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--accent);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}
.c-send:hover{ filter: brightness(1.05); }

.vol-btn{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.40);
  color: #fff;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  backdrop-filter: blur(6px);
}
.vol-btn:hover{ background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.18); }


/* Volume panel */
.vol-panel{
  position:absolute;
  top: 58px;           /* turun sedikit dari tombol volume */
  right: 10px;
  z-index: 4;

  width: 170px;
  padding: 10px 10px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);

  display:flex;
  align-items:center;
  gap:10px;
}

.vol-range{
  flex: 1 1 auto;
  accent-color: var(--accent);
}

.vol-val{
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  min-width: 40px;
  text-align: right;
}

/* tombol volume harus bisa diklik dan di atas video */
.vol-btn{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}






