/* ============================================================
   Korsyl Video Module — video.css
   ============================================================ */

/* ── Video grid (browse + channel pages) ─────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.video-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  background: var(--k-card, #fff);
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  color: inherit;
}

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-duration {
  position: absolute;
  bottom: 6px;
  right: 7px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .3px;
}

.video-promo-badge {
  position: absolute;
  top: 6px;
  left: 7px;
  background: rgba(255,193,7,.88);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: .3px;
  text-transform: uppercase;
  pointer-events: none;
}

.video-card-body {
  padding: 10px 12px 12px;
}
.video-card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-meta {
  font-size: 12px;
  color: #6c757d;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.video-card-channel {
  color: var(--k-green, #1a7a4a);
  font-weight: 500;
  text-decoration: none;
}
.video-card-channel:hover { text-decoration: underline; }

/* ── Custom Video Player ─────────────────────────────────── */
.kv-player-wrap {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.kv-player {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* Controls overlay */
.kv-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  padding: 20px 12px 10px;
  opacity: 0;
  transition: opacity .2s;
}
.kv-player-wrap:hover .kv-controls,
.kv-player-wrap.kv-paused .kv-controls {
  opacity: 1;
}

.kv-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.kv-progress-bar {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
  cursor: pointer;
  transition: height .15s;
}
.kv-progress-bar:hover { height: 6px; }
.kv-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #e00;
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}
.kv-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: #e00;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.kv-progress-bar:hover .kv-progress-thumb { opacity: 1; }

.kv-time-display {
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.kv-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.kv-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: .9;
  transition: opacity .15s;
}
.kv-btn:hover { opacity: 1; }
.kv-spacer { flex: 1; }

.kv-volume-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}
.kv-volume-slider {
  -webkit-appearance: none;
  width: 70px;
  height: 3px;
  background: rgba(255,255,255,.4);
  border-radius: 2px;
  cursor: pointer;
  accent-color: #e00;
}

/* ── Reactions (like/dislike) ────────────────────────────── */
.kv-react-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  transition: background .15s, border-color .15s, color .15s;
}
.kv-react-btn:hover { background: #f0f0f0; }
.kv-react-btn.active { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }
.kv-react-btn.active.dislike { background: #fdecea; border-color: #c62828; color: #c62828; }

/* ── Channel bar ─────────────────────────────────────────── */
.kv-channel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.kv-channel-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kv-channel-initial {
  background: var(--k-green, #1a7a4a);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.kv-channel-name {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.kv-channel-name:hover { text-decoration: underline; }

/* ── Description ─────────────────────────────────────────── */
.kv-description {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
}
.kv-desc-text {
  font-size: 14px;
  line-height: 1.6;
  max-height: 72px;
  overflow: hidden;
  transition: max-height .3s;
}
.kv-desc-text.expanded { max-height: 2000px; }
.kv-desc-toggle {
  background: none;
  border: none;
  padding: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

/* ── Comments ────────────────────────────────────────────── */
.kv-comment-form {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.kv-comment {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.kv-comment-body { flex: 1; }
.kv-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.kv-comment-text {
  font-size: 14px;
  line-height: 1.5;
}
.kv-comment-delete {
  background: none;
  border: none;
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.kv-comment-delete:hover { color: #e00; }

/* ── Related sidebar ─────────────────────────────────────── */
.kv-related-list { display: flex; flex-direction: column; gap: 12px; }
.kv-related-item {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background .15s;
  padding: 4px;
}
.kv-related-item:hover { background: #f5f5f5; color: inherit; }
.kv-related-thumb-wrap {
  position: relative;
  width: 120px;
  aspect-ratio: 16/9;
  flex-shrink: 0;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
}
.kv-related-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.kv-related-info { flex: 1; min-width: 0; }
.kv-related-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.kv-related-meta { font-size: 12px; color: #6c757d; }

/* ── Channel header (channel page) ──────────────────────── */
.kv-channel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.kv-channel-header-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.kv-channel-initial-lg {
  background: var(--k-green, #1a7a4a);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Upload progress ─────────────────────────────────────── */
.kv-upload-progress { background: #f8f9fa; border-radius: 8px; padding: 12px; }

/* ── Channel banner ──────────────────────────────────────── */
.kv-channel-banner {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
}
.kv-channel-banner-empty {
  background: linear-gradient(135deg, #1a7a4a 0%, #0d3b24 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  font-size: 13px;
}
@media (min-width: 768px) {
  .kv-channel-banner { height: 220px; }
}

/* Banner inside a card (create/edit form preview) */
.card > .kv-channel-banner,
.card > .kv-channel-banner-empty {
  border-radius: 8px 8px 0 0;
  height: 120px;
}

/* ── Verified badge ──────────────────────────────────────── */
.fa-circle-check.text-primary { color: #1d9bf0 !important; }

/* ── Subscribe button ────────────────────────────────────── */
#subscribeBtn { min-width: 115px; transition: background .15s, color .15s, border-color .15s; }

/* ── Subscriber line under channel name (watch page) ─────── */
#chanSubLine { font-size: 12px; margin-top: 2px; }

/* ============================================================
   Channel browse page (channels.php)
   ============================================================ */

/* ── Channel card grid ───────────────────────────────────── */
.ch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.ch-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  background: var(--k-card, #fff);
  border: 1px solid #e9ecef;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.ch-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(0,0,0,.11);
  color: inherit;
}

/* Mini banner strip */
.ch-card-banner {
  height: 72px;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
  flex-shrink: 0;
}
.ch-card-banner-empty {
  background: linear-gradient(135deg, #1a7a4a 0%, #0d3b24 100%);
}

/* Avatar row (overlaps banner) */
.ch-card-avatar-row {
  display: flex;
  justify-content: center;
  margin-top: -28px;
  margin-bottom: 6px;
}
.ch-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ch-card-avatar-initial {
  background: var(--k-green, #1a7a4a);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
}

.ch-card-body {
  padding: 0 14px 14px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ch-card-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ch-card-handle { font-size: 12px; color: #6c757d; }
.ch-card-stats {
  font-size: 12px;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.ch-dot { opacity: .4; }
.ch-card-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.45;
  margin: 4px 0 0;
}

/* ── Channel search bar ──────────────────────────────────── */
.ch-search-wrap {
  position: relative;
  max-width: 560px;
}
.ch-search-inner {
  display: flex;
  align-items: center;
  border: 1.5px solid #dee2e6;
  border-radius: 24px;
  background: #fff;
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ch-search-wrap:focus-within .ch-search-inner {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,.1);
}
.ch-search-icon { color: #aaa; font-size: 14px; flex-shrink: 0; pointer-events: none; }
.ch-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 11px 10px;
  font-size: 15px;
  background: transparent;
}
.ch-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  flex-shrink: 0;
  transition: background .12s;
}
.ch-search-clear:hover { background: #dee2e6; }

/* ── Search dropdown ─────────────────────────────────────── */
.ch-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
.ch-dropdown-inner { padding: 6px 0; }
.ch-dd-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #999;
  padding: 6px 14px 4px;
}
.ch-dd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .1s;
  position: relative;
}
.ch-dd-row:hover,
.ch-dd-row.ch-dd-active { background: #f8f9fa; }
.ch-dd-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.ch-dd-avatar-init { background: var(--k-green, #1a7a4a); color: #fff; }
.ch-dd-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ch-dd-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}
.ch-dd-meta { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-dd-remove {
  background: none;
  border: none;
  color: #bbb;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color .1s, background .1s;
  display: flex;
  align-items: center;
}
.ch-dd-remove:hover { color: #e00; background: #fff0f0; }

/* ============================================================
   Video section sidebar layout (video.php, subscriptions)
   ============================================================ */

.vs-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 60px);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.vs-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 16px 8px;
  border-right: 1px solid #f0f0f0;
  scrollbar-width: thin;
}
.vs-sidebar::-webkit-scrollbar { width: 4px; }
.vs-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── Sidebar nav ─────────────────────────────────────────── */
.vs-nav { display: flex; flex-direction: column; gap: 1px; }

.vs-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  transition: background .12s;
  white-space: nowrap;
  overflow: hidden;
}
.vs-nav-link:hover { background: #f2f2f2; color: #333; }
.vs-nav-link.active {
  background: #fef2f2;
  color: #dc3545;
  font-weight: 600;
}
.vs-nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.vs-nav-link.active i { color: #dc3545; }

/* ── Divider + section label ─────────────────────────────── */
.vs-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 10px 12px;
}
.vs-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #999;
  padding: 6px 12px 4px;
}

/* ── Subscribed channel list ─────────────────────────────── */
.vs-sub-list .vs-nav-link { gap: 10px; }

.vs-ch-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vs-ch-initial {
  background: var(--k-green, #1a7a4a);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}
.vs-ch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}

.vs-show-more {
  display: block;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background .12s;
}
.vs-show-more:hover { background: #f2f2f2; color: #333; }

/* ── Sign-in prompt ──────────────────────────────────────── */
.vs-signin-prompt { padding: 8px 12px; }

/* ── Main content area ───────────────────────────────────── */
.vs-main {
  flex: 1;
  min-width: 0;
  padding: 24px 20px;
}

/* ── Responsive: collapse sidebar on mobile ──────────────── */
@media (max-width: 767px) {
  .vs-layout { flex-direction: column; }
  .vs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .vs-nav { flex-direction: row; flex-wrap: nowrap; gap: 4px; }
  .vs-nav-link { padding: 6px 10px; font-size: 13px; gap: 6px; }
  .vs-nav-link span { display: none; }
  .vs-nav-link i { font-size: 18px; width: auto; }
  .vs-divider,
  .vs-section-label,
  .vs-sub-list,
  .vs-show-more,
  .vs-signin-prompt { display: none; }
  .vs-main { padding: 16px 12px; }
}
