/*
 * Cron Jobs screens: the job list and Edit Cron Job. The shared components come from
 * ktmp-ui.css; this file holds only what no other screen has. Loaded on the Cron Jobs page.
 */

/* Job list */
.ktmp-cron .ktmp-cron-col-type,
.ktmp-cron .ktmp-cron-col-role {
    width: 150px;
}

.ktmp-cron .ktmp-cron-col-status {
    width: 30%;
}

.ktmp-cron .ktmp-cron-col-actions {
    width: 210px;
}

.ktmp-cron .ktmp-cron-name {
    overflow-wrap: anywhere;
}

.ktmp-cron .ktmp-cron-actions {
    white-space: nowrap;
}

/* Switch with its status word, the saving state and the result. */
.ktmp-cron-switch {
    flex-wrap: wrap;
    min-height: 28px;
}

.ktmp-cron-feedback:empty {
    display: none;
}

.ktmp-cron-feedback .ktmp-note {
    margin: 0;
}

/* In the Edit page header the saving state and the result sit left of the switch. */
.ktmp-cron-header-actions .ktmp-cron-feedback {
    order: -1;
}

.ktmp-cron .ktmp-cron-help,
.ktmp-cron .ktmp-cron-error {
    margin-top: var(--ktmp-space-1);
}

/* Edit Cron Job: the header actions and the cards. */
.ktmp-cron-header-actions .button-link-delete {
    text-decoration: none;
}

.ktmp-cron-form {
    display: grid;
    gap: var(--ktmp-space-5);
}

.ktmp-cron-form > .ktmp-card {
    margin: 0;
}

.ktmp-cron-form .ktmp-card .form-table {
    margin: 0;
}

.ktmp-cron-form .ktmp-options {
    padding: 2px;
}

/* The second Save cron, under the product list. */
.ktmp-cron-save-end {
    justify-content: flex-end;
}

/* Product list card */
.ktmp-cron-picker .ktmp-card__header {
    align-items: center;
}

.ktmp-wrap .ktmp-cron-search {
    width: 200px;
}

.ktmp-cron-count {
    margin: 0;
    font-size: var(--ktmp-type-body-size);
    color: var(--ktmp-text-secondary);
}

.ktmp-cron-pages {
    justify-content: center;
}

.ktmp-cron-pages .ktmp-pagination {
    margin: 0;
}

/*
 * The product table classes are shared with other screens, whose rules in admin-style.css
 * centre every cell, frame it on all sides and make the header sticky. Here the table
 * follows the shared data table instead.
 */
.ktmp-cron-picker.ktmp-product-list thead {
    position: static;
}

.ktmp-cron-table {
    min-width: 1180px;
}

.ktmp-cron-picker .ktmp-cron-table th,
.ktmp-cron-picker .ktmp-cron-table td {
    border-top: 0;
    border-inline: 0;
    text-align: start;
}

.ktmp-cron-picker .ktmp-cron-table .ktmp-num {
    text-align: end;
}

.ktmp-cron-picker td.ktmp-product-checkbox {
    display: table-cell;
    white-space: nowrap;
}

.ktmp-cron-picker td.ktmp-product-checkbox input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

.ktmp-cron-table .ktmp-cron-col-id { width: 64px; }
.ktmp-cron-table .ktmp-cron-col-sku { width: 120px; }
.ktmp-cron-table .ktmp-cron-col-select { width: 72px; }
.ktmp-cron-table .ktmp-cron-col-expand { min-width: 100px; }
.ktmp-cron-table .ktmp-cron-col-date { width: 170px; }
.ktmp-cron-table .ktmp-cron-col-product { min-width: 220px; }

/* The Expand button keeps a class the product list script binds to, which admin-style.css
   paints blue with !important on the other screens; here it keeps the shared button fill. */
.ktmp-cron-picker .ktmp-cron-table .button.ktmp-expand-button {
    background-color: var(--ktmp-surface-card) !important;
}

/* admin-style.css also drops the border and paints the text white; these rules restore them. */
.ktmp-cron-table .ktmp-expand.ktmp-expand-button {
    border: 1px solid var(--ktmp-accent);
    color: var(--ktmp-accent);
    font-size: var(--ktmp-type-body-size);
}

.ktmp-cron-table .ktmp-expand.ktmp-expand-button:hover,
.ktmp-cron-table .ktmp-expand.ktmp-expand-button[aria-expanded="true"] {
    border-color: var(--ktmp-accent-hover);
    color: var(--ktmp-accent-hover);
}

.ktmp-cron-picker .ktmp-cron-table .button.ktmp-expand-button:hover {
    background-color: var(--ktmp-surface) !important;
}

.ktmp-cron-picker .ktmp-cron-table .button.ktmp-expand-button[aria-expanded="true"] {
    background-color: var(--ktmp-accent-tint) !important;
}

.ktmp-cron-table .ktmp-source {
    margin-inline-start: 6px;
}

/* Why a row cannot be selected: a warning button and its popover. */
.ktmp-cron-why {
    display: inline-block;
    margin-inline-start: var(--ktmp-space-1);
    vertical-align: middle;
}

.ktmp-cron-why__button .dashicons {
    color: var(--ktmp-warning);
}

.ktmp-cron-why__popover {
    position: fixed;
    z-index: 100;
    white-space: normal;
}

.ktmp-cron-why__popover ul {
    margin: 0;
    padding-inline-start: var(--ktmp-space-5);
    list-style: disc;
}

.ktmp-cron-why__popover li {
    margin: 0;
}

@media screen and (max-width: 782px) {
    .ktmp-wrap .ktmp-cron-search {
        width: 100%;
    }
}
