@import 'node_modules/argo-ui/src/styles/config';

.applications-tiles {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill,minmax(370px,1fr));
    padding: 0 12px;

    &__wrapper {
        height: 100%;
    }

    &__item {
        display: flex;
        flex-direction: column;
        &__small {
            font-size: 14px;
            margin-bottom: 3px;
        }
    }

    &__actions {
        margin-top: auto;
    }

    .argo-table-list__row {
        padding-top: 0;
        padding-bottom: 0;

        .columns.applications-tiles__field-label {
            overflow: visible;
            white-space: nowrap;
            text-overflow: clip;
        }

        .columns.applications-tiles__title-col {
            overflow: visible;
            white-space: normal;
            text-overflow: clip;
        }
    }
    &__selected {
        box-shadow: 0 0 0 1px $argo-color-teal-5;
    }

    .applications-list__title {
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.4;
    }

    .applications-tiles__title-col {
        display: flex;
        align-items: center;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;

        .applications-list__title {
            width: auto;
            flex: 1 1 auto;
            overflow: visible;
        }
    }

    .applications-tiles__fields {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 1rem;
        align-items: baseline;
    }

    .applications-tiles__field-row {
        display: contents;

        &::before,
        &::after {
            display: none;
        }
    }

    .applications-tiles__field-label {
        width: auto;
        max-width: none;
        float: none;
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
        white-space: nowrap;
        text-overflow: clip;
    }

    .applications-tiles__field-value {
        width: auto;
        max-width: none;
        float: none;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .applications-list__external-link {
        align-items: center;
        display: flex;

        button {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            margin: 0;
            color: inherit;
            display: flex;
            align-items: center;
            justify-content: center;

            &:hover {
                color: $argo-color-teal-5;
            }

            &.managed-by-url-invalid {
                color: #f4c030;

                &:hover {
                    color: #f4c030;
                }
            }

            i {
                font-size: 14px;
            }
        }
    }
}

// Tippy renders the tooltip on document.body, so this rule must be global.
// Hide once button labels are visible (show-for-xxlarge).
@media screen and (min-width: calc(map-get($breakpoints, xxlarge) - 1px)) {
    .applications-tiles__action-tooltip {
        display: none !important;
    }
}
