@import "../lib/page.scss";
@import "../lib/table.css";

@import "@patternfly/patternfly/components/Alert/alert.scss";
@import "../lib/ct-card.scss";

/* Style the list cards as ct-cards */
.pf-c-page__main-section > .pf-c-card {
    @extend .ct-card;
}

/* Create a hybrid popover with an alert style */
.ct-popover-alert .pf-c-popover__content {
    @extend .pf-c-alert;
    @extend .pf-m-danger;
    display: block;
    box-shadow: none;
}

/* Also style the hybrid popover alert title like an alert */
.ct-popover-alert .pf-c-title {
    @extend .pf-c-alert__title;
    font-size: inherit;
}

.icon-2x-vms {
    font-size: 2em;
}
.icon-3x-vms {
    font-size: 3em;
}

.machines-width-max {
    width: 100%;
}

.usage-donut-caption {
    text-align: center;
    width: 200px;
}

.machines-disks-source {
    &-label {
        border-radius: var(--pf-global--BorderRadius--sm);
        padding: var(--pf-global--spacer--xs) var(--pf-global--spacer--sm);
        margin-right: var(--pf-global--spacer--sm);
        background: var(--pf-global--BackgroundColor--300);
        color: var(--pf-global--Color--300);
    }

    &-label,
    &-value {
        font-size: var(--pf-global--FontSize--sm);
    }
}

.machines-listing-detail-top-column {
    vertical-align: top;
}

.machines-console-frame {
    height: 1px; /* keep at minimum, down-sizing does not work */
    margin-top: 1em;
}

.machines-console-frame-vnc {
    width: 100%;
    height: 100%;
    margin-top: -2em;
}

.left-delimiter {
    padding: 0 13px 0;
}

.left-delimiter + .left-delimiter {
    border-left: 1px solid #d1d1d1;
    padding-left: 15px;
}

.top-right-menu {
    float: right;
    padding-bottom: 5px;
    position: absolute;
    right: 5em;
}

.blue {
    color: var(--color-link);
}

.machines-network-source-descr {
    color: var(--color-subtle-copy);
    text-align: right;
    padding: 5px 10px 5px 10px !important;
}

.machines-network-source-value {
    padding: 5px 10px 5px 10px !important;
    text-align: left !important;
}

.machines-network-up {
    color: green;
}

.machines-network-down {
    color: red;
}

.machines-network-source-link {
    cursor: pointer;
    text-decoration: underline;
    color: var(--alert-info-text);
}

.machines-listing-actions {
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0;
}

.machines-listing-actions > button {
    margin: 0.25rem 0 0.25rem 0.5rem;
}

.panel-heading .btn {
    margin-left: 3px;
}

.console-actions-buttons {
    margin-left: 5px;
}

.console-actions {
    float: right;
    position: relative;
    top: -2em;
}

.machines-status-alert {
    padding-right: 5px;
}

#vcpus-tooltip.pficon-pending, #boot-order-tooltip.pficon-pending,
.machines-disks .pficon-pending, .pficon-ok{
    margin-left: 0.5rem;
}

.pficon-pending {
    color: #ec7a08;
    font-size: 16px;
}

.pf-c-modal-box__footer .pficon-pending, .pficon-warning-triangle-o, .pficon-ok {
    line-height: inherit;
    margin-right: 0.5rem;
}

td > .utilization-bar-pf {
    width: 100%;
    min-width: 4em;

    > .progress {
        margin-bottom: 0;
        height: 0.5rem;
    }
}

.error.listing-ct-item,
table.listing-ct-table > tbody > tr:first-child.error {
    background-color: var(--color-ct-list-critical-bg) !important;  /* keep red background when expanded */
}

virtual-machines-listing .listing-ct-body {
    overflow: visible;
}

.pf-c-dropdown__menu-item.pf-m-danger {
    color: var(--pf-global--danger-color--200);
}

.pf-c-table {
    .btn-group {
        align-items: center;
    }

    > tbody > tr:not(.pf-c-table__expandable-row) > [data-label=Actions] .pf-c-button {
        // vertical: compensate for padding; fixing alignment
        // horizontal: add some needed padding
        margin:  -0.25rem 0.25rem;
    }
}

.machines-connection-selector > .pf-c-radio:first-child {
    padding-right: var(--pf-global--spacer--md);
}

.pf-c-form__section.ct-form-split {
    margin-top: 0;
    grid-template-columns: 1fr 1fr;
}

.pf-c-form__section.ct-form-split-2-1 {
    margin-top: 0;
    grid-template-columns: 2fr 1fr;
}

// Add some spacing to nested form groups
.pf-c-form__group-control {
    > .pf-c-form__group, .pf-c-form__section {
        padding-top: var(--pf-global--spacer--md);
    }
}

// Limit width for GiB/MiB dropdowns
.ct-machines-select-unit {
    max-width: 5rem;
}
