//
// Chart
// --------------------------------------------------

@color-status-list-text:          #7e8c8d;
@color-chart-tooltip-bg:          #000000;
@color-chart-tooltip-text:        #ffffff;

.control-chart-non-centered() {
    text-align: left;

    .canvas {
        margin-right: 20px;
        display: inline-block;
    }
}

//
// Chart
// --------------------------------------------------

.control-chart {
    div.canvas {
        display: inline-block;
        margin-right: 20px;
        margin-bottom: 20px;
        position: relative;

        span.center {
            position: absolute;
            display: block;
            text-align: center;
            width: 100%;
            top: 50%;
            margin-top: -21px;
            font-size: 30px;
            font-weight: 100;
            color: @color-scoreboard-title;
            z-index: @zindex-chart - 1;
        }

        svg {
            z-index: @zindex-chart;
        }
    }

    &.full-width div.canvas {
        margin-right: 0 !important;
    }

    ul {
        display: inline-block;
        height: inherit;
        margin: 0;
        padding: 0;
        list-style: none;
        position: relative;
        vertical-align: top;

        li {
            width: 120px;
            white-space: normal;
            display: block;
            text-transform: uppercase;
            color: @color-scoreboard-title;
            font-weight: 300;
            font-size: 12px;
            margin-bottom: 10px;

            span {
                float: right;
                font-weight: 600;
            }

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

    div.chart-legend {
        display: inline-block;
        vertical-align: top;
        text-align: left;

        table {
            font-size: 12px;
            color: @color-scoreboard-body;

            tr {
                td {
                    padding: 0 0 7px 0;
                    vertical-align: top;

                    &.value {
                        padding-left: 10px;
                        font-weight: 600;
                        color: @color-scoreboard-description;
                    }

                    i {
                        display: inline-block;
                        width: 13px;
                        height: 13px;
                        border-radius: @border-radius-base;
                        text-indent: -100000em;
                        margin-right: 5px;
                        position: relative;
                        top: 2px;
                    }

                    &.indicator {
                        width: 20px;
                    }
                }

                &:last-child td {
                    padding-bottom: 0;
                }
            }
        }
    }

    .control-chart-non-centered();

    &.centered {
        text-align: center;

        .canvas {
            margin-right: 0;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }
    }

    &.wrap-legend div.chart-legend table tr {
        display: inline-block;
        white-space: nowrap;
        margin-right: 20px;

        &:last-child td {
            padding-bottom: 7px;
        }
    }
}

.report-container .wrapped .control-chart {
    .control-chart-non-centered();
}

.tickLabel, .flot-tick-label {
    color: #545454;
}

[data-bs-theme="dark"] {
    .tickLabel, .flot-tick-label {
        color: #e0e0e0;
    }
}

#flotTip, #chart-tooltip {
    white-space: nowrap;
    padding: @tooltip-padding;
    background: @tooltip-bg;
    position: absolute;
    z-index: @zindex-tooltip;
    color: @tooltip-color;
    border-radius: @tooltip-border-radius;
    font-size: @tooltip-font-size;
    opacity: @tooltip-opacity;
}

.title-value {
    span.goal-meter-indicator {
        float: left;
        height: 24px;
        width: 10px;
        margin-right: 5px;
        position: relative;
        top: 9px;
        background: @color-scoreboard-negative;

        > span {
            text-indent: -10000em;
            display: block;
            position: absolute;
            width: 10px;
            left: 0;
            bottom: 0;
            background: @color-scoreboard-positive;
            height: 0;
            .transition(all 0.2s);
        }
    }

    &.goal-meter-inverse {
        span.goal-meter-indicator {
            background: @color-scoreboard-positive;
            > span {
                background: @color-scoreboard-negative;
            }
        }
    }
}

.report-container {
    .title-value {
        margin-top: -18px;

        p {
            font-weight: 100;
            font-size: 40px;

            &.description {
                font-size: 12px;
                margin-top: 9px;
            }

            &:before {
                font-size: 30px;
                margin-right: 10px;
            }

            &.negative, &.positive {
                &:after {
                    top: -8px;
                }
            }
        }

        span.goal-meter-indicator {
            height: 31px;
            top: 4px;
            width: 15px;
            margin-right: 10px;

            span {
                width: 15px;
            }
        }
    }
}

//
// Status list
// --------------------------------------------------

.control-status-list > ul {
    margin-bottom: 0;
    padding: 0;

    li {
        margin: 0;
        padding: 7px 15px 6px;
        list-style: none;
        display: block;
        font-size: @font-size-base - 1;
        color: @color-status-list-text;
        border-bottom: 1px solid @border-color;

        &:last-child {
            border-bottom: none;
        }

        a:not(.btn) {
            color: @color-status-list-text;
            text-decoration: none;
            &:hover {
                color: @link-color;
                text-decoration: none;
            }
        }

        a.btn:hover {
            color: white;
        }

        .status-text {
            margin: 0 5px;

            &.muted { color: @text-muted; }
            &.primary { color: @brand-primary; }
            &.success { color: @state-success-text; }
            &.info { color: @state-info-text; }
            &.warning { color: @state-warning-text; }
            &.danger { color: @state-danger-text; }
        }

        .status-label {
            display: block;
            float: right;
            padding: 1px 10px;

            &.btn {
                border-radius: 20px;
            }
        }

        .status-icon {
            display: inline-block;
            text-align: center;
            color: white;
            width: 22px;
            height: 22px;
            position: relative;
            top: -1px;
            .border-radius(100px);

            > i {
                font-size: 12px;
                line-height: 22px;
            }
        }

        .status-icon {
            background: #999;
            &.success { background: @brand-success; }
            &.primary { background: @brand-primary; }
            &.warning { background: @brand-warning; }
            &.danger { background: @brand-danger; }
            &.info { background: @brand-info; }
            &.link { background: transparent; }
        }
    }
}

.report-container {
    .control-status-list > ul {
        margin: -15px;
    }
}
