/* ============================================
   RESET & VARIABLES
============================================ */
:root {
  --teal:        #0d9488;
  --teal-dark:   #0f766e;
  --teal-light:  #14b8a6;
  --teal-pale:   #ccfbf1;
  --teal-bg:     #f0fdfa;
  --white:       #ffffff;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #94a3b8;
  --gray-500:    #64748b;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1e293b;
  --gray-900:    #0f172a;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:      0 4px 16px rgba(13,148,136,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 8px 24px rgba(13,148,136,0.14), 0 2px 8px rgba(0,0,0,0.07);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   6px;
  --transition:  all 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--teal-light); border-radius: 4px; }

/* ============================================
   HEADER
============================================ */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal-dark);
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--teal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--gray-700);
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.header-search input::placeholder { color: var(--gray-400); }

.search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.82rem;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.h-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.h-btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.h-btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.h-btn-teal {
  background: var(--teal);
  color: white;
}
.h-btn-teal:hover { background: var(--teal-dark); }

/* ============================================
   HERO
============================================ */
.hero {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 55%, var(--teal-light) 100%);
  padding: 44px 24px 40px;
  color: white;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.hero p {
  font-size: 0.9rem;
  opacity: 0.82;
  max-width: 460px;
  margin: 0 auto 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}

.hstat { text-align: center; }
.hstat-n { font-size: 1.5rem; font-weight: 800; display: block; }
.hstat-l { font-size: 0.72rem; opacity: 0.72; margin-top: 1px; }

/* ============================================
   MAIN
============================================ */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

/* ============================================
   CATEGORY TABS
============================================ */
.tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.cat-tab .t-icon { font-size: 0.85rem; line-height: 1; width: 16px; text-align: center; }

.cat-tab .t-count {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 1px 6px;
  border-radius: 50px;
}

.cat-tab:hover {
  border-color: var(--teal-light);
  color: var(--teal-dark);
  background: var(--teal-bg);
}

.cat-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  box-shadow: 0 3px 10px rgba(13,148,136,0.3);
}

.cat-tab.active .t-count {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* ============================================
   SECTION BAR
============================================ */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-left { display: flex; align-items: center; gap: 10px; }

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gray-800);
}

.section-count {
  font-size: 0.72rem;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 3px 10px;
  border-radius: 50px;
  font-weight: 600;
}

.section-right { display: flex; align-items: center; gap: 8px; }

.sort-sel {
  padding: 6px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xs);
  background: var(--white);
  color: var(--gray-600);
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.sort-sel:focus { border-color: var(--teal); }

.view-grp { display: flex; gap: 2px; background: var(--gray-100); border-radius: 6px; padding: 3px; }

.vbtn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}
.vbtn.active { background: white; color: var(--teal); box-shadow: var(--shadow-sm); }

/* ============================================
   VIDEO GRID
============================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 18px;
}

.video-grid.list { grid-template-columns: 1fr; }

/* ============================================
   VIDEO CARD
============================================ */
.vcard {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.vcard:hover {
  border-color: var(--teal-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.vcard-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--gray-100);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  transition: transform 0.3s;
}

.vcard:hover .thumb-bg { transform: scale(1.06); }

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,148,136,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.vcard:hover .thumb-overlay { opacity: 1; }

.play-btn {
  width: 44px;
  height: 44px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  padding-left: 2px; /* optical center for play icon */
  box-shadow: 0 4px 14px rgba(13,148,136,0.5);
  transform: scale(0.85);
  transition: transform 0.2s;
}

.vcard:hover .play-btn { transform: scale(1); }

.thumb-duration {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: rgba(15,23,42,0.72);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.thumb-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.3px;
}

.badge-new  { background: var(--teal);   color: white; }
.badge-hot  { background: #f59e0b;       color: white; }
.badge-free { background: #10b981;       color: white; }

.vcard-body {
  padding: 13px 15px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vcard-cat {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
  margin-bottom: 4px;
}

.vcard-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vcard-desc {
  font-size: 0.76rem;
  color: var(--gray-500);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}

.vcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
  gap: 8px;
}

.vcard-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.vm-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--gray-400);
}

.watch-btn {
  padding: 5px 13px;
  background: var(--teal-bg);
  border: 1.5px solid var(--teal-pale);
  border-radius: 50px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.watch-btn:hover { background: var(--teal); color: white; border-color: var(--teal); }

/* LIST VIEW */
.video-grid.list .vcard { flex-direction: row; }

.video-grid.list .vcard-thumb {
  width: 200px;
  aspect-ratio: auto;
  min-height: 120px;
  flex-shrink: 0;
}

/* EMPTY STATE */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-400);
}
.empty-state .ei { font-size: 2.8rem; margin-bottom: 10px; }
.empty-state h3 { font-size: 0.95rem; font-weight: 700; color: var(--gray-500); margin-bottom: 4px; }
.empty-state p { font-size: 0.82rem; }

/* ============================================
   TOAST
============================================ */
.toast-wrap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-800);
  color: white;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-left: 3px solid var(--teal);
  animation: slideUp 0.25s ease;
  min-width: 240px;
}
@keyframes slideUp { from { transform:translateY(12px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.toast-close { margin-left: auto; cursor: pointer; opacity: 0.55; font-size: 0.82rem; }
.toast-close:hover { opacity: 1; }

/* ============================================
   FOOTER
============================================ */
.footer {
  background: var(--gray-800);
  color: var(--gray-300);
  padding: 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.footer-text { font-size: 0.75rem; color: var(--gray-500); }

/* ============================================
   PLAYER PAGE
============================================ */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gray-400);
}
.breadcrumb a { color: var(--teal); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

.player-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* Player Box */
.player-box {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player-screen {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--gray-900);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-screen-emoji { font-size: 4rem; }
.p-screen-title { font-size: 0.9rem; font-weight: 600; color: var(--gray-300); text-align: center; padding: 0 40px; line-height: 1.5; }
.p-screen-sub { font-size: 0.75rem; color: var(--gray-500); }

/* Loading */
.p-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.82);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  z-index: 15;
}

.spin { width: 38px; height: 38px; border: 3px solid rgba(13,148,136,0.3); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-loading span { font-size: 0.78rem; color: var(--gray-400); }

/* Center play */
.p-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.player-screen.paused .p-center-play { opacity: 1; pointer-events: all; }

.bigplay {
  width: 64px;
  height: 64px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  padding-left: 3px; /* optical center play icon */
  cursor: pointer;
  box-shadow: 0 0 0 12px rgba(13,148,136,0.15);
  transition: transform 0.2s;
}
.bigplay:hover { transform: scale(1.08); }

/* Controls */
.p-controls { padding: 13px 18px; border-top: 1px solid var(--gray-100); }

.p-progress {
  height: 5px;
  background: var(--gray-200);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 11px;
  position: relative;
  transition: height 0.15s;
}
.p-progress:hover { height: 7px; }

.p-progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  pointer-events: none;
}

.p-ctrls { display: flex; align-items: center; gap: 6px; justify-content: space-between; }

.pbtn {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
}
.pbtn:hover { background: var(--gray-100); color: var(--teal); }
.pbtn.lg { font-size: 1.2rem; width: 36px; height: 36px; }

.p-time { font-size: 0.72rem; color: var(--gray-500); font-variant-numeric: tabular-nums; white-space: nowrap; }

.p-spacer { flex: 1; }

.vol-row { display: flex; align-items: center; gap: 5px; }

.vol-range {
  -webkit-appearance: none;
  width: 68px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  outline: none;
}
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; background: var(--teal); border-radius: 50%; cursor: pointer; }

.spd-btn { font-size: 0.7rem; font-weight: 700; color: var(--gray-500); background: var(--gray-100); border: none; border-radius: 4px; padding: 3px 6px; cursor: pointer; transition: var(--transition); }
.spd-btn:hover { background: var(--teal); color: white; }

/* Info section */
.p-info { padding: 18px 20px; }

.p-title { font-size: 1.05rem; font-weight: 800; color: var(--gray-800); margin-bottom: 10px; line-height: 1.4; }

.p-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--gray-500);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 12px;
}

.p-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.pa-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.pa-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); }
.pa-btn.on { background: var(--teal-bg); border-color: var(--teal); color: var(--teal); }

/* Tabs */
.p-tabs { display: flex; border-bottom: 1.5px solid var(--gray-200); padding: 0 20px; }

.ptab {
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.ptab::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--teal); transform: scaleX(0); transition: transform 0.2s; }
.ptab:hover { color: var(--gray-600); }
.ptab.active { color: var(--teal-dark); }
.ptab.active::after { transform: scaleX(1); }

.ptab-body { display: none; padding: 16px 20px 20px; }
.ptab-body.active { display: block; }

.desc-txt { font-size: 0.82rem; color: var(--gray-600); line-height: 1.8; }
.desc-txt h4 { color: var(--gray-800); font-size: 0.875rem; margin: 12px 0 5px; }
.desc-txt ul { padding: 0; list-style: none; }
.desc-txt ul li { padding: 3px 0 3px 16px; position: relative; font-size: 0.82rem; }
.desc-txt ul li::before { content: '▸'; position: absolute; left: 0; color: var(--teal); }

/* Comment */
.cm-box { display: flex; gap: 9px; margin-bottom: 18px; }
.cm-ta { flex: 1; padding: 9px 13px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 0.8rem; min-height: 66px; outline: none; font-family: inherit; color: var(--gray-700); resize: none; transition: var(--transition); }
.cm-ta:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,0.08); }
.cm-send { padding: 7px 16px; background: var(--teal); color: white; border: none; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; cursor: pointer; align-self: flex-end; transition: var(--transition); }
.cm-send:hover { background: var(--teal-dark); }

.cm-list { display: flex; flex-direction: column; gap: 13px; }
.cm-item { display: flex; gap: 9px; }
.cm-av { width: 30px; height: 30px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.68rem; font-weight: 700; flex-shrink: 0; }
.cm-body { flex: 1; }
.cm-name { font-size: 0.8rem; font-weight: 700; color: var(--gray-700); margin-bottom: 1px; }
.cm-name span { font-weight: 400; color: var(--gray-400); font-size: 0.7rem; margin-left: 5px; }
.cm-text { font-size: 0.78rem; color: var(--gray-600); line-height: 1.6; }
.cm-acts { display: flex; gap: 9px; margin-top: 3px; }
.cm-act { font-size: 0.68rem; color: var(--gray-400); background: none; border: none; cursor: pointer; transition: var(--transition); }
.cm-act:hover { color: var(--teal); }

/* Playlist Sidebar */
.sidebar-box {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 76px;
  overflow: hidden;
}

.sb-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-head-title { font-size: 0.875rem; font-weight: 800; color: var(--gray-800); }
.sb-count { font-size: 0.7rem; color: var(--gray-400); background: var(--gray-100); padding: 2px 9px; border-radius: 50px; }

.sb-prog { padding: 9px 16px; border-bottom: 1px solid var(--gray-100); }
.sp-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--gray-500); margin-bottom: 4px; }
.sp-bar { height: 5px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.sp-fill { height: 100%; background: var(--teal); border-radius: 3px; transition: width 0.4s ease; }

.sb-list { overflow-y: auto; max-height: 62vh; }

.pl-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--gray-50);
}

.pl-item:hover { background: var(--gray-50); }
.pl-item.active { background: var(--teal-bg); border-left: 3px solid var(--teal); }
.pl-item.active .pl-item-title { color: var(--teal-dark); font-weight: 700; }

.pl-num { width: 20px; text-align: center; font-size: 0.7rem; color: var(--gray-400); font-weight: 600; flex-shrink: 0; }
.pl-item.active .pl-num { color: var(--teal); }
.pl-item.done .pl-num { color: #10b981; }

.pl-thumb {
  width: 68px;
  height: 38px;
  background: var(--gray-100);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.pl-active-icon {
  position: absolute;
  inset: 0;
  background: rgba(13,148,136,0.28);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 0.9rem;
}
.pl-item.active .pl-active-icon { display: flex; }

.pl-info { flex: 1; min-width: 0; }
.pl-item-title { font-size: 0.75rem; font-weight: 600; color: var(--gray-700); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-item-dur { font-size: 0.65rem; color: var(--gray-400); margin-top: 1px; }

/* No-video overlay (shown when file is missing) */
.p-no-video {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  gap: 14px;
  z-index: 5;
}

.p-no-video-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  letter-spacing: 0.3px;
}

.p-screen-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 900px) {
  .player-layout { grid-template-columns: 1fr; }
  .sidebar-box { position: static; }
  .sb-list { max-height: 320px; }
}

@media (max-width: 640px) {
  .header-search { display: none; }
  .video-grid { grid-template-columns: 1fr 1fr; }
  .video-grid.list { grid-template-columns: 1fr; }
  .video-grid.list .vcard { flex-direction: column; }
  .video-grid.list .vcard-thumb { width: 100%; min-height: auto; }
  .tabs-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
}

/* ============================================
   SUPPLEMENTAL CLASSES
============================================ */

/* Logo text */
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name  { font-size: 0.95rem; font-weight: 800; color: var(--teal-dark); }
.logo-sub   { font-size: 0.6rem; font-weight: 500; color: var(--gray-400); }

/* Header badge */
.hbadge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--teal-bg);
  color: var(--teal-dark);
  padding: 4px 11px;
  border-radius: 50px;
  border: 1.5px solid var(--teal-pale);
  white-space: nowrap;
}

/* Back button (player page) */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.back-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); }

/* Breadcrumb separators */
.bc-sep     { color: var(--gray-300); }
.bc-current { color: var(--gray-600); font-weight: 600; }

/* Hero inner */
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.hero-title { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 800; margin-bottom: 6px; }
.hero-sub   { font-size: 0.88rem; opacity: 0.82; max-width: 520px; margin-bottom: 0; }

/* Toolbar (above video grid) */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-btns {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: 6px;
  padding: 3px;
}

/* Player controls left/right */
.p-ctrls-left  { display: flex; align-items: center; gap: 4px; flex: 1; }
.p-ctrls-right { display: flex; align-items: center; gap: 6px; }

/* Progress thumb handle */
.p-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  background: var(--teal);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  pointer-events: none;
  transition: left 0.05s linear;
  opacity: 0;
}
.p-progress:hover .p-progress-thumb { opacity: 1; }

/* Screen progress overlay strip */
.p-screen-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--teal);
  pointer-events: none;
  transition: width 0.9s linear;
}

/* Player category label */
.p-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
  margin-bottom: 4px;
}

/* Free badge in player info */
.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #d1fae5;
  color: #059669;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 50px;
}

/* pa-btn variants */
.pa-btn.sec { background: var(--gray-50); }
.pa-btn.done { background: #d1fae5; border-color: #10b981; color: #059669; }

/* Sidebar title / progress text */
.sb-title     { font-size: 0.875rem; font-weight: 800; color: var(--gray-800); }
.sb-prog-text { font-size: 0.7rem; color: var(--gray-400); }

/* Sidebar progress bar (within sb-head area) */
.sb-prog {
  height: 5px;
  background: var(--gray-100);
  overflow: hidden;
}
.sp-fill { height: 100%; background: var(--teal); transition: width 0.4s ease; }

/* Playlist item text aliases */
.pl-ttl  { font-size: 0.78rem; font-weight: 600; color: var(--gray-700); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-meta { font-size: 0.65rem; color: var(--gray-400); margin-top: 2px; }

/* Resources tab */
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.res-item:hover  { border-color: var(--teal); background: var(--teal-bg); }
.res-icon        { font-size: 1.4rem; flex-shrink: 0; }
.res-info        { flex: 1; min-width: 0; }
.res-name        { font-size: 0.82rem; font-weight: 700; color: var(--gray-800); }
.res-size        { font-size: 0.7rem; color: var(--gray-400); margin-top: 1px; }

/* Comment author / time */
.cm-author       { font-size: 0.8rem; font-weight: 700; color: var(--gray-700); margin-bottom: 3px; }
.cm-time         { font-weight: 400; color: var(--gray-400); font-size: 0.7rem; margin-left: 5px; }

/* Footer inner brand / copy */
.fi-brand { display: flex; align-items: center; gap: 7px; }
.fi-copy  { font-size: 0.74rem; color: var(--gray-500); }
