@import "./_global-variables.scss";
@import "@patternfly/patternfly/base/patternfly-themes.scss";
@import "./patternfly/patternfly-4-overrides.scss";
@import "@patternfly/patternfly/components/Page/page.scss";

/* Globally resize headings */
h1 {
  font-size: var(--pf-global--FontSize--4xl);
}

h2 {
  font-size: var(--pf-global--FontSize--3xl);
}

h3 {
  font-size: var(--pf-global--FontSize--2xl);
}

h4 {
  font-size: var(--pf-global--FontSize--xl);
}

h4 {
  font-size: var(--pf-global--FontSize--lg);
}
/* End of headings resize */

a {
    cursor: pointer;
}

p + p {
    // The mix of PF3 and PF4 removes margin from paragraphs.
    // We want successive paragraphs to have spaces between each other.
    margin-top: var(--pf-global--spacer--md);
}

.disabled {
    pointer-events: auto;
}

.btn {
    min-height: 26px;
    min-width: 26px;
}

.btn.disabled, .pf-c-button.disabled {
    pointer-events: auto;
}

.btn.disabled:hover, .pf-c-button.disabled:hover {
  z-index: auto;
}

.btn-group, .btn-group-vertical {
    /* Fix button groups from wrapping in narrow widths */
    display: inline-flex;
}

.btn-group-vertical {
    /* Vertical btn-groups should be vertical */
    flex-direction: column;
}

a.disabled {
    cursor: not-allowed !important;
    text-decoration: none;
    pointer-events: none;
    color: #8b8d8f;
}

a.disabled:hover {
    text-decoration: none;
}

.dropdown-menu > li > a.disabled,
.dropdown-menu > li > a.disabled:hover,
.dropdown-menu > li > a.disabled:focus {
  color: var(--ct-color-subtle-copy);
}

.dropdown-menu > li > a.disabled:hover,
.dropdown-menu > li > a.disabled:focus {
  text-decoration: none;
  background-color: transparent;
  background-image: none;
  border-color: transparent;
  cursor: default;
}

/* Limit dropdown menus to 90% of the viewport size */
.dropdown-menu {
    height: auto;
    overflow-y: auto;
    max-height: 90vh;
}

/* Allow kebab menus to have a ^ with overflowing */
/* Note: This means kebab menus cannot be _too_ long */
.dropdown-kebab-pf > .dropdown-menu {
    overflow: visible;
}

/* Align these buttons more nicely */
.btn.fa-minus,
.btn.fa-plus {
    padding-top: 4px;
}

.highlight-ct {
    background-color: var(--ct-color-link-hover-bg);
}

.curtains-ct {
    top: 0px;
    height: 100%;
    width: 100%;
    position: fixed;
}

.panel .well {
    margin-bottom: 0px;
    border: none;
    border-radius: 0px;
    background-color: var(--pf-global--palette--black-200);
}

.well.blank-slate-pf {
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.05) inset;
    padding-top: 40px;
}

.blank-slate-pf .spinner-lg {
    height: 58px;
    width: 58px;
}

/* Small list inside a dialog */
/* Alert fixups */

.modal-content .pf-c-alert {
    text-align: left;
    margin-bottom: 24px;
}
/* Dialog patterns */

.dialog-wait-ct {
    margin-top: 3px;
    /* Right align footer idle messages after the buttons */
    margin-left: auto;
}

.dialog-wait-ct .spinner {
    display: inline-block;
    /* Add spacing between possible messages and the spinner */
    margin-left: var(--pf-global--spacer--md);
}

.dialog-wait-ct span {
    vertical-align: 4px;
    padding-left: 10px;
}

.dialog-list-ct {
    max-height: 230px;
    overflow-x: auto;
    border: 1px solid var(--pf-global--palette--black-300);
    margin-bottom: 0px;
}

/* HACK: https://github.com/patternfly/patternfly/issues/255 */
input[type=number]:not(.pf-c-form-control) {
  padding: 0 0 0 5px;
}

/* Make a dialog visible */
.dialog-ct-visible {
    display: block;
}

:root {
    /* Cockpit custom colors */
    --ct-color-light-red: #f8cccc;
    --ct-color-red-hat-red : #ee0000;

    // Blend between --pf-global--palette--black-200 and 300
    --ct-global--palette--black-250: #e6e6e6;

    /* Semantic colors */
    --ct-color-fg: var(--pf-global--color--100);
    --ct-color-bg: var(--pf-global--BackgroundColor--100);
    --ct-color-text: var(--ct-color-fg);

    --ct-color-link        : var(--pf-global--active-color--100);
    --ct-color-link-visited: var(--pf-global--active-color--100);

    --ct-color-subtle-copy: var(--pf-global--disabled-color--100);

    // General border color (semantic shortcut, instead of specifying the color directly)
    --ct-color-border: var(--pf-global--BorderColor--100);

    // Used for highlighting link blocks (with a light background blue)
    --ct-color-link-hover-bg  : var(--pf-global--palette--light-blue-100);

    /* Colors used for custom lists */
    // as seen in Journal, Listing, Table widgets and pages like Machines, Updates, Services
    --ct-color-list-text               : var(--ct-color-text);
    --ct-color-list-link               : var(--ct-color-link);
    --ct-color-list-bg                 : var(--ct-color-bg);
    --ct-color-list-border             : var(--ct-color-border);
    --ct-color-list-hover-text         : var(--ct-color-link);
    --ct-color-list-hover-bg           : var(--pf-global--BackgroundColor--150);
    --ct-color-list-hover-border       : var(--pf-global--BackgroundColor--150);
    --ct-color-list-hover-icon         : var(--pf-global--palette--light-blue-400);
    --ct-color-list-selected-text      : var(--ct-color-link);
    --ct-color-list-selected-bg        : var(--pf-global--BackgroundColor--150);
    --ct-color-list-selected-border    : var(--pf-global--BackgroundColor--150);
    --ct-color-list-active-text        : var(--pf-global--palette--blue-500);
    --ct-color-list-active-bg          : var(--ct-color-bg);
    --ct-color-list-active-border      : var(--ct-color-list-border);
    --ct-color-list-critical-bg        : var(--pf-global--palette--red-50);
    --ct-color-list-critical-border    : #e6bcbc; // red-500 mixed with white @ 50%
    --ct-color-list-critical-alert-text: var(--pf-global--palette--red-200);
}

[hidden] { display: none !important; }

// Let PF4 handle the scrolling through page component otherwise we might get double scrollbar
html:not(.index-page) body {
  overflow-y: hidden;

  // Ensure UI fills the entire page (and does not run over)
  .ct-page-fill {
    height: 100% !important;
  }
}

/* Add some spacing to nested form groups - PF4 does not support them */
/* https://github.com/patternfly/patternfly-react/issues/5023 */
.pf-c-form__group-control {
    > .pf-c-form__group, .pf-c-form__section {
        padding-top: var(--pf-global--spacer--md);
    }
}

// When there is an Alert above the Form add some spacing
.pf-c-modal-box .pf-c-alert + .pf-c-form {
    padding-top: var(--pf-global--FontSize--sm);
}

.ct-icon-exclamation-triangle {
    color: var(--pf-global--warning-color--100);
}

.ct-icon-times-circle {
    color: var(--pf-global--danger-color--100);
}
