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

.mixin-box {
    @rect-size: 1.25rem;

    width: @rect-size;
    height: @rect-size;
    border-radius: @border-radius-small;

    line-height: @rect-size;
    text-align: center;
}

.color-picker-dropdown {
    a.folder-default-color {
        display: flex;
        align-content: center;
        // fake divider
        padding: 3px 14px 8px 14px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e5e5e5;

        i.fa {
            .mixin-box();
            line-height: 18px;
            margin-right: 4px;
            border: 1px solid @dark-silver;
            margin-left: 2px;
            width: @rect-size;
        }
    }
}

.io-ox-calendar-color-picker-container {
    padding-top: 4px;
    padding-bottom: 4px;
}

.io-ox-calendar-color-picker {
    //padding-top: 8px;
    max-width: 100%;
    overflow-x: auto;
    display: flex;
    padding: 3px 14px 3px 14px;
    white-space: nowrap;
    text-align: left;
    width: ~"calc(16.25rem + 80px)";

    flex-wrap: wrap;

    a {
        // margin-bottom: 4px;
        // margin-right: 4px;
        margin: 0 2px 4px 2px;
        i.box {
            .mixin-box();
        }

        .fa.color-label {
            font-family: 'FontAwesome';
            display: inline-block;
            font-size: 14px;
        }

        .no-color .box {
            margin-right: 24px;
            &:before {
                border: 1px solid #888;
            }
        }
    }
}

@media all and (max-width: @smartphone-breakpoint), all and (max-device-width: @smartphone-breakpoint) {

    @rect-size-mobile: 36px;
    @rect-distancte-mobile: 2px;

    .io-ox-calendar-color-picker-container {
        position: relative;
        overflow: hidden;

        &:before {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
            background: -moz-linear-gradient(to left, #ffffff 0%, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0) ~"calc(100% - 10px)", #ffffff 100%);
            background: -webkit-linear-gradient(to left, #ffffff 0%, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0) ~"calc(100% - 10px)", #ffffff 100%);
            background: linear-gradient(to left, #ffffff 0%, rgba(255, 255, 255, 0) 10px, rgba(255, 255, 255, 0) ~"calc(100% - 10px)", #ffffff 100%);
            pointer-events: none;
        }

        .color-picker-scroll {
            overflow-x: auto;
        }

        .io-ox-calendar-color-picker {
            padding: 8px 10px;
            width: (@rect-size-mobile + (@rect-distancte-mobile * 2) + @rect-distancte-mobile) * 13;

            a[id^="color-label"].color-box-link {
                padding: 0px !important;
                margin: 0px !important;
                height: @rect-size-mobile + (@rect-distancte-mobile * 2);
            }

            .box:before {
                width: @rect-size-mobile;
                height: @rect-size-mobile;
                font-size: 26px;
                line-height: 37px;
            }

            .color-label {
                width: @rect-size-mobile;
                height: @rect-size-mobile;
                margin: @rect-distancte-mobile;
            }
        }
    }
}
