@import "variables.scss";

$table-border-width: 1px;
$table-border-color: #dee2e6;
$spacer: 10px;
$table-bg: none;
$table-cell-padding: 10px;
$body-bg: none;

.table {
    width: 100%;
    margin-bottom: $spacer;

    td,
    th {
        padding: $table-cell-padding;
        vertical-align: top;
        border-top: $table-border-width solid $table-border-color;
    }

    thead th {
        vertical-align: bottom;
        border-bottom: (2 * $table-border-width) solid $table-border-color;
    }

    tbody + tbody {
        border-top: (2 * $table-border-width) solid $table-border-color;
    }

    .table {
        background-color: $body-bg;
    }
}

.table {
    margin: 20px 0;
    overflow-x: auto;

    .table-row {
        display: flex;
        flex-basis: 100%;
        border-top: 1px solid #dee2e6;

        > div {
            padding: .75rem;
            vertical-align: top;
        }
    }

    .table-head {
        display: flex;
        flex-direction: row;
        font-weight: bold;

        .table-row {
            border: none;
            border-bottom: 1px solid #dee2e6;
        }
    }

    .table-body {
        display: flex;
        flex-direction: column;
    }
}

.table-preset {
    display: grid;
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.table-preset > .d-contents > .d-contents > div {
    padding: 8px;
}

.table-preset-head {
    font-weight: bold;
    border: none;
    border-bottom: 1px solid #dee2e6;

    a {
        color: inherit;
    }
}

.table-preset-params {
    grid-template-columns: minmax(150px, 350px) 100px 100px 200px minmax(350px, 1fr);
}

.table-preset-headers {
    grid-template-columns: minmax(150px, 350px) 100px 200px minmax(350px, 1fr);
}

.table-preset-schema {
    grid-template-columns: minmax(150px, 350px) 100px 200px minmax(350px, 1fr);
}

.table-preset-definitions {
    grid-template-columns: minmax(150px, 350px) minmax(350px, 1fr);
}

.table-preset-enum {
    grid-template-columns: minmax(150px, 350px) minmax(350px, 1fr);
}

.table-preset-reports {
    grid-template-columns: minmax(150px, 1fr) 120px 120px 120px 120px 120px 120px 120px;

    .table-preset-head {
        button {
            text-align: left;
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            height: 100%;

            .btn-addon {
                min-width: 1.5em;
            }
        }
    }
}

.table-preset-gql {
    grid-template-columns: minmax(150px, 350px) 200px minmax(350px, 1fr);
}

.table-preset-ws-logs {
    grid-template-columns: auto auto 1fr;
    margin: none;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.5);
    max-height: 250px;

    & > .d-contents > .d-contents > div {
        padding: 4px;
        vertical-align: middle;
    }
}

table {
    width: 100%;

    thead {
        border-bottom: 1px solid #dee2e6;
    }

    td,
    th {
        padding: 8px 4px;
    }
}
