@use "variables" as *;

.ecw-log-table {
    table-layout: fixed;
    width: 100%;

    > thead > tr > th,
    > tbody > tr > td {
        &:nth-child(1) { width: 90px; }
        &:nth-child(2) {
            width: 75px;
        }
        &:nth-child(3) {
            width: 190px;
        }
        &:nth-child(4),
        &:nth-child(5) {
            width: 70px;
        }
        &:nth-child(6) {
            width: 50px;
            text-align: right;
        }
        &:nth-child(7),
        &:nth-child(8) {
            width: 70px;
            text-align: right;
        }
        &:nth-child(9) {
            width: 50px;
            padding-left: 0;
            padding-right: 0;
            text-align: center;
        }
    }

    td {
        font-size: $font-size-small;
        vertical-align: middle;
    }

    code {
        white-space: nowrap;
        display: inline-block;
    }

	&__mode.is-updated {
		cursor: help;
	}

    &__view-button.components-button {
        justify-content: center;
        margin-left: auto;
    }

    &__started {
        display: inline-flex;
        flex-direction: column;
        gap: 1px;
        line-height: 1.2;
        white-space: nowrap;
    }

    &__started-date {
        font-variant-numeric: tabular-nums;
    }

    &__started-time {
        color: $color-text-secondary;
        font-size: $font-size-small;
        font-variant-numeric: tabular-nums;
    }

    tr.is-expanded > td {
        // background: #fbfcff;
    }

    &__details-row > td {
        padding: 0 !important;
        border-top: 0;
        background: #fff;
    }

    &__details-panel {
        padding: $spacing-sm $spacing-md $spacing-md;
        border-top: 1px solid $color-border;
        border-bottom: 2px solid $color-border;
    }

    &__details-empty {
        margin: 0;
        color: $color-text-secondary;
    }

    &__details-overflow {
        margin: 0;
        padding-top: $spacing-md;
        font-size: $font-size-small;
        border-top: 1px solid $color-border;
        color: $color-text-muted !important;
        text-align: center;
        &--truncated {
            padding-top: 0;
            border: none;
        }
    }



    &__details-load-actions {
        text-align: center;
        margin-top: $spacing-sm;
        .components-notice {
            margin-top: $spacing-sm;
            text-align-last: left;
        }
    }

    &__details-scroll {
        width: 100%;
        overflow-x: auto;
    }

    &__details-table {
        width: 100%;
        min-width: 520px;
        border-collapse: collapse;
        table-layout: fixed;

        th,
        td {
            padding: 8px 10px;
            border-bottom: 1px solid #dce4ec;
            vertical-align: middle;
        }

        th:nth-child(1),
        td:nth-child(1) {
            width: 96px;
        }

        th:nth-child(3),
        td:nth-child(3) {
            width: 64px;
            text-align: center;
        }

        th:nth-child(4),
        td:nth-child(4) {
            width: 64px;
            text-align: center;
        }

        th:nth-child(5),
        td:nth-child(5) {
            width: 84px;
        }

        tbody tr:last-child td {
            border-bottom: 0;
        }
    }

    &__url-cell {
        code {
            display: inline-block;
            max-width: 100%;
            white-space: normal;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .description {
            margin-top: 4px;
            color: #7a1f1f;
        }
    }

    &__result-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        padding: 2px 8px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.3;
        white-space: nowrap;
        text-transform: capitalize;
        letter-spacing: 0.01em;

        &.is-warmed {
            background: #e7f7ed;
            color: #0f6034;
        }

        &.is-failed {
            background: #fdeceb;
            color: #8a1c1c;
        }

        &.is-queued {
            background: #e8f1fb;
            color: #0a4b78;
        }

        &.is-other {
            background: #eceff3;
            color: #374149;
        }
    }

    &__icon-actions {
        // display: flex;
        // justify-content: flex-end;
        // gap: 4px;
    }

    &__icon-button.components-button {
        min-width: 30px;
        width: 30px;
        height: 30px;
        padding: 0;
        border-radius: 6px;
        color: $color-text-primary;
        background: transparent;
        border: 1px solid transparent;

        &:hover {
            background: #eef4fb;
            border-color: #c7d8ea;
            color: #0a4b78;
        }

        &:focus-visible {
            background: #eef4fb;
            border-color: #72aee6;
            box-shadow: 0 0 0 1px #72aee6;
            color: #0a4b78;
            outline: none;
        }
    }
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Diganostics

*/

.ecw-diagnostics-table {
    min-width: 400px;
    max-width: 600px;
    code {
        white-space: nowrap;
    }
}
