$bubbleSize: 15px;

$unclickable: #a1a1a1;

$bcell: #2794bf;
$tcell: #2c9659;
$nkcell: #986ea4;
$default: #959595;
$cd4: #71c7c6;

$mesoderm: #7796cb;
$ectoderm: #eb9486;
$mesendoderm: #8e7ec9;
$mesectoderm: #be9292;
$stem: #f3de8a;
$unlabeled: #a0a0a0;
$endoderm: #b17fc1;

$mesoderm-light: #bed0ef;
$ectoderm-light: #f9e0dc;
$mesendoderm-light: #c0b7e1;
$mesectoderm-light: #d9bfbf;
$stem-light: #fbf4da;
$unlabeled-light: #d1d1d1;
$endoderm-light: #ddc8e4;

$default-active: #36586d;
$default-hover: #f2f2f2;

.immune-cells-matrix {
    .file-gallery-facets {
        .show-hide-facets {
            top: 40px;
        }

        &.expanded {
            padding: 5px 10px;
            flex: 0 1 10px;
        }

        &.collapsed {
            flex: 0 1 10px;
        }

        /* stylelint-disable-next-line media-feature-name-disallowed-list */
        @media screen and (max-width: $screen-md-min) {
            border-right: 0;
        }
    }
}

.immune-cells-legend, .immune-cells-buttons {
    position: absolute;
    top: 60px;
    padding: 10px;
    font-size: 0.8rem;

    @media screen and (min-width: $screen-md-min) {
        font-size: 1rem;
    }

    .layer-bubble {
        &.cd4 {
            background: $cd4;
        }

        &.tcell {
            background: $tcell;
        }

        &.bcell {
            background: $bcell;
        }

        &.nkcell {
            background: $nkcell;
        }

        &.stem {
            background: $stem;
        }

        &.default {
            background: $default-active;
        }
    }
}

.immune-cells-buttons {
    left: 20px;

    button {
        display: inline-block;
        margin-right: 3px;
    }
}

.immune-cells-legend {
    width: 120px;
    right: 20px;
    border: 1px solid #d2d2d2;
}

.immune-cells-graph {
    svg {
        max-width: 100%;
        font-size: 0.8rem;

        @media screen and (min-width: $screen-md-min) {
            font-size: 1rem;
        }
    }

    .cell-group {
        &:hover {
            cursor: pointer;
        }
    }

    .unclickable {
        pointer-events: none;
        fill: $unclickable;
        stroke-width: 1px;

        ellipse, circle, line, path {
            fill: $unclickable;
            stroke: #f3f3f3;
        }
    }

    .clickable {
        pointer-events: all;

        ellipse, circle, line, path {
            fill: white;
            stroke: black;
            stroke-width: 1px;

            &:hover {
                cursor: pointer;
            }
        }

        &.active-cell {
            &.default {
                ellipse, circle, line, path {
                    fill: $default-active;
                    stroke: black;

                    &.st0 {
                        fill: lighten($default-active, 20%);
                    }
                }
            }

            &.cd4 {
                ellipse, circle, line, path {
                    fill: $bcell;
                    stroke: black;

                    &.st0 {
                        fill: lighten($cd4, 15%);
                    }
                }
            }

            &.bcell {
                ellipse, circle, line, path {
                    fill: $bcell;
                    stroke: black;

                    &.st0 {
                        fill: lighten($bcell, 15%);
                    }
                }
            }

            &.tcell {
                ellipse, circle, line, path {
                    fill: $tcell;
                    stroke: black;

                    &.st0 {
                        fill: lighten($tcell, 15%);
                    }
                }
            }

            &.nkcell {
                ellipse, circle, line, path {
                    fill: $nkcell;
                    stroke: black;

                    &.ellipse0 {
                        fill: lighten($nkcell, 15%);
                    }
                }
            }
        }
    }
}

.vertical-node-graph-thumbnail {
    min-height: 100px;

    svg {
        pointer-events: none;
    }
}

.immune-cells-error-message {
    padding: 30px;
}

.node--internal text {
    text-shadow: 0 1px 0 #fff, 0 -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff;
}

.immune-cells-graph {
    .expand-arrows {
        top: 47px;
    }
}

.immune-cells-matrix {
    width: 100%;
    overflow: hidden;
    position: relative;

    .matrix__presentation {
        @media screen and (min-width: $screen-md-min) {
            padding-left: 30px;
        }
    }

    .search-header-control {
        display: none;
    }
}

.matrix__row-data {
    &.hide {
        display: none;
    }
}

.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 2px;
}

.node-expander-collapser {
    &:hover {
        cursor: pointer;
        font-weight: bold;
    }
}

// sescc matrix-specific colors and styles
.matrix__row-data {
    th {
        &.mesoderm {
            background-color: $mesoderm;

            a {
                color: white;
            }
        }

        &.endoderm {
            background-color: $ectoderm;

            a {
                color: white;
            }
        }

        &.ectoderm {
            background-color: $ectoderm;

            a {
                color: white;
            }
        }

        &.mesendoderm {
            background-color: $mesendoderm;

            a {
                color: white;
            }
        }

        &.mesectoderm {
            background-color: $mesectoderm;

            a {
                color: white;
            }
        }

        &.unlabeled {
            background-color: $unlabeled;

            a {
                color: white;
            }
        }

        &.stem {
            background-color: $stem;
        }
    }
}

.sescc-matrix-graph {
    .link {
        fill: none;

        &.mesoderm {
            stroke: $mesoderm;
        }

        &.mesendoderm {
            stroke: $mesendoderm;
        }

        &.mesectoderm {
            stroke: $mesectoderm;
        }

        &.endoderm {
            stroke: $endoderm;
        }

        &.stem {
            stroke: $stem;
        }

        &.ectoderm {
            stroke: $ectoderm;
        }
    }

    .clickable {
        pointer-events: all;

        ellipse, circle, line, path {
            fill: white;
            stroke: black;
            stroke-width: 1px;

            &:hover {
                cursor: pointer;
            }
        }
    }

    .node {
        &.unlabeled .js-cell {
            fill: $unlabeled-light;
            stroke: #000;

            &.active-cell {
                fill: $unlabeled;
            }
        }

        &.mesoderm .js-cell {
            fill: $mesoderm-light;
            stroke: #000;

            &.active-cell {
                fill: $mesoderm;
            }
        }

        &.mesendoderm .js-cell {
            fill: $mesendoderm-light;
            stroke: #000;

            &.active-cell {
                fill: $mesendoderm;
            }
        }

        &.mesectoderm .js-cell {
            fill: $mesectoderm-light;
            stroke: #000;

            &.active-cell {
                fill: $mesectoderm;
            }
        }

        &.endoderm .js-cell {
            fill: $endoderm-light;
            stroke: #000;

            &.active-cell {
                fill: $endoderm;
            }
        }

        &.ectoderm .js-cell {
            fill: $ectoderm-light;
            stroke: #000;

            &.active-cell {
                fill: $ectoderm;
            }
        }

        &.stem .js-cell {
            fill: $stem-light;
            stroke: #000;

            &.active-cell {
                fill: $stem;
            }
        }
    }
}

.sescc__matrix-graph-container {
    position: relative;
    min-height: 130px;

    .sescc-layer-legend {
        position: relative;
        font-size: 0.8rem;
        padding: 5px;
        background: white;

        @media screen and (min-width: $screen-md-min) {
            position: absolute;
            top: -40px;
            left: 10px;
            font-size: 1rem;
        }
    }

    .badge-group {
        @media screen and (min-width: $screen-md-min) {
            position: absolute;
            top: -40px;
            right: 20px;
            width: 250px;
            text-align: right;
        }

        .title {
            font-family: Oswald;
            padding-bottom: 10px;
            font-size: 1.2rem;
        }
    }
}

.sescc-matrix-graph {
    overflow: scroll;
    margin-top: 40px;

    @media screen and (min-width: $screen-md-min) {
        overflow: hidden;
    }

    .node-text {
        tspan {
            font-size: 0.9rem;
        }
    }
}

.node-text {
    cursor: pointer;

    &:hover {
        font-weight: bold;
        background: #d2d2d2;
    }
}

.layer-element {
    display: flex;
    align-items: center;
    background: none;
    border: 0;

    .layer-bubble {
        flex: 0 1 auto;
        height: $bubbleSize;
        width: $bubbleSize;
        border-radius: $bubbleSize;
        background: red;
        margin-right: 5px;
        border: 1px solid #d2d2d2;

        &.endoderm {
            background: $endoderm;
        }

        &.mesoderm {
            background: $mesoderm;
        }

        &.mesendoderm {
            background: $mesendoderm;
        }

        &.mesectoderm {
            background: $mesectoderm;
        }

        &.ectoderm {
            background: $ectoderm;
        }

        &.stem {
            background: $stem;
        }
    }

    .layer-name {
        flex: 0 1 auto;
    }
}

.js-cell-pgpdonor-full {
    display: none;
}
