/* Trang quản lý video KOC — chỉ styles đặc thù */

.list-page-stats-grid .stat-card--clickable {
  cursor: pointer;
}

#videos-page .list-page-stats-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Filter: dropdowns trong header slot */
#videos-page .section-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Campaign accordion */
.videos-campaign-card {
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.videos-campaign-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #e0f2fe;
  cursor: pointer;
  border-bottom: 1px solid #0284c7;
  user-select: none;
}

.videos-campaign-header:hover {
  background-color: #d4ebf7;
}

.videos-campaign-header__title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.videos-campaign-header__title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
  color: #0c4a6e;
}

.videos-campaign-header__subtitle {
  flex: 0 0 auto;
  font-size: 12px;
  color: #0284c7;
  font-weight: 400;
}

.videos-campaign-header__pills {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.expand-chevron {
  color: #0284c7;
  font-size: 10px;
  display: inline-block;
  transition: transform 0.2s;
}

.expand-chevron--muted {
  color: #9ca3af;
}

.expand-chevron.is-expanded {
  transform: rotate(90deg);
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-pill--published {
  background: #f0fdf4;
  color: #15803d;
}

.mini-pill--pending {
  background: #f1f5f9;
  color: #475569;
}

/* Cột spacer canh lề với mũi tên đóng mở chiến dịch */
.videos-koc-table-scroll .col-spacer {
  width: 28px;
  min-width: 28px;
  padding: 0 !important;
  border: none !important;
}

/* Scrollable table cho KOC list — scroll khi nhiều KOC trong chiến dịch */
.videos-koc-table-scroll {
  max-height: 440px;
  overflow-y: auto;
}

/* Scroll cho danh sách campaign accordion */
.videos-campaign-list-scroll {
  max-height: 680px;
  overflow-y: auto;
  padding-right: 4px;
}

.videos-campaign-list-scroll::-webkit-scrollbar,
.videos-koc-table-scroll::-webkit-scrollbar {
  width: 8px;
}

.videos-campaign-list-scroll::-webkit-scrollbar-thumb,
.videos-koc-table-scroll::-webkit-scrollbar-thumb,
.videos-koc-videos-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 8px;
}

/* Expanded video list per KOC */
.videos-koc-videos-wrap {
  padding: 8px;
  background-color: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* Scroll khi nhiều video (>4 items) */
.videos-koc-videos-scroll {
  max-height: 248px;
  overflow-y: auto;
}

.videos-koc-videos-scroll::-webkit-scrollbar {
  width: 6px;
}

.tabular-expanded-row {
  padding: 0 !important;
  border: none !important;
}

.tabular-expanded-row .videos-koc-videos-wrap {
  margin: 4px;
}

.videos-koc-video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.videos-koc-video-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.videos-koc-video-display {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 4fr 3fr auto auto;
  gap: 6px;
  align-items: center;
}

.videos-koc-video-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.videos-koc-video-link:hover {
  text-decoration: underline;
}

.videos-koc-spark-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  min-width: 0;
}

.videos-koc-actions {
    display: inline-flex;
    align-items: center;
}

.videos-koc-actions .btn-icon {
    padding: 0 !important;
    gap: 0 !important;
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    font-size: 13px;
    border-radius: 3px;
}

.videos-koc-spark-label {
  color: #1f2937;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.videos-koc-spark-value {
  color: #9ca3af;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.videos-koc-cell--empty {
  color: #d1d5db;
  font-size: 12px;
}

/* Inline video edit form — layout wrapper */
.videos-koc-video-edit-inline {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.videos-koc-video-edit-inline .ve-input--url {
  flex: 2;
}

.videos-koc-video-edit-inline .ve-input--spark {
  flex: 1;
}

.videos-koc-video-edit-inline .ve-select {
  flex: 0.5;
}

.videos-koc-video-edit-inline .ve-actions {
  flex: 0.5;
}

/* Action column & add video row button */
.videos-koc-table-scroll .col-action {
  width: 60px;
  min-width: 60px;
}

.btn-add-video-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #0284c7;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}

.btn-add-video-row:hover:not(:disabled) {
  background: #bae6fd;
  border-color: #0369a1;
}

.btn-add-video-row:disabled {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
  #videos-page .list-page-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .videos-campaign-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .videos-campaign-header__title {
    max-width: 100%;
  }

  .videos-koc-video-display {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .videos-koc-video-edit-inline {
    flex-direction: column;
    gap: 6px;
  }

  .videos-koc-video-edit-inline .ve-input--url,
  .videos-koc-video-edit-inline .ve-input--spark,
  .videos-koc-video-edit-inline .ve-select,
  .videos-koc-video-edit-inline .ve-actions {
    flex: 1 1 100%;
    width: 100%;
  }

  #videos-page .section-header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  #videos-page .section-header-actions .filter-select {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  #videos-page .list-page-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #videos-page .section-header-actions .filter-select {
    flex: 1 1 100%;
    min-width: 0;
  }
}