/* ===============================
   Short Video Sort Tabs (Segmented Box)
=============================== */

/* กล่องครอบ */
.sort-tabs{
  display: inline-flex;      /* ให้กว้างเท่าที่จำเป็น */
  align-items: center;
  gap: 0;                    /* ไม่ให้มีช่องว่างระหว่างปุ่ม */
  padding: 3px;
  border: 2px solid #6d3076;
  border-radius: 10px;
  background: #eef0f4;
}

/* ปุ่มแต่ละอัน */
.sort-tabs .sort-tab{
  border: 0;
  background: transparent;
  color: #6d3076;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 8px;        /* ให้ active เป็น pill ได้ */
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

/* เส้นแบ่งกลาง (ทำให้เหมือนในรูป) */
.sort-tabs .sort-tab + .sort-tab{
  position: relative;
}
.sort-tabs .sort-tab + .sort-tab:before{
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(111,45,189,.35);
}

/* hover */
.sort-tabs .sort-tab:hover{
  background: rgba(111,45,189,.08);
}

/* active */
.sort-tabs .sort-tab.active{
  background: #6d3076;
  color: #fff;
}

.short-video-search__select,
.short-video-search__btn{
  width: 100%;
}

@media (min-width: 992px){
  .short-video-toolbar{
    justify-content: space-between;
  }

  .short-video-toolbar .short-video-search{
    width: 760px;
    margin-left: auto;
  }
}

@media (min-width: 768px){
  .short-video-search__select,
  .short-video-search__btn{
    width: auto;
  }

  #searchVDOInput{
    min-width: 360px;
    flex: 1 1 auto;
  }
}

.video-main-tabs{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.video-main-tabs .btn{
  border-radius: 8px !important;
}

@media (min-width: 992px){
  .video-main-tabs{
    margin-right: 0;
  }
}

@media (max-width: 575.98px){
  .video-main-tabs{
    width: 100%;
  }

  .video-main-tabs .btn{
    flex: 1 1 30%;
    margin: 0;
    font-size: 13px;
    padding: 6px 8px;
  }

  .video-main-tabs .btn + .btn{
    margin-left: 0;
  }

  #searchInputWrapper .form-control{
    font-size: 14px;
  }

  #searchInputWrapper .btn{
    padding: 6px 10px;
  }
}

.short-video2-page .short-video-toolbar .short-video-search__select,
.short-video2-page .short-video-toolbar .short-video-search__input {
  width: 100%;
}

@media (min-width: 768px) {
  .short-video2-page .short-video-toolbar .short-video-search__select {
    min-width: 240px;
    max-width: 360px;
  }

  .short-video2-page .short-video-toolbar .short-video-search__input {
    min-width: 260px;
    max-width: 420px;
  }
}

.video2-page .video2-toolbar .video2-search-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.video2-page .video2-toolbar #selectWrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video2-page .video2-toolbar #searchInputWrapper .short-video-search {
  width: 100%;
}

@media (min-width: 768px) {
  .video2-page .video2-toolbar .video2-search-row {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
  }

  .video2-page .video2-toolbar #selectWrapper {
    flex-direction: row;
    align-items: center;
  }

  .video2-page .video2-toolbar #selectWrapper .short-video-search__select {
    width: 240px;
  }

  .video2-page .video2-toolbar #searchInputWrapper .short-video-search__input {
    width: 320px;
  }
}

@media (min-width: 992px) {
  .video2-page .video2-toolbar #searchInputWrapper {
    min-width: 420px;
  }
}
.thumb-9x16{
  position: relative;
  width: 100%;
  padding-top: 147%;
  overflow: hidden;
  background: #000; /* ใช้พื้นหลัง (จะถูกแทนด้วย blur layer) */
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

/* รูปหลัก */
.thumb-9x16 img.thumb-main{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-position: center;
}

/* โหมดแนวตั้ง: เต็มกรอบ */
.thumb-9x16.is-portrait img.thumb-main{
  object-fit: cover;
}

/* โหมดแนวนอน: ไม่ครอป */
.thumb-9x16.is-landscape img.thumb-main{
  object-fit: contain;
}

/* พื้นหลังเบลอ (ใช้รูปเดียวกัน) */
.thumb-9x16 .thumb-blur{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(16px);
  transform: scale(1.2);
  opacity: .55;
}

/* ให้รูปหลักอยู่บน blur */
.thumb-9x16 img.thumb-main{
  z-index: 2;
}
.thumb-9x16 .thumb-blur{
  z-index: 1;
}

.short-video-card .card-body{
  padding: 6px 6px 8px;
}

.short-video-card .card-text{
  font-size: 13px;
  line-height: 1.25;
}

.short-video-card .text-warning{
  font-size: 12px;
}

.short-video-detail .short-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
}

.short-video-detail .short-video-badge {
  height: 38px;
  width: 119px;
}

.short-video-detail .video-detail-wrap {
  max-height: 6.5rem;
  overflow: hidden;
}

.short-video-detail .video-detail-wrap.expanded {
  max-height: 12rem;
  overflow-y: auto;
}

@media (max-width: 991.98px) {
  .short-video-detail .video-detail-wrap {
    max-height: none;
    overflow: visible;
  }

  .short-video-detail .video-detail-wrap.expanded {
    max-height: none;
    overflow: visible;
  }
}
