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

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

.pf-c-table tr:nth-child(1) {
    > td, th {
        --pf-c-table--cell--PaddingTop: 0.5rem;
        --pf-c-table--cell--PaddingBottom: 0.5rem;

        padding: var(--pf-c-table--cell--PaddingTop) var(--pf-c-table--cell--PaddingRight) var(--pf-c-table--cell--PaddingBottom) var(--pf-c-table--cell--PaddingLeft);
    }
}

.pk-updates--header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0 1rem;

    &--actions {
        > .pf-c-button,
        > .btn-group {
            margin: 5px 5px 0 0;

            &:last-child {
                margin-right: 0;
            }
        }
    }
}

@media screen and (min-width: 640px) {
    .pk-updates--header--auto {
        justify-content: flex-start;
    }
}

// Make header's content bold
.pf-c-table tr:nth-child(1) td:nth-child(2) {
    font-weight: var(--pf-global--FontWeight--bold);
}

.ct-table tr {
    .severity-icon {
        margin-right: var(--pf-global--spacer--xs);
    }

    td.changelog {
        vertical-align: top;

        * {
            display: inline;
            font: inherit;
            background: inherit;
            color: inherit;
        }

        &, p {
            max-width: 60vw;
            margin-bottom: 0;  // counter-act <Markdown>
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }

    th:last-child,
    td.changelog:last-child {
        text-align: left;
    }
}

.severity-critical {
    color: #a30000;
}

.severity-important {
    color: #ec7a08;
}

.severity-low {
    color: var(--ct-color-subtle-copy);
}

// backport "pficon-*" for usage on RHEL/CentOS 7
@font-face {
    font-family: "pf-symbols";
    font-style: normal;
    font-weight: 400;
    src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAa0AA0AAAAACuwAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGmAAAABwAAAAchPYqgUdERUYAAAZ8AAAAGwAAAB4AJwALT1MvMgAAAaAAAAA/AAAAYPhMBnFjbWFwAAAB9AAAAEoAAAFa6UPtOGdhc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V2e2BZECrLXb7Fo71P6CPofxZfAjk9Iepj5MP9Lbtht2SfvCWf1HV0ofWsKZR+oZ/L/tSibCH7Exv46phACi35AfSVpFkUjqQelF+B0p3lAusHNcdgbCY8845YJSEMxy7U/HIaye0o2ArDumUV0SqbWDKtRhi2ZbQto7Ts1wq2LcT8h+dMbN+3J44HyHlBTNDmnIOjXAGnopAX7EYYhhAla07qu9VqFsedoNzy3Irj+BwF45wJ5J7rVFyvGQSdOM6q1d061RvdFR3Pcz5qki9oM47ImY3wLh+tWcT82z8mh1zfAAB4nK2SzUojQRSFT7XxJwlmJRFm1Q9gqoMODLgTTUggiijILAax0lZ+oO0O3RWavIU7X2GY9/AdfAz3buZ05Qq6TxfdfHXvrXNuXRpAW7WgUD0Kh+gKB9jFb+Etxp+Fa+Q34W001Z7wDg7VhXAduyoRbuCH+ifcJH8I76MRHAm3EAUvdFG1OiPaO1YcMDMQ3mL8QbhG/iu8jTbehXeg1YFwHS31R7iBn8oJN8mvwvs4CNrCLdwHv3ANA8dlkSNFHwlWGCJGxl2BDkpmxpj4vQOujXM2T/vJahhnadEp7XiSpUzcsG6KJc8bKuHGTpeJIWxKf1M6d16hwNxXhjjhZLsM27yYZ2l4orub86pm8kiPgdfjTB7DgSH05WTIiVlS5WO8X1U9plsofpd8q1r+IX1KhlOb2tw4Co1XId0usyxlbubbXbC5U0RcpV+aka8XmfiLaArmNMbMuUVxGkVlWerF+gqTZKWznLkzfzSmsGUvx+sZnS1MPLPhcTWiT8fvfubLsU+fiK5zxqwfnuUbYcTrnaOHK9zy2xED7VWfWO97k9aMd63aipJ5bNPCFtFoeN67uu112IqeuacE/wGTkbVXeJxjYGJABowM6IAVKMjEwMTIzMjClp5TWZBhyF6al+lqaewIoU3MAFiyBvIAAQAB//8AD3icY2BkYGDgAWIxIGZiYARCFjAG8RgAA8oAMwAAAAABAAAAANambVUAAAAA1u0fsAAAAADXYp17) format("woff");

    unicode-range: U+E946, U+E93A;
}

.pficon-security:before {
    content: "\e946";
    font-family: pf-symbols;
}

.pficon-enhancement:before {
    content: "\e93a";
    font-family: pf-symbols;
}

td.type {
    > .pficon,
    > .fa {
        margin: calc(-0.5 * var(--pf-global--spacer--xs)) var(--pf-global--spacer--xs) 0 0;
        vertical-align: middle;
    }
}

div.changelog {
    max-height: 20em;
    overflow: auto;
    white-space: pre-wrap;
}

/* Hide changelog summaries in narrow widths */
@media screen and (max-width: 80ch) {
    table.ct-table {
        /* Hide changelog header (there's no class) & data */
        thead th:last-child,
        td.changelog {
            display: none;
        }
    }
}

/* don't let the install progress bar get too wide */
.progress-main-view {
    max-width: 60rem;
    margin: 10ex auto 0;
}

/* workaround font not supporting tabular numbers yet https://github.com/cockpit-project/cockpit/issues/15090 */
.pf-c-progress__status {
    min-width: 3ch;
}

/* don't let the install progress bar get too wide */
.progress-cancel {
    display: flex;
    margin: 1em auto;
}

/* Add some space betweent the spinner and the text */
.progress-description > svg {
    margin-right: var(--pf-global--spacer--sm);
}

/* fixed width to avoid jumpy text between expanded/collapsed */
.expander-caret {
    width: 2ex;
}

.expander-title {
    margin-bottom: 2em;
    display: flex;
    align-items: center;
    hr {
        flex: auto;
    }
    span {
        padding: 1ex;
        flex: none;
    }
}

.flow-list-blank-slate {
    margin: 0 auto;
    max-width: 69rem;
    text-align: center;
}

.flow-list {
    padding: 0;
    max-width: 110rem;
    text-align: left;
    box-sizing: border-box;

    li {
        text-align: left;
        box-sizing: border-box;
        width: 22rem;
        padding: 0 1ex;
        display: inline-block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-weight: 600;
    }
}

.update-log {
    margin: 0 auto;
    max-width: 69rem;
    text-align: center;
    th {
        text-align: left;
        padding-right: 3ex;
    }
    td {
        text-align: left;
    }
}

.update-log-content {
    margin: 0 10ex;
    height: 13em;
    overflow-y: auto;
}

table.header-buttons {
    margin-bottom: 20px; /* replacement for h2's margin-bottom */
    td {
        vertical-align: middle;
    }
    h2 {
        margin: 0 4rem 0 0; /* vertical default ones break vertical alignment */
    }
}

#auto-update-day {
    max-width: 10rem;
}

#auto-update-time {
    max-width: 7rem;
}

.auto-update-group {
    // Add spacing between rows for when the flex items wrap
    row-gap: var(--pf-global--spacer--sm);
}

.pk-updates .pf-c-description-list + div {
    padding-top: var(--pf-global--spacer--md);
}

.restart-services-modal-body {
    padding: 1em 0;
}

.pf-c-content ul {
    list-style-type: none;
}

.updates-success-table {
    margin-bottom: 1em;
}

.update-success-actions > button {
    margin: 0.25rem 0 0.25rem 0.5rem;
}

.update-success-table-title {
    padding-left: 0.5em;
}

.cockpit-update-warning {
    margin-right: 1rem;
}

.cockpit-update-warning-icon {
    margin-right: 0.5rem;
}

.cockpit-update-warning-text {
    color: var(--pf-global--warning-color--200);
}

.autoupdates-card-error {
    margin-bottom: var(--pf-global--spacer--md);
}
