@use "page.scss";
@use "ct-card.scss";
/* Imports 'pf-u-pt-md' class used for Expander in Add Disk dialog */
@use "../node_modules/@patternfly/patternfly/utilities/Spacing/spacing.css";

/* For pf-t-light mixin */
@import "@patternfly/patternfly/sass-utilities/colors.scss";
@import "@patternfly/patternfly/sass-utilities/scss-variables.scss";
@import "@patternfly/patternfly/sass-utilities/mixins.scss";
 // for $alert
@import "@patternfly/patternfly/sass-utilities/component-namespaces.scss";
@import "@patternfly/patternfly/components/Alert/alert.scss";

/* Utilities */
@import "@patternfly/patternfly/utilities/Text/text.css";

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

.pf-v5-c-form__group .pf-v5-c-helper-text {
    margin-block-start: var(--pf-v5-c-form__helper-text--MarginTop);
}

/* Create a hybrid popover with an alert style */
.ct-popover-alert .pf-v5-c-popover__content {
    @extend .pf-v5-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-v5-c-title {
    @extend .pf-v5-c-alert__title;
    font-size: inherit;
}

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

.machines-listing-actions button:not(.pf-v5-c-dropdown__toggle) {
    margin-block: 0.25rem;
    margin-inline: 0.5rem 0;
}

.machines-listing-actions > .pf-v5-c-dropdown {
    margin-block-start: 0.25rem;
}

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

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

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

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

// Limit width for GiB/MiB dropdowns and inputs
.ct-machines-select-unit, .ct-machines-size-input {
    max-inline-size: 5rem;
}

.ct-external-docs-link.pf-v5-c-button.pf-m-link.pf-m-inline {
  padding-inline-start: var(--pf-v5-global--spacer--sm);
}

.ct-monospace {
    font-family: var(--pf-v5-global--FontFamily--monospace);
}

// Do not add a box-shadow to a "subsection", while it's technically correct it looks weird.
.pf-v5-c-page__main-section.pf-m-light.actions-pagesection {
    box-shadow: none;
}

.virtualization-disabled-empty-state {
  // Use a max width of 60 0-characters across and let it size for mobile too
   --pf-v5-c-empty-state__content--MaxWidth: min(60ch, 100%);
}

// Can be removed once https://github.com/cockpit-project/cockpit/pull/18694 is included in the used pkg/lib
.pf-v5-theme-dark {
  .pf-v5-c-page__main-group section {
    --pf-v5-c-page__main-breadcrumb--BackgroundColor: var(--pf-v5-global--BackgroundColor--dark-100);
    background-color: var(--pf-v5-global--BackgroundColor--dark-100);
  }
}

// remove oversized gap between checkbox label and checkbox body
#storage-pool-delete-modal span.pf-v5-c-check__body {
    margin-block-start: 0;
}
