// users.scss
// Styling for the superdesk users page (list, prevew, profile)
// ----------------------------------------------------------------------------------------
@import '~mixins.scss';
@import '~variables.scss';

.users {    //page styles
    .users-subnav {
        .multiple-action {
            margin-left: 30px;
            float: left;
        }
    }
}

.disabled-label {
    background: #c8a1a8;
    color: $white;
    font-size: 10px;
    @include text-semibold();
    text-transform: uppercase;
    height: 13px;
    line-height: 13px;
    padding: 0 8px;
    @include border-radius(2px);
    margin-left: 10px;
}

.users-table {    //main list styles

    border-top: 2px solid #d7d7d7;
    .table-header {
        background: #fff;
    }
    .table-title {
        height: 30px;
        font-size: 11px;
        color: #8a8a8a;
        line-height: 30px;
        @include text-light();
        text-transform: uppercase;
    }
    .table-newest {
        margin: 0 0 30px;
        background: #fafdf6;
        border-top: 1px solid #d7d7d7;
    }
    .table-body {
        margin-top: -1px;
    }
    .table-body {
        background: #fff;
        border-top: 1px solid #d7d7d7;
    }
    .table-header, .table-newest, .table-body {

        > li {
            height: 40px;
            border-bottom: 1px solid #ebebeb;
            position: relative;
            clear: both;

            > div:not(.tooltip) {
                float: left;
                height: 30px;
                padding: 5px;
                line-height: 30px;
                //column width
                &.chckbx {
                    width: 25px;
                    text-align: center;
                    span {
                        vertical-align: middle;
                        margin: 0;
                    }
                }
                $user-table-actions-width: 82px;
                &.row-wrapper {
                    position: absolute;
                    left: 60px;
                    right: $user-table-actions-width+10;
                    top: 5px;
                    padding: 0;
                    @include box-sizing(border-box);
                    > div {
                        color: $sd-text;
                        float: left;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        @include box-sizing(border-box);
                        padding: 0 5px;
                        height: 30px;
                        &.name {
                            @include text-semibold();
                        }
                        &.email {
                            color: $sd-blue-text;
                            @include text-light();
                        }
                        &.created {font-size: 11px; color: $grayLight;}
                        //user columns width
                        &.name { width: 28%; }
                        &.role { width: 16%; }
                        &.username { width: 14%; }
                        &.email { width: 30%; }
                        &.created { width: 12%; }
                    }
                }
                &.action {
                    float: right;
                    width: $user-table-actions-width;
                    line-height: 18px !important;
                }
            }
            &.inactive .row-wrapper > div {
                color: lighten($sd-text, 60%);
                &.email {
                    color: lighten($sd-blue-text, 30%);
                }
            }
        }
    }
    .table-header {
        > li > div, .name, .email, .created {
            color: #000 !important;
            font-size: 13px !important;
            @include text-semibold();
        }
        .sortable {
            i {
                margin: -2px 0 0 5px;
            }
            &:hover {
                cursor: pointer;
            }
        }
    }
    .table-body , .table-newest {
        > li {

            &.selected {
                background: #eff7fa;
            }
            &:hover {
                background: #f4f4f4;
                cursor: pointer;
            }

            > div {
                &.action {
                    padding: 0;
                    height: 40px;
                    .item-functions {
                        display: none;
                        li {
                            height: 40px;
                            width: 40px;
                            line-height: 40px;
                            text-align: center;
                            border-left: 1px solid #d8d8d8;
                            span {
                                display: none;
                            }
                            &:hover {
                                background-color: #e8e8e8;
                            }
                        }
                    }
                }
            }

            &:hover {
                > div.action .item-functions {
                    display: block;
                }
            }

        }
    }
    .alert {
        height: auto !important;
        @include border-radius(0px);
        border-width: 0 0 1px;

        &.alert-info {
            border-color: #bce8f1;
            &:hover {
                background: #d9edf7;
            }
        }

    }
}


/*
====================================================
    User detail pane
====================================================
*/

.user-details-pane {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: calc(100% - 48px);

    .profile-info {
        position: absolute;
        top: 0; bottom: 0;
        left: 0; right: 0;
        overflow: auto;
    }

    .header-info {
        background-color: rgba(94, 169, 200, 0.11);
        padding: 20px 0 0;

        h2 { //used as user's full name
            text-align: center;
            font-size: 18px;
            line-height: 20px;
            margin: 10px 0 4px 0;
            padding: 0 20px;
        }
        h5 { //used as user's username
            text-align: center;
            font-size: 14px;
            font-weight: normal;
            line-height: 16px;
            padding: 0 20px;
            margin-bottom: 10px;
            color: rgba(0, 0, 0, 0.75);
        }

        .active {
            position: absolute;
            top: 20px;
            right: 15px;
        }
        .user-roles {
            list-style-type: none;
            margin: 15px 0;
            padding: 0;
            li {
                display: inline-block;
                @include border-radius(3px);
                padding: 2px 10px;
                background: #b2b2b2;
                color: #fff;
                font-size: 11px;
                margin-right: 3px;
            }
        }

    }

    .date-time {
        color: #999;
        font-weight: 300;
    }
    // .change-btn {
    //     color: sd
    // }

    .details-info {
        flex-grow: 1;
        overflow: auto;
        padding: 20px;
        // height: 100vh;
        position: relative;
    }

    .error-holder {
        height: 40px;
        margin: 0 -20px;
        .alert {
            padding: 10px 20px;
        }
    }

    .validation-error {
        color: #ab3434;
        font-size: 12px;
        margin-top: 5px;
        margin-bottom: 0;
    }
    .validation-info {
        font-size: 11px;
        color: #888;
    }
    .profile-pic {
        display: flex;
        position: relative;
        justify-content: center;

        .disabled-label {
            position: absolute;
            bottom: 15%;
            left: 40%;
            border: 1px solid #fff;
        }
    }

    .alert {
        @include border-radius(0px);
    }



    .ng-invalid-required {
        .required-info {
            display: inline-block !important;
        }
    }
} //end of user detail pane


// USER PROFILE PAGE IN MODAL
.modal.user-profile-page {
    .modal__body {
        height: calc(100vh - 180px);
        @include border-radius(0 0 4px 4px);
    }
    .user-details-pane {
        position: static;
        ::-webkit-scrollbar {
            border-left: 9px solid #f8f8f8;
        }
        ::-webkit-scrollbar-thumb {
            border-left: 8px solid #f8f8f8;
        }
    }
    .details-info {
        bottom: 58px;
    }
    .action-bar {
        top: auto !important;
        bottom: 0;
        border-top: 1px solid #e4e4e4;
        border-bottom: 0;
    }
}

/*
==============================================
Profile page styles
==============================================
*/
.user-profile-page {
    .user-details-pane {
        top: 0;
        padding: 0;
        height: 100%;
    }
}

.profile-activity-container {
    position: absolute;
    left: 0px;
    right: 0;
    top: 0;
    bottom: 20px;
    padding: 10px 30px 0;
    background-color: $background-main;
    overflow-x: hidden;
    overflow-y: auto;

    &::-webkit-scrollbar {
            width:10px;
            border-left:0
        }
    &::-webkit-scrollbar-thumb {
        border-right: 2px solid $background-main;
        border-left: 0;
    }

    > .btn {
        margin: 10px 0 20px;
    }

    .profile-activity {
        height: 100%;
        @include box-sizing(border-box);
        overflow: auto;
        max-width: 500px;
        .activity-header {
            height: 40px;
            border-bottom: 1px solid #ddd;
            h6 {
                line-height: 40px;
                font-weight: normal;
                font-size: 20px;
                color: #444;
                text-transform: none;
            }
        }

        .group-date {
            margin-top: 20px;
            margin-bottom: 16px;
            color: #888;
            font-size: 11px;
            @include text-semibold();
            height: 1px;
            border-top: 1px solid #ddd;
            position: relative;
            .day {
                position: relative;
                top: -.9em;
                display: inline-block;
                background-color: $background-main;
            }
            .date {
                padding-left: 4px;
                padding-right: 4px;
                text-transform: lowercase;
                position: relative;
                top: -.9em;
                display: inline-block;
                background-color: $background-main;
            }
        }
        .activity-entry {
            border-bottom: 1px solid #ddd;
            background: #fff;
            margin-top: 4px;
            clear: left;

            .activity-figure {
                float: left;
            }

            .activity-date {
                color: #888;
                font-size: 11px;
                @include text-semibold();
            }
        }
    }

    ::-webkit-scrollbar {
        border-left: 9px solid $background-main;
        border-right: 1px solid $background-main;
        width: 13px;
        background: $background-main;
    }
    ::-webkit-scrollbar-thumb {
        border-left: 8px solid $background-main;
    }
}

.user-details-pane {
    .action-bar {

        background: scale-color($sd-blue, $lightness: 80%);
        box-shadow: 0 1px 2px 0 rgba(0,0,0,0);
        border-bottom: none;
        &.show {
            box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
        }
    }
}

.user-profile-page {
    overflow: auto;
    .form-content {
        position: absolute;
        top: 0; left: 0; bottom: 0;
        width: 600px;
        background: #fff;
        border-right: 1px solid #ddd;
        @include box-sizing(border-box);
        @include box-shadow(0 0 5px 0 #e0e0e0);
        z-index: 2;
    }

    .user-details-pane {
        > header {
            height: 48px;
            @include border-box();
            border-bottom: 1px solid #dfdfdf;
            .nav-tabs {
                padding: 0 10px;
            }
        }
        > .content {
            position: absolute;
            top: 48px;
            left: 0; right: 0; bottom: 0;
            padding: 0;

            .inner-content {
                position: absolute;
                left: 0;
                right: 0;
                top: 0;
                bottom: 0;
                overflow: auto;
            }
        }

        .action-bar {
            top: -96px;
            &.show { top:-48px; }
        }
    }

    .other-content {
        position: absolute;
        top: 0; left: 600px; bottom: 0; right: 0;
        z-index: 1;
        background: $background-main;

        .tablist-container {
            width: 100%;
            @include box-sizing(border-box);
            height: 38px;
            border-bottom: 1px solid #e5e5e5;
            background: #efefef;
            ul li {
                float: left;
                height: 38px;
                line-height: 38px;
                padding: 0 20px;
                border-right: 1px solid #dfdfdf;
                color: #218baa;
                &.active {
                    background: $background-main;
                }
            }
        }

        .tabcontent-container {
            position: absolute;
            top: 38px;
            left: 0; right: 0; bottom: 0;
            overflow: auto;
            .profile-activity-container {
                left: 0;
                background: none;
                .activity.with-date .date span {
                    background-color: $background-main !important;
                }
            }
        }
    }
}

.user-link {
    color: $sd-blue-text;
    &:hover {
        cursor: pointer;
    }
}
//
// User info popup
.user-popup {
    position: fixed;
    min-width: 240px;
    width: auto;
    height: 150px;
    top: 0px;
    left: 0px;
    display: none;
    z-index: 1001;
    background: #fff;
    border:1px solid #e0e0e0;
    @include box-shadow(0 0 3px 0 rgba(0,0,0,0.15));

    .title {
        height: 40px;
        line-height: 40px;
        padding: 0 20px;
        font-size: 20px;
        text-align: center;
        @include text-light();
    }
    .actions {
        text-transform: uppercase;
        text-align: center;
        font-size: 12px;
        a:hover {
            text-decoration: none;
        }
    }
}


// Preferences

.preferences  {

    .dateline_preview {
            background-color: rgba(0,0,0,.06);
            display: inline-flex;
            align-items: center;
            min-height: 28px;
            border-radius: 14px;
            padding: 0.2rem 1.4rem;
            margin-top: 1rem;

    }
    .preferences__actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin: 1.2rem 0 0.8rem;
        .preferences__action-link {
            cursor: pointer;
            color: #5ea9c8;
            display: inline-block;
            padding: 0.2rem;
            font-size: 1.1rem;
            line-height: 100%;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            flex-grow: 0;
        }
        .preferences__action-spacer {
            display: inline-block;
            flex-grow: 0;
            height: 1.2rem;
            margin-right: 0.6rem;
            padding-left: 0.6rem;
            width: 0.1rem;
            border: 1px dotted rgba(0,0,0,.65);
            border-width: 0 1px 0 0;
        }
    }

    .input-term {
        input[type="text"] {
            border: 1px solid rgba(123, 123, 123, 0.5);
            border-radius: 3px;
            padding: 0 5px;
            width: auto;
            min-width: 100%;
            min-height: 30px;
            &:hover {
                border: 1px solid rgba(123, 123, 123, 0.8);
            }
            &:focus {
                border: 1px solid #5ea9c8;
                box-shadow: inset 0 0 0 1px #5ea9c8;
            }
        }
    }

    [sd-meta-dropdown] {
        .dropdown__toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.2rem !important;
            min-width: 240px;
            .dropdown__caret {
                display: block;
                flex-grow: 0;
                flex-shrink: 0;
                margin: 0 !important;
            }
        }
    }
}

.mini-modal {
    background-color: #fff;
    
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2),0 6px 16px rgba(0,0,0,.3);
    .title {
        font-size: 15px;
        padding: 12px 20px;
        box-shadow: 0 1px 0 rgba(0,0,0,.1);
    }
    .content {
        padding: 10px 20px;
        font-size: 14px;
    }
    .footer {
        padding: 10px 20px 20px;;
    }
    .close {
        position: absolute;
        top: 10px;
        right:10px;
    }
}

.password-popup {    //change password popup
    position: fixed;
    min-width: 260px;
    top: 150px;
    left: 10%;
    background-color: $white;
    z-index: 999;
}

.user-preferences__heading {
    padding: 0.8rem 0 1.6rem;
    margin: 0;
    font-size: 1.6rem;
    color:#333;
    font-weight: 300;
    letter-spacing: 0.02em;
}
