/* Table view layout fixes: tighter spacing, aligned columns, constrained thumbnails */

/* General row styling to avoid excessive whitespace */
.table-row,
.table-header .table-row {
  display: grid;
  grid-template-columns:
    70px            /* ID */
    220px           /* Thumbnail */
    minmax(220px, 1fr) /* Title */
    160px           /* Owner */
    140px           /* Visibility */
    140px           /* Viewable */
    200px           /* Created */
    200px           /* Modified */
    200px           /* Last Published */
    90px            /* Width */
    90px            /* Height */
    110px           /* Size */
    110px           /* Length */
    80px            /* FPS */
    120px           /* Bit Rate */
    90px            /* Views */
    160px           /* Custom Path */
    40px;           /* Options */
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding: 10px 12px;
  min-height: 92px; /* consistent row height for thumbnail and text */
  line-height: 1.2;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  overflow: visible; /* allow menus/popups to render outside row */
}

/* Zebra striping for readability */
.table-row:nth-child(odd) { background: rgba(0,0,0,0.02); }
.table-row:nth-child(even) { background: transparent; }

/* Ensure any images inside table rows don't blow up row height */
.table-row img {
  max-height: 100px;
  width: auto;
  object-fit: cover;
  border-radius: 4px;
}

/* If thumbnails are wrapped in a dedicated cell or box, cap its size */
.table-row .thumbnail,
.table-row .thumb,
.table-row .thumbnailBox,
.table-row .thumbBox {
  max-height: 100px;
  max-width: 200px;
  overflow: hidden;
}

/* Cell alignment and truncation to keep rows compact */
.table-row .table-cell,
.table-row .cell,
.table-row .col,
.table-row > div {
  align-self: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: visible; /* prevent clipping of dropdowns */
}

/* Title/textareas should not expand row height */
.table-row textarea,
.table-row .titleTextarea,
.table-row .titleInput {
  max-height: 80px;
  min-height: 32px;
  resize: vertical;
}

/* Selects and inputs should not expand the row */
.table-row select,
.table-row input[type="text"],
.table-row input[type="number"],
.table-row .btn,
.table-row button {
  max-height: 34px;
  font-size: 12px;
}

/* Date columns: keep single line, truncate overflow */
.table-row > div:nth-child(7), /* Created */
.table-row > div:nth-child(8), /* Modified */
.table-row > div:nth-child(9)  /* Last Published */ {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: flex;
  align-items: center;
}

/* In case markup renders duplicate date fragments, show only first child */
.table-row > div:nth-child(7) > *:not(:first-child),
.table-row > div:nth-child(8) > *:not(:first-child),
.table-row > div:nth-child(9) > *:not(:first-child) {
  display: none !important;
}

/* Numeric columns: center-align and prevent wrap */
.table-row > div:nth-child(10), /* Width */
.table-row > div:nth-child(11), /* Height */
.table-row > div:nth-child(12), /* Size */
.table-row > div:nth-child(13), /* Length */
.table-row > div:nth-child(14), /* FPS */
.table-row > div:nth-child(15), /* Bit Rate */
.table-row > div:nth-child(16)  /* Views */ {
  text-align: center;
  white-space: nowrap;
}

/* Options menu (three dots) alignment */
.table-row .options,
.table-row .more,
.table-row .menu {
  justify-self: end;
  position: relative;
  z-index: 2;
}

/* Common popup for options (if class names match) */
.optionsPopup,
.pinkShare,
.videoOptionsMenu,
.secondMenuBox,
.optionsMenu {
  position: absolute;
  z-index: 1000;
  right: 12px;
}

/* Options menu placement helpers */
.optionsMenu.bottom { margin-top: 8px; }
.optionsMenu.top { transform: translateY(-100%); margin-top: -8px; }

/* Datatables integration: reduce default row padding if applied */
.dataTables_wrapper .table-row {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Prevent massive margins that create blank bands */
.table-row *,
.table-row > * {
  margin-top: 0;
  margin-bottom: 0;
}

/* Header styling */
.table-header {
  font-weight: 600;
  padding: 0; /* avoid extra offset compared to body rows */
  border: none;
}
.table-header .table-cell,
.table-header > div { white-space: nowrap; }

/* Ensure long custom paths truncate nicely */
.table-row .customPath,
.table-row .path { max-width: 160px; }
