@use "ct-card.scss";
@use "page.scss";
@import "global-variables";
// For pf-line-clamp
@import "@patternfly/patternfly/sass-utilities/mixins.scss";
// For pf-u-disabled-color-100
@import "@patternfly/patternfly/utilities/Text/text.css";

#app .pf-c-card.containers-containers, #app .pf-c-card.containers-images {
    @extend .ct-card;
}

#containers-images, #containers-containers {
    // Decrease padding for the image/container toggle button list
    .pf-c-table.pf-m-compact .pf-c-table__toggle {
        padding-left: 0;
    }
}

@media screen and (max-width: 768px) {
    // Badges should not stretch in mobile mode
    .pf-c-table [data-label] > .pf-c-badge {
        justify-self: start;
    }
}

.container-block {
    display: flex;
    flex-direction: column;
}

.container-block small {
    @include pf-line-clamp("1");
    color: var(--pf-global--Color--200);
}

.container-name {
    font-size: var(--pf-global--FontSize--lg);
    font-weight: 400;
}

.containers-run-onbuildvarclaim input {
    max-width: 15em;
}

.pf-c-alert__description {
    overflow-wrap: anywhere;
}

.listing-action {
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.ct-badge-container-running, .ct-badge-pod-running {
  background-color: var(--pf-global--info-color--100);
  color: white;
}

.ct-badge-container-healthy {
  background-color: var(--pf-global--success-color--100);
  color: white;
}

.ct-badge-container-unhealthy {
  background-color: var(--pf-global--danger-color--100);
  color: white;
}

.green {
    color: var(--pf-global--success-color--100);
}

.red {
  color: var(--pf-global--danger-color--100);
}

// Hide the header nav from the expandable rows - this should be better done with JS but the current cockpit-listing-panel implementation does not support this variant
#containers-images .ct-listing-panel-head {
    display: none;
}

.ct-grey-text {
   color: var(--pf-global--Color--200);
}

.content-action {
    text-align: right;
    white-space: nowrap !important;
}

// Remove doubled-up padding and borders on nested tables in mobile
.ct-listing-panel-body .ct-table tr {
    --pf-c-table-tr--responsive--PaddingTop: 0;
    --pf-c-table-tr--responsive--PaddingRight: 0;
    --pf-c-table-tr--responsive--PaddingBottom: 0;
    --pf-c-table-tr--responsive--PaddingLeft: 0;
}

@media (max-width: $pf-global--breakpoint--md - 1) {
    .show-only-when-wide {
        display: none;
    }
}

@media (min-width: $pf-global--breakpoint--md) {
    .show-only-when-narrow {
        display: none;
    }

    // Add  borders to no pod containers list and images list
    .container-pod.pf-m-plain tbody,
    .containers-images tbody {
        border: var(--pf-c-card--m-flat--BorderWidth) solid var(--pf-c-card--m-flat--BorderColor);
    }
}
