/**
 * 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/>.
 */

@use "./widgets/contacts";
@use "./widgets/heartbeat";
@use "./widgets/imageviewer";
@use "./widgets/lastcommit";
@use "./widgets/myprojects";
@use "./widgets/project-members";
@use "./widgets/trackerv3";
@use "./widgets/project-classification";
@use "./widgets/welcomemessage";
@use "./widgets/public-areas";

.dashboard-widget-container {
    width: 100%;

    .empty-state-text {
        font-size: 0.875rem;
    }
}

/* stylelint-disable selector-no-qualifying-type */
.dashboard-widget-asynchronous-loading,
.tlp-table > tbody > tr:nth-child(odd) > td.dashboard-add-widget-content-loading,
.edit-widget-modal-content-loading {
    height: 200px;
    background: var(--tlp-white-color) url("../../images/spinner.gif") center center no-repeat;
}
/* stylelint-enable */

.dashboard-widget:not(.dashboard-widget-minimized)
    > .dashboard-widget-container
    > .dashboard-widget-header {
    padding-bottom: 0;
}

.dashboard-widget-header {
    display: flex;
    justify-content: space-between;

    &.dashboard-widget-movable {
        cursor: move;
    }
}

.dashboard-widget-icons {
    display: flex;
    gap: var(--tlp-small-spacing);
    cursor: default;
}

.dashboard-widget-icons-minimize,
.dashboard-widget-actions {
    transition: color 100ms;
    color: var(--tlp-neutral-dark-color);
    font-size: 0.8rem;
    cursor: pointer;

    &:hover {
        color: var(--tlp-main-color);
    }
}

.dashboard-widget-content {
    overflow: auto hidden;
}

.dashboard-add-widget-body {
    padding: 0;
}

.dashboard-add-widget-content {
    display: flex;
}

.dashboard-add-widget-list {
    flex: 1;
    padding: var(--tlp-medium-spacing);
}

.dashboard-add-widget-list-body {
    max-height: 50vh;
    overflow: hidden scroll;
}

#dashboard-add-widget-settings {
    flex: 1;
    padding: var(--tlp-medium-spacing);
    border-left: 1px solid var(--tlp-neutral-light-color);
}

.dashboard-add-widget-settings-content {
    display: flex;
    flex-direction: column;
}

.dashboard-add-widget-settings-image {
    align-self: center;
}

.dashboard-add-widget-list-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.dashboard-add-widget-list-table-widget {
    cursor: pointer;
}

/* stylelint-disable selector-no-qualifying-type */
.tlp-table > tbody > tr.dashboard-add-widget-list-table-widget-selected {
    > .dashboard-add-widget-list-table-widget-content-name,
    > .dashboard-add-widget-list-table-widget-content-link,
    > .dashboard-add-widget-list-table-widget-content-used {
        background: var(--tlp-main-color-transparent-90);
    }

    > .dashboard-add-widget-list-table-widget-content-link
        > .dashboard-add-widget-list-table-widget-content-link-icon {
        transform: scale(1.2);
        color: var(--tlp-main-color);
    }
}
/* stylelint-enable */

.dashboard-add-widget-list-table-widget-content-name {
    width: 100%;
}

.dashboard-add-widget-list-table-widget-content-link,
.dashboard-add-widget-list-table-widget-content-used {
    transition: transform 50ms linear;
    color: var(--tlp-dimmed-color);
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
}

#dashboard-add-widget-settings-empty {
    height: 100%;
}
