/**
 * 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 "sass:color";
@use "global-variables";
@use "pkg:@tuleap/pie-chart";

#siteadmin-homepage-container {
    display: flex;
    align-items: flex-start;
    padding: global-variables.$top-floating-buttons-space 0 0;
}

.siteadmin-homepage-column {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    margin: 0 var(--tlp-medium-spacing) 0 0;
}

.siteadmin-homepage-row {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    margin: 0 0 var(--tlp-medium-spacing);

    &:first-child {
        flex: 0 1 auto;
    }

    &:last-child {
        margin: 0;
    }

    > .tlp-pane {
        flex: 1 1 auto;
        width: 100%;
        max-width: 50%;
        margin: 0 var(--tlp-medium-spacing) 0 0;

        &:last-child {
            margin: 0;
        }

        &:first-child:last-child {
            max-width: 100%;
        }

        > .tlp-pane-container {
            display: flex;
            flex-direction: column;
        }
    }

    @media screen and (max-width: 1200px) {
        flex-direction: column;

        > .tlp-pane {
            width: 100%;
            max-width: none;
            margin: 0 0 var(--tlp-medium-spacing);

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

.siteadmin-homepage-validation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    margin: 0 0 calc(var(--tlp-medium-spacing) * 2);
}

.siteadmin-homepage-users-icon,
.siteadmin-homepage-projects-icon {
    fill: var(--tlp-main-color-transparent-80);
}

.siteadmin-homepage-validation-count {
    margin: 0 0 0 var(--tlp-medium-spacing);
    font-size: 100px;
    font-weight: 300;

    &:not(.tlp-text-warning) {
        color: var(--tlp-main-color-transparent-80);
    }
}

.siteadmin-homepage-no-validation {
    color: var(--tlp-main-color-transparent-70);
    text-align: center;
}

.siteadmin-homepage-stat-badge {
    margin: 0 5px 5px 0;
}

.siteadmin-homepage-stat-lastlogins {
    display: block;
    margin: var(--tlp-small-spacing) 0 var(--tlp-large-spacing);
    font-size: 14px;
}

.siteadmin-homepage-statistics,
.siteadmin-homepage-system-events {
    > .tlp-pane-container > .tlp-pane-section:last-child {
        border-top: 1px solid var(--tlp-neutral-light-color);
    }
}

.siteadmin-homepage-statistics-section-last,
.siteadmin-homepage-system-events-queue:last-of-type {
    border-bottom: 0;
}

.siteadmin-homepage-system-events {
    flex: 1 1 auto;
    width: 500px;
    margin: 0;

    > .tlp-pane-container > .tlp-pane-section:last-child {
        border-top: 1px solid var(--tlp-neutral-light-color);
    }
}

.siteadmin-homepage-system-events-queue {
    text-decoration: none;
    cursor: pointer;

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

.siteadmin-homepage-system-events-queue-content {
    display: flex;
    flex-wrap: wrap;
}

.siteadmin-homepage-system-events-queue-content-flag {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 40%;
    margin: var(--tlp-small-spacing) 0;

    &.flag-error {
        color: var(--tlp-danger-color);
        font-size: 50px;
    }

    &.flag-warning {
        color: var(--tlp-warning-color);
        font-size: 36px;
    }

    &.flag-success {
        color: var(--tlp-success-color);
        font-size: 26px;
    }
}

.siteadmin-homepage-system-events-queue-content-details {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.siteadmin-homepage-system-events-queue-content-new-running-done,
.siteadmin-homepage-system-events-queue-content-warning-error {
    display: flex;
    justify-content: center;

    > .system-event-type-count {
        margin: calc(var(--tlp-medium-spacing) / 4);
        font-size: 14px;
        text-transform: uppercase;

        &::before {
            text-transform: none;
        }
    }
}

.siteadmin-homepage-statistics-section-graph {
    padding-top: 0;
}

#siteadmin-homepage-users-legend,
#siteadmin-homepage-projects-legend {
    padding: 20px;

    > ul {
        padding: 0;
    }
}

#siteadmin-homepage-users,
#siteadmin-homepage-projects,
#siteadmin-homepage-browsers-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.siteadmin-homepage-users-legend,
.siteadmin-homepage-projects-legend,
.siteadmin-homepage-browsers-stats-legend {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.siteadmin-homepage-users-legend-text-span,
.siteadmin-homepage-projects-legend-text-span,
.siteadmin-homepage-browsers-stats-legend-text-span {
    color: var(--tlp-dimmed-color);
    font-size: 12px;
    line-height: 18px;
    cursor: default;
}

.siteadmin-homepage-users-legend-selected,
.siteadmin-homepage-projects-legend-selected,
.siteadmin-homepage-browsers-stats-legend-selected {
    font-weight: 600;
}

.siteadmin-homepage-users-slice-path,
.siteadmin-homepage-projects-slice-path {
    opacity: 0.8;
}

.siteadmin-homepage-users-slice-text,
.siteadmin-homepage-projects-slice-text {
    font-weight: 600;
}

.siteadmin-homepage-users-slice-text-undisplayed,
.siteadmin-homepage-projects-slice-text-undisplayed {
    opacity: 0;
}
