/**
 * Copyright (c) Enalean, 2016-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 "../default/main";
@use "./tracker-creation";
@use "./edit-view/comments";
@use "pkg:@tuleap/mention";
@use "pkg:@tuleap/tlp-badge";
@use "pkg:@tuleap/plugin-tracker-rich-text-editor";
@use "pkg:@tuleap/tlp/src/scss/components/switch";
@use "pkg:@tuleap/tlp/src/scss/components/panes";
@use "pkg:@tuleap/tlp/src/scss/components/cards";
@use "pkg:@tuleap/tlp/src/scss/components/tables";

/* stylelint-disable-next-line selector-class-pattern,selector-id-pattern */
.widget_content #tracker_report_table > thead > tr > th {
    border-bottom-color: #b2b2b2;
}

.tracker-report-query {
    border-top: 2px solid var(--tlp-main-color);
    border-bottom: 1px solid var(--tlp-background-color-darker-05);
    background: var(--tlp-background-color);
}

/* stylelint-disable-next-line selector-class-pattern */
.tracker_artifact_fieldset legend {
    color: var(--tlp-main-color);

    /* stylelint-disable-next-line selector-no-qualifying-type */
    &.toggler-noajax {
        border-bottom: 2px solid var(--tlp-main-color);
    }
}

.format-warning {
    color: var(--tlp-main-color);
}

/* stylelint-disable-next-line selector-id-pattern */
#tracker_artifact_followup_comments {
    position: absolute;
    box-sizing: initial;
    width: 100%;
}

/* stylelint-disable-next-line selector-class-pattern */
.table.tracker_report_table {
    thead:first-child > tr:first-child > th,
    > thead > tr > th,
    > tbody > tr > td {
        border-top-color: var(--tlp-background-color-darker-05);
        border-right-color: var(--tlp-background-color-darker-05);
        border-left-color: var(--tlp-background-color-darker-05);
    }

    > tbody > tr:last-child > td {
        border-color: var(--tlp-background-color-darker-05) !important;
    }

    /* stylelint-disable-next-line selector-no-qualifying-type */
    > thead > tr > th.drop-over {
        background: var(--tlp-background-color);
    }

    /* stylelint-disable-next-line selector-max-compound-selectors */
    > thead > tr > th > table > tbody > tr > td > form > .btn-link {
        color: var(--tlp-main-color);
    }

    /* stylelint-disable-next-line selector-class-pattern,selector-no-qualifying-type */
    > tbody > tr.tracker_report_table_aggregates > td {
        > table {
            /* stylelint-disable selector-max-compound-selectors */
            > thead > tr > th,
            > thead:first-child > tr:first-child > th {
                border-left-color: var(--tlp-background-color-darker-05);
                background: var(--tlp-background-color);
            }

            > tbody > tr > td {
                border-color: var(--tlp-background-color-darker-05);
            }
            /* stylelint-enable selector-max-compound-selectors */
        }
    }
}

/* stylelint-disable-next-line selector-class-pattern */
.tracker_artifact_followup-with_comment {
    border-left: 3px solid var(--tlp-main-color);
}

.card-details .avatar {
    display: inline-block;
    position: relative;
    top: -2px;
    left: 1px;
    width: 25px;
    height: 25px;
    border: 0;
}

.card-details .avatar > img {
    width: 25px;
    height: 25px;
}

.modal-header-with-side-panels {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.modal-header-side-panel {
    justify-content: center;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.tracker-action-button > svg {
    margin: 0 5px 0 2px;

    path {
        fill: var(--tlp-main-color);
    }
}

.alert-error.move-artifact-error {
    margin: 15px;
}

.move-artifact-display-more-field-not-migrated {
    color: var(--tlp-danger-color);
}

.move-artifact-display-more-field-partially-migrated {
    color: var(--tlp-warning-color-darker-10);
}

.move-artifact-display-more-field-fully-migrated {
    color: var(--tlp-info-color-darker-30);
}

.tracker-form-element-artifactlink-section-loading {
    margin: 0 0 0 20px;
}

.tracker-admin-permissions-per-field > tbody > tr:first-child:hover > td:first-child {
    background: #ffffff;
}

.tracker-administration-content {
    margin: 20px;
}

#tracker-settings {
    padding: 0 0 150px;
}

.tracker-form-element-artifactlink-list-nav {
    min-height: 0;
}

/* stylelint-disable selector-no-qualifying-type */
body.tracker-administration {
    background: var(--tlp-background-color);

    .main {
        #feedback > ul {
            margin: 0 20px 20px;
        }

        .content {
            padding: 0;
        }
    }
}
/* stylelint-enable */

.tracker-cross-reference-delete-link {
    color: var(--tlp-dimmed-color);

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

.tracker-cross-reference-card-deletable.tlp-card-selectable {
    $room-for-trash-icon: calc(var(--tlp-medium-spacing) + 12px);

    padding: var(--tlp-medium-spacing) calc(var(--tlp-medium-spacing) + #{$room-for-trash-icon})
        var(--tlp-medium-spacing) var(--tlp-medium-spacing);
}

.tracker-cross-reference-creation-metadata {
    display: flex;
    align-items: center;
    color: var(--tlp-dimmed-color);
    font-size: 0.75rem;
    line-height: 1.375rem;
}

.tracker-cross-reference-created-by-tlp-avatar-mini {
    display: inline-block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0 6px 0 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--tlp-neutral-normal-color) url("@tuleap/tlp/src/images/tlp-default-avatar.svg")
        no-repeat center center;
    background-size: contain;
    vertical-align: top;

    > img {
        width: 100%;
        height: 100%;
        vertical-align: top;
    }
}

.tracker-cross-reference-title-icon {
    color: var(--tlp-white-color);
}

.move-artifact-selectors {
    color: var(--tlp-typo-default-text-color);
    text-shadow: none;
}

.tracker-add-to-dashboard-form-button {
    margin: revert;
}
