@import './lib/page.scss';
@import './lib/ct-card.scss';

#app .pf-l-gallery {
    --pf-l-gallery--GridTemplateColumns: 1fr;
}
#app .pf-c-card.containers-containers, #app .pf-c-card.containers-images {
    @extend .ct-card;
}

// Stretch body to fill the page
body {
    display: flex;
    flex-direction: column;

    @at-root #app {
        height: 100%;
    }
}

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

.container-block small {
    flex-basis: calc(var(--pf-global--LineHeight--sm) * 1rem);
    line-height: var(--pf-global--LineHeight--sm);
    opacity: 0.7;
    overflow: hidden;
}

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

.image-column-created,
.image-column-size-text {
    display: none;
}

/* The columns are displayed differently here */
@media (min-width: 768px) {
    .image-column-created {
        width: 30%;
        display: table-cell;
    }
    .image-column-size-text {
        width: 15%;
        display: table-cell;
    }
    .image-column-tags {
        width: 40%;
    }
}

.containers-run-inline .form-inline {
    background: #f4f4f4;
    border-width: 0 1px 1px 1px;
    border-style: solid;
    border-color: #bababa;
    padding: 4px;
    margin-left: 0px;
}

.containers-run-inline .form-inline:first-of-type {
    border-top: 1px solid #bababa;
}

.containers-run-inline .form-control {
  margin: 0 4px;
}

.containers-run-inline .form-group:first-of-type .form-control {
  margin: 0 4px 0 0;
}

.containers-run-portmapping input {
    max-width: 5em;
}

.containers-run-volumemount input {
    max-width: 8em;
}

.containers-run-volumemount button {
    max-width: 8em;
}

.containers-run-envvarclaim input {
    max-width: 8em;
}

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

.content-filter {
    background: var(--pf-global--BackgroundColor--100);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem;
    position: sticky;
    display: flex;
    align-items: baseline;
    min-height: 4rem;
    top: 0;
    z-index: 99;
}

.content-filter select {
    flex: none;
    max-width: 50%;
    width: auto;
}

.content-filter input[type="text"] {
    margin-left: 0.5rem;
    flex: auto;
    max-width: 50%;
}

.content-filter h3 {
    display: inline;
    font-size: 18px;
    line-height: 28px;
}

.content-filter i {
    font-size: 24px;
    position: relative;
    padding-right: 3px;
}

.content-filter i.fa {
    margin-top: 2px;
    font-size: 18px;
    line-height: 28px;
}

.content-filter i.fa-cube {
    font-size: 22px;
}

.content-filter a {
    padding-left: 30px;
}

.modal-body .alert {
    margin-bottom: -20px;
    margin-top: 30px;
}

.status {
    padding-left: 32px;
    padding-top: 1em;
    color: #888;
}

.run-image-dialog-actions .btn {
    padding: 0.25rem 0.75rem;
}

.alert .fa {
    padding-right: 10px;
}

.alert.info-message{
    display: flex;
    justify-content: space-between;
}

.info-message {
    margin-top: 5px;
}

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

/* Place details definition list into a grid, with PF4-like style */
.container-details,
.image-details {
    display: grid;
    grid-template-columns: [label] auto [value] 1fr;
    grid-gap: var(--pf-global--spacer--sm) var(--pf-global--spacer--lg);
    align-items: baseline;
    justify-content: left;

    > dt {
        grid-column: label;
        font-size: var(--pf-global--FontSize--sm);
    }

    > dd {
        grid-column: value;
        font-size: var(--pf-global--FontSize--md);
    }
}

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

.heading-label {
    padding: 0 0.5em 0 1em;
    font-weight: 400;
}

 // PF4 does not yet support multiple form fields for the same label
 // Use InputGroup component to achieve this - and just customize it with some extra spacing
.ct-input-group-spacer-sm.pf-c-input-group {
    // Add space between the input group elements
    gap: var(--pf-global--spacer--sm);
    // Allow input fields to wrap if needed
    flex-wrap: wrap;
    padding-bottom: var(--pf-global--spacer--sm);

    // Limit width for select entries and inputs in the input groups otherwise they take up the whole space
    > .pf-c-select, .pf-c-form-control {
      max-width: 40%;
    }

    // Right align the buttons in the input groups - used for adding/removing entries
    > button:first-of-type {
      margin-left: auto;
    }

    > input.pf-c-select__toggle-typeahead {
      min-width: min-content;
    }

    // Container port protocol selection does not need the full 40% width
    > select.container-port-protocol {
      max-width: 6rem;
    }

    > .btn-add, .btn-close {
      max-width: 3rem;
    }
}

input.pf-c-form-control[type=number] {
  max-width: 20%;
}

.invisible {
  visibility: hidden;
}
