/* Container & Grid */
.tsvh-hub-container {
  padding: 20px 0;
}
.tsvh-grid {
  display: grid;
  gap: 25px;
  width: 100%;
}
.tsvh-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.tsvh-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.tsvh-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
  .tsvh-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Header & Nav */
.tsvh-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 25px;
  padding: 0 5px;
}
.tsvh-section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 !important;
}
.tsvh-nav-controls {
  display: flex !important;
  gap: 10px;
}
.tsvh-nav-btn {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  color: #00266B;
  background: #fff !important;
  border: 2px solid #00266b !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
.tsvh-nav-btn:hover:not(:disabled) {
  background: #00266b !important;
  color: #fff !important;
  border-color: #00266b !important;
}
.tsvh-nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Pagination Logic */
.tsvh-grid-page {
  display: none !important;
  width: 100%;
  animation: fadeIn 0.5s;
}
.tsvh-grid-page.active {
  display: block !important;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Card Styling */
.tsvh-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
}
.tsvh-video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.tsvh-main-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.tsvh-card:hover .tsvh-main-thumb {
  transform: scale(1.05);
}

/* Play Icon */
.tsvh-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tsvh-play-icon {
  width: 50px;
  height: 50px;
  background: #00266b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tsvh-play-icon::after {
  content: "";
  border-width: 8px 0 8px 14px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

/* User Info & Icons (IMG URL) */
.tsvh-user-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}
.tsvh-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}
.tsvh-handle-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.tsvh-handle {
  font-size: 13px;
  color: #888;
}
.tsvh-avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}
.tsvh-platform-icon-img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

/* =======================================================
   MODAL POPUP - HYBRID MODE (Final Solution)
   ======================================================= */

#tsvh-modal {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483647 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Style Dasar Modal Content */
.tsvh-modal-content {
  position: relative !important;
  background: #000 !important;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin: auto !important;
}

/* --- MODE 1: MOBILE (FB, TikTok, IG) --- 
   Gaya seperti HP: Ramping, Tinggi, dan BISA DI-SCROLL
*/
#tsvh-modal[data-mode="mobile"] {
  align-items: flex-start !important; /* Mulai dari atas */
  padding-top: 40px;
  padding-bottom: 40px;
  overflow-y: auto !important; /* Izinkan scroll layar utama */
}
#tsvh-modal[data-mode="mobile"] .tsvh-modal-content {
  width: 450px !important; /* Lebar ala HP */
  max-width: 90vw !important;
  height: auto !important; /* Tinggi ngikutin isinya */
  min-height: 300px !important;
  overflow: hidden; /* Wrapper gak boleh scroll, biar body yg scroll */
}
#tsvh-modal[data-mode="mobile"] iframe {
  width: 100% !important;
  height: 850px !important; /* PAKSA TINGGI BANGET biar video FB gak kepotong */
}

/* --- MODE 2: DESKTOP (YouTube, Twitter) --- 
   Gaya seperti TV: Lebar, Landscape, Fix di tengah
*/
#tsvh-modal[data-mode="desktop"] .tsvh-modal-content {
  width: 80vw !important;
  max-width: 1000px !important;
  aspect-ratio: 16/9 !important; /* Kunci rasio TV */
  height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
}
#tsvh-modal[data-mode="desktop"] iframe {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* WRAPPER UMUM */
#tsvh-video-wrapper {
  width: 100% !important;
  height: 100% !important;
}

/* TOMBOL CLOSE */
.tsvh-modal-close {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 35px;
  font-size: 30px !important;
  cursor: pointer !important;
  z-index: 2147483649 !important;
  transition: 0.3s;
}
.tsvh-modal-close:hover {
  background: red;
}
.tsvh-no-scroll {
  overflow: hidden !important;
}
