/**
 * Copyright (c) Enalean, 2017-Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

.dashboard-widget-content-projectheartbeat-empty-no-activity,
.dashboard-widget-content-projectheartbeat-empty-no-perms,
.dashboard-widget-content-projectheartbeat-error,
.dashboard-widget-content-projectheartbeat-activities,
.dashboard-widget-content-projectheartbeat-loading {
    display: none;

    &.shown {
        display: block;
    }
}

.dashboard-widget-content-projectheartbeat-empty {
    display: none;

    &.shown {
        display: flex;
    }
}

.dashboard-widget-content-projectheartbeat-loading {
    height: 200px;
    background: url("../../images/spinner.gif") no-repeat center center;
}

.widget-project-heartbeat-empty-icon {
    fill: var(--tlp-illustration-main-color);
}

$timeline-color: var(--tlp-main-color-lighter-90);

.dashboard-widget-content-projectheartbeat-activities {
    position: relative;
    padding: var(--tlp-medium-spacing) 0;

    &::before {
        content: "";
        position: absolute;
        z-index: 1;
        top: 0;
        left: 10px;
        width: 4px;
        height: 100%;
        background: linear-gradient(
                to top,
                var(--tlp-white-color) 0,
                $timeline-color var(--tlp-medium-spacing),
                transparent var(--tlp-medium-spacing) + 1px
            ),
            linear-gradient(
                to bottom,
                var(--tlp-white-color) 0,
                $timeline-color var(--tlp-medium-spacing)
            );
    }
}

.dashboard-widget-content-projectheartbeat-label {
    display: inline-block;
    position: relative;
    z-index: 2;
    margin: var(--tlp-medium-spacing) 0;
    padding: 5px;
    border-radius: var(--tlp-small-radius);
    background: $timeline-color;
    color: var(--tlp-main-color);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 7px;
    text-transform: uppercase;

    &:first-child {
        margin: 0 0 var(--tlp-medium-spacing);
    }
}

.dashboard-widget-content-projectheartbeat-item {
    display: flex;
    position: relative;
    z-index: 2;
    align-items: flex-start;
    margin: 0 0 var(--tlp-medium-spacing);

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

.dashboard-widget-content-projectheartbeat-item-icon {
    display: flex;
    position: relative;
    top: 1px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0 var(--tlp-small-spacing) 0 0;
    border-radius: 50%;
    background: var(--tlp-main-color-lighter-90);
    color: var(--tlp-main-color);
    font-size: 0.75rem;
}

.dashboard-widget-content-projectheartbeat-item-content {
    margin-top: 3px;
}

.dashboard-widget-content-projectheartbeat-item-message {
    margin: 0 0 calc(var(--tlp-small-spacing) / 2);
    font-size: 0.875rem;
    line-height: 1.3rem;

    > .direct-link-to-artifact {
        color: inherit;

        > .cross-ref-badge {
            flex: 0 0 auto;
            margin: -3px calc(var(--tlp-small-spacing) / 2) 0 0;
        }
    }

    > a {
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.dashboard-widget-content-projectheartbeat-item-metadata {
    color: var(--tlp-dimmed-color);
    font-size: 0.75rem;
}

.dashboard-widget-content-projectheartbeat-item-metadata-user {
    color: var(--tlp-dimmed-color);
}
