.django-data-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
}
.django-data-table-head {
    display: block;
    position: sticky;
    top: 0;
    z-index: 3; /* set to make sure this is higher than other set z-index values */
}
/* 
    sortable headers should look minimally different from non-sortable
    also, there is often limited width, and this leaves more room for text
*/
.django-data-table-header-button {
    border: none;
    border-radius: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    background-color: transparent;
}
.django-data-table-header-button-text {
    text-decoration: underline;
}
.django-data-table-header-button {
    line-height: 1.2;
    cursor: pointer;
}
.django-data-table-sort-indicator {
    text-decoration: none;
    font-size: 0.8em;
}


.django-data-table-body {
    display: block;
    z-index: 2; /* set to make sure this is lower than .django-data-table-head z-index */
}
.django-data-table-row {
    min-width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
}
.django-data-table-header-row div[role='columnheader']:nth-last-child(1 of div.ddt-resizable-header) {
    overflow: hidden;
}

/* Note - this applies to cells AND all of their descendants */
/* Note - this should only effect block-level children of cells */
/* Note - this selector isn't great for performance, but I can't see any easy way around this */
/* (other than enumerating a few levels deep, and only protecting those */
.django-data-table-row * {
    overflow: hidden;
    text-overflow: ellipsis;
    /* Hmm, sometimes I think we also need max-width: 100% here, for things like buttons. But in those cases, we might also need a wrapping element with no padding */
}
/* these are the CELLS */
.django-data-table-row > * {
    flex-grow: 0; flex-shrink: 0;

    /* vertical centering and horizontal stretching of cell contents */  
    padding: 8px 16px;

    /* This makes it easier to size the cells according to content */
    /* It's the default in browsers, but some css frameworks set it globally to border-box   */
    box-sizing: content-box;

    /* cells must have opaque background if you use sticky columns anywhere */
    background-color: white;
}
.django-data-table-row-checkbox-label {
    /* This is the only column with width auto. It works, since every cell has exactly the same content. pa*/
    width: auto;
}

.django-data-table-body-row {
    /* body rows should NOT grow in height automatically based on content. */
    /* If users WANT to let content wrap onto multiple lines, they should use django_data_tables.LineCapper */
    white-space: nowrap;
}

/* Some cell CHILDREN might use this class */
.django-data-tables-wrapping-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    /* To be set via inline style, since it can vary: */
    /* reminder - never use -webkit-line-clamp and padding on same element */
    /* -webkit-line-clamp: 3 */
    overflow: hidden;
    overflow-wrap: break-word;
    text-overflow: ellipsis;
    hyphens: auto;
    white-space: normal;
}
.django-data-table-row-checkbox-label {
/*    width: 45px;*/
    flex-grow: 0;
    flex-shrink: 0;
}
.django-data-table-row-checkbox-label:hover > input {
    transform: scale(1.2);
}
.django-data-tables-overflow-indicator {
    font-size: 0.8em;
    padding: 0.1em 0.5em;
    border-radius: 0.5em;
    color: white;
    background-color: #888;
}   

/*
    Note - background colors (and any borders) need to go on CELLS, not ROWS.
    A flex container that is overflowing its scroll parent will only have a width equal to its parent width (unless you set a width explicitly). So any background or border on the row will be cut-off as soon as scroll the table horizontally.
*/
.django-data-table-body > .django-data-table-row:hover > * {
    background-color: #ccc;
}

.django-data-table-help-text:before {
    display: inline;
    content: '?';
}
.django-data-table-help-text {
    font-size: 0.7em;
    font-family: helvetica, arial, sans-serif;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    vertical-align: text-top;
    height: 1.2em;
    width: 1.2em;
    line-height: 1.3;
    text-align: center;
    background-color: #aaa;
    border-radius: 1000px;
    color: white;
    border: none;
    padding: 0;
}

.ddt-overflow-indicator-cell {
    width: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    overflow: visible;
    position: sticky;
    opacity: 0;
    transition: opacity 0.2s linear;
    z-index: 1;
}
.ddt-overflow-indicator-cell-right {
    right: 0;
}
.ddt-overflows-left>*>*>.ddt-overflow-indicator-cell-left,
.ddt-overflows-right>*>*>.ddt-overflow-indicator-cell-right {
    opacity: 1
}

#ddt-overflow-top-indicator {
    opacity: 0;
    height: 0px;
    background-color: #aaaaaa;
    pointer-events: none;
    box-shadow: 0px 0px 15px 5px #8888;
}
.ddt-overflows-top #ddt-overflow-top-indicator {
    opacity: 1;
}

#ddt-overflow-bottom-indicator {
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 3;
    opacity: 0;
    height: 0px;
    background-color: #aaaaaa;
    pointer-events: none;
    box-shadow: 0px 0px 15px 5px #8888;
}
.ddt-overflows-bottom #ddt-overflow-bottom-indicator {
    opacity: 1;
}

#ddt-overflow-top-detector, #ddt-overflow-bottom-detector {
    width: 100%;
    pointer-events: none;
    height: 0px;
}

.ddt-overflow-indicator-cell-left:after {
  content: " ";
  height: 100%;
  position: absolute;
  top: 0;
  width: 15px;
  box-shadow: 15px 0 15px -15px #8888 inset;
  right: -15px;
}
.ddt-overflow-indicator-cell-right:after {
  content: " ";
  height: 100%;
  position: absolute;
  top: 0;
  width: 15px;
  box-shadow: -15px 0 15px -15px #8888 inset;
  right: 0px;
}

.ddt-resizable-header {
    position: relative;

    /* reset overflow: hidden, so that our resize-indicator can overflow cell */
    overflow: visible;
}
.ddt-column-resizer {
    overflow: visible;

    border-right: 1px solid #ccc;
    cursor: col-resize;

    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
}
.ddt-column-resizer:after {
    content: '';
    display: block;
    position: absolute;
    width: 1em;
    height: 100%;
    top: 0;
    left: 0;
    transform: translateX(-50%);
}
