/*
*
* @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.
*
*/

.window-container:not(.io-ox-find-active) .io-ox-find {
    .twitter-typeahead {
        // ensure it does not overlapp collapsed search field when collapsed
        width: 100%;

        .token-input.tt-hint, & > .token-input.tt-input {
            // restore min-width overwritten in tokenfield.less for mail
            min-width: 60px !important;
        }
    }
}


.window-container.io-ox-find-active {
    .vgrid-cell.tail {
        display: none;
    }
}

.io-ox-find, .io-ox-search {

    // left
    .search-box {

        > .form-group { margin-bottom: 0; }

        // keep height of search field placeholder
        .twitter-typeahead { height: 1.714em; }

        // enlarge default height
        .twitter-typeahead .tt-dropdown-menu { max-height: 400px; }

        .search-field {
            &.form-control:focus {
                // reduce size of box-shadow from 8px to 4px
                // fixes display issue in Chrome (hidden top-bar; cause by fixed position)
                @color: @input-border-focus;
                @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
                .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 4px @{color-rgba}");
            }

            .token-input.tt-input {
                // overwrite default from tokenfield.less
                min-width: 60px !important;
                // keep placeholder at same position when switching to typeahead
                padding-left: 3px;
                &[disabled] { background-color: #eee; }
            }
        }
    }

    .autocomplete-item {
        color: #333;
        padding: 2px 10px;

        // description: added by backend
        i {
            font-style: normal;
            color: rgba(0, 0, 0, 0.55);
        }

        &.indent { padding-left: 24px; }

        &.dropdown-header {
            padding-top: 9px;
            margin-top: 9px;
            border-top: 1px solid rgba(128, 128, 128, 0.25);
            // reset bootstrap
            max-width: inherit;
        }

        &.dropdown-header:first-child {
            margin-top: 0;
            border-top: 0;
        }

        &.unselectable {
            cursor: default;
            color: rgba(128, 128, 128, 0.71);
        }

        &.contacts, &.contact, &.participant, &.task_participants {

            .image {
                margin-right: 14px;
                display: inline-block;
                float: left;
                .picture(42px, 42px);
            }

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

            .detail { color: rgba(0, 0, 0, 0.55); }
        }
    }
}

