/*
*
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* This program 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 Affero General Public License for more details.

* You should have received a copy of the GNU Affero General Public License
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
*
* Any use of the work other than as authorized under this license or copyright law is prohibited.
*
*/

.addressbook-popup {

    // 600px
    .modal-content { height: 37.5rem; }

    .modal-header .row {
        margin-top: 8px;
    }

    .modal-body.error {
        color: #767676;
        background-color: #eee;
        display: flex;
        align-items: center;
        text-align: center;
    }

    .list-view {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        height: auto;
    }

    .list-view .notification {
        font-size: 13px;
        font-weight: 400;
    }

    .selection-summary {
        font-size: 13px;
        padding: 0 0 16px 0;
        text-align: left;
        .count {
            color: #767676;
        }
        .addresses {
            padding-left: 0;
            clear: both;
            max-height: 200px;
            overflow: auto;
            outline: 0;
            display: flex;
            flex-wrap: wrap;
            .token {
                margin: 0 5px 3px 0;
                padding: 2px 4px;
                white-space: nowrap;
                max-width: calc(~"50% - 5px");

                display: flex;
                align-items: baseline;

                border-radius: 3px;
                border: 1px solid #d9d9d9;
                background-color: #ededed;
                cursor: default;

            }
            .token-label {
                .ellipsis();
                padding-left: 4px;
                vertical-align: top;
            }
            .token-action {
                margin-left: 5px;
                padding-right: 4px;
                color: #666;
            }
            &.listbox:focus {
                // disable a11y listbox style
                box-shadow: none;
                .selected { border-color: rgba(82,168,236,.8); }
            }
        }
    }
}

.address-picker {

    list-style-type: none;
    padding: 0;
    margin: 0;

    .list-item {
        line-height: 16px;
        padding-top: 0.6875rem;
        padding-bottom: 0.6875rem;

        &:last-child { border: 0; }

        .fa.fa-checkmark { top: 18px; }
    }

    &.focus-indicator .list-item {

        border: 1px solid transparent;
        border-width: 1px 0;

        &:focus {
            // just focus
            background-color: #ddd;
            .fa.fa-checkmark { color: #555; }

            &.selected {
                border-color: lighten(@selected-background, 30%);
                background-color: darken(@selected-background, 5%);
            }
            &.selected .fa.fa-checkmark { color: white; }
        }
    }

    .limit {
        color: #666;
        background-color: #eee;
        padding: 8px 8px 8px 48px;
    }

    .contact-picture {
        float: left;
        display: inline-block;
        margin-right: 16px;
        background-color: #eee;
        position: relative;
        top: -4px;
        .picture(40px, 40px);
    }

    .name, .email {
        .ellipsis();
    }

    .list-item.selected .contact-picture {
        &.image {
            -webkit-filter: saturate(0);
            background-color: #eee;
        }
        &.initials, &.distribution-list, &.label {
            color: white;
            background-color: rgba(0, 0, 0, 0.30);
        }
    }

    .initials, .distribution-list, .label {
        color: rgba(0, 0, 0, 0.60);
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .initials {
        &.gray { color: #000; }
        &.red { background-color: #FFA0A5; }
        &.orange { background-color: #FFA77B; }
        &.yellow { background-color: #FFD23A; }
        &.green { background-color: #BFDE45; }
        &.cyan { background-color: #99E4FB; }
        &.blue { background-color: #95CEFF; }
        &.purple { background-color: #E5B0FF; }
        &.pink { background-color: #FFC2DE; }
    }

    .distribution-list, .label {
        font-size: 14px;
        color: #fff;
        background-color: #555;
    }

    .list-item .display_name {
        font-weight: bold;
    }
}
