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

.participantsrow {
    margin-bottom: 20px;

    legend { margin-bottom: 10px; }

    .participant-wrapper {
        margin-bottom: 8px;
        margin-left: -15px;
        @media (min-width: 768px) {
            &.col-sm-6:nth-child(even) {
                margin-left: 8px;
            }
        }
        @media (max-width: 767px) {
            .remove {
                right: -15px;
            }
        }
    }
}

.participant-wrapper {

    margin-bottom: 8px;
    position: relative;
    min-height: 3.5rem; /* for floating icon */
    line-height: 16px;

    .autocomplete-item & { margin: 0; }

    &.pointer { cursor: pointer; }

    .remove {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        line-height: 1em;
        background-color: #f5f5f5;
        color: #ccc;
        cursor: pointer;
        display: none;

        &:hover, &:focus {
            background-color: #a00;
            color: #fff;
            text-decoration: none;
            outline: 0;
        }

        .icon {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            margin-top: -0.5em;
            text-align: center;
        }
    }

    &.removable {
        padding-right: 40px;

        .remove { display: block; }
    }

    .participant-name {
        padding-top: 7px;
        font-weight: bold;
        .ellipsis();
    }

    .participant-email-wrapper,
    .extra-decorator-wrapper,
    .participant-email { .ellipsis(); }

    .extra-decorator {
        color: #757575;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        &:hover { color: #777; text-decoration: none }
    }

    &.three-rows {
        line-height: 16px;
        // needed or we get cut of descenders on smartphones
        font-size: 14px;
        .participant-name { padding-top: 4px; }
    }

    .participant-image {
        float: left;
        margin-right: 14px;
        .picture(54px, 54px); /* 54px allows 3 lines with 18px line-height */
        max-height: 100px;
        max-width: 100px;

        &.contact-image,
        &.external-user-image { background-image: url(@fallback-image-contact); }

        &.group-image {
            background-image: url(@fallback-image-group);
            background-position: 0 -4px;
        }

        &.resource-image { background-image: url(@fallback-image-resource); }
    }
}

.participants-view {

    @participant-unconfirmed:   #428BCA;
    @participant-accepted:      #5C7F31;
    @participant-declined:      #913F3F;
    @participant-tentative:     #cc8800;

    .group { border: none; }

    .flex-wrapper { display: flex; }

    fieldset{
        margin: 0;
    }

    legend {
        margin-bottom: 1px;
        line-height: 18px;
        padding-top: 8px;
        padding-bottom: 0px;
    }

    .status {
        //prevent icons from floating around with multiple columns
        display: inline-block;
        vertical-align: top;

        margin-left: 4px;
        line-height: 24px;

        &.unconfirmed { color: @participant-unconfirmed; }
        &.accepted { color: @participant-accepted; }
        &.declined { color: @participant-declined; }
        &.tentative {
            color: @participant-tentative;
            i { opacity: 0.50; }
        }
    }

    .organizer-container {
        margin-left: 4px;
        color: @hc-gray;
    }

    .io-ox-inline-links.embedded {
        margin: 14px 0 18px 0;
        line-height: 24px;
        min-height: 0;
    }

    @media (max-width: @smartphone-breakpoint), (max-device-width: @smartphone-breakpoint) {
        .io-ox-inline-links.embedded {
            margin: 18px 0 14px 0;
            line-height: 16px;
        }
    }

    .summary {
        margin-bottom: 0px;
        display: inline-block;

        .status {
            position: relative;
            margin-right: 0.3em;
            line-height: 20px;
        }

        .active {
            border: 1px solid #e5e5e5;
            border-bottom: 1px solid #fff;
            background-color: white;
            border-top-right-radius: 7px;
            border-top-left-radius: 7px;
            margin-top: -1px;
            margin-bottom: -1px;
            padding-left: 4px;
            padding-right: 4px;
        }
    }

    .participant-list {
        margin-bottom: 0px;
        padding-top: 5px;

        .participant {
            width: 100%;
            margin: 0 0px 8px 0;
            line-height: 24px;

            &:focus {
                .person.accepted,
                .person.declined { color: black; }
            }

            .person {
               line-height: 24px;
               padding-top: 1px;

               .ellipsis();

                &.accepted { color: @participant-accepted; }

                &.declined {
                    text-decoration: line-through;
                    color: @participant-declined;
                }
            }

            .comment {
                color: @hc-gray;
                white-space: normal;
                padding-left: 16px;
                line-height: 16px;
                padding-top: 5px;
                margin-bottom: 3px;
            }
        }
    }
}

.vgrid-cell ul.participant-list {
    width: 500px;
    white-space: normal;

    .participant {
        margin: auto;
    }
}
