@import "colors.scss";

$active-background: #E5EAEE;

.itsec-card--type-security-profile-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;

    & .itsec-card-header {
        flex-shrink: 0;
    }

    & .itsec-card-security-profile__users--column-avatar img {
        height: 3em;
        border-radius: 50%;
    }

    & tbody td.itsec-card-security-profile__users--column-two-factor {
        text-align: center;
    }

    .itsec-card[max-width~="700px"] & .itsec-card-security-profile__users--column-avatar,
    .itsec-card[max-width~="700px"] & .itsec-card-security-profile__users--column-two-factor {
        display: none;
    }

    .itsec-card[max-width~="500px"] & .itsec-card-header-status {
        display: none;
    }
}

.itsec-card-security-profile__user {
    & .itsec-card-security-profile__user-header {
        display: flex;
        flex-wrap: wrap;
        flex-shrink: 0;
        padding: 1em;
        text-align: center;
        align-items: center;
        justify-content: center;
        background: #E5EAEE;

        & > * {
            margin: .5em;
        }

        & img {
            width: 3em;
            height: 3em;
            border-radius: 50%;
        }
    }

    & .itsec-card-security-profile__password-strength--short {
        color: $alert-red;
    }

    & .itsec-card-security-profile__password-strength--bad {
        color: $alert-orange;
    }

    & .itsec-card-security-profile__password-strength--good {
        color: $alert-yellow;
    }

    & .itsec-card-security-profile__password-strength--strong {
        color: $alert-green;
    }

    & .itsec-card-security-profile__user-info {
        margin: 0 2em;

        & table {
            width: 100%;
            border-spacing: 0;
            text-align: left;
        }

        & table th,
        & table td {
            border-bottom: 1px solid $light-gray-500;
        }

        & table tr:last-child th,
        & table tr:last-child td {
            border-bottom: none;
        }

        & table th {
            text-transform: uppercase;
            font-weight: normal;
            color: $dark-gray-300;
            padding: 1em 1em 1em 0;
            width: 33%;
        }

        & table td {
            font-weight: bold;
            padding: 1em 0 1em 1em;
        }

    }
}

.itsec-card[max-width~="250px"] .itsec-card--type-security-profile .itsec-card-security-profile__user-info {
    margin: 0;
    padding: 0 1em;

    & table {
        overflow: hidden;
    }

    & table th,
    & table td {
        display: block;
        border-bottom: none;
        width: auto;
        padding: .5em 1em 0 1em;
    }

    & table th {
        padding-top: 1em;
    }

    & table td {
        border-bottom: 1px solid $light-gray-500;
        padding-bottom: 1em
    }
}

.itsec-card--type-security-profile {
    height: 100%;
    display: flex;
    flex-direction: column;

    & .itsec-card-security-profile__user-header {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    & .itsec-card-header {
        flex-shrink: 0;
    }

    & .itsec-card-security-profile__user {
        height: 100%;
        flex-shrink: 1;
        display: flex;
        flex-direction: column;

        & .itsec-card-security-profile__user-info {
            overflow-y: scroll;
            overflow-x: hidden;
        }
    }

    & .itsec-card-security-profile__select-user {
        padding: 2.5em 1em 0 1em;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        background: $active-background;

        & > * {
            margin: .5em;

            &:first-child {
                margin-top: 0;
            }

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

        & .itsec-card-security-profile__select-form {
            display: flex;
            align-items: stretch;
            justify-content: center;
            width: 100%;
            max-width: 350px;

            & .itsec-card-security-profile__select-user-dropdown {
                flex-grow: 1;
            }

            & .itsec-card-security-profile__select-user-save-container {
                margin-left: .5em;

                & .components-button {
                    height: 100%
                }
            }
        }
    }
}
