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

.dropdown-style {

    display: none;
    position: absolute;
    z-index: 1000000;
    width: 18.125rem;
    min-height: 160px;
    padding: 16px;
    line-height: 16px;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    outline: 0;
    cursor: default;
    border-radius: 3px;

    &:focus {
        border-color: rgba(0, 0, 0, 0.50);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.30);
    }

    &.open {
        display: block;
    }
}

.date-picker {

    @black: #333;
    @gray: #707070;
    @hover: #eee;
    @focus: #555;
    @red:   #a00;

    .dropdown-style();

    .navigation {
        font-weight: bold;
        text-align: center;
        margin-bottom: 8px;
        button.btn-prev, button.btn-next {
            width: 32px;
        }
    }

    button {
        color: @black;
        background-color: inherit;
        padding: 8px;
        outline: 0;
        border: 0;
        margin: 0;
        border-radius: 3px;
        &:hover { background-color: @hover; }
        &:focus { background-color: @focus; color: white; }
    }

    caption { display: inline-block; }

    td, th {
        color: @black;
        padding: 4px 0;
        width: ~"calc(2em + 8px)";
        text-align: center;
        line-height: 24px;
        border-radius: 3px;
    }

    th {
        &.weekday {
            color: @black;
            font-weight: bold;
            font-size: 12px;
            text-transform: uppercase;
        }
        &.cw {
            color: @gray;
            font-size: 10px;
            font-weight: 300;
        }
        &.weekend { color: @red; }
    }

    td {
        cursor: pointer;

        &.outside {
            color: @gray;
            font-weight: 300;
        }

        &.today {
            color: white;
            background-color: @red;
        }

        &.weekend { color: @red; }
        &.weekend.outside { color: @gray; }
        &.weekend.today { color: white; }

        &.month, &.year {
            width: 84px;
            text-align: center;
            padding: 16px 0;
        }
    }

    .grid {
        clear: both;
        outline: 0;
        td:hover { background-color: @hover; color: @black; }
        td.today:hover { background-color: darken(@red, 10%); color: white; }
        td[aria-selected="true"] { background-color: #ccc; color: @black; }
        td[aria-selected="true"]:hover { background-color: #aaa; color: @black; }
        &:focus td[aria-selected="true"] { background-color: @focus; color: white; }
    }

    .btn-today {
        color: @black;
        font-size: 13px;
        text-align: center;
        display: block;
        margin: 8px 0 0 0;
        width: 100%;
    }

    .window-sidepanel & {

        display: block;
        position: relative;
        width: 100%;
        border: 0;
        border-bottom: 1px solid #ddd;
        background-color: inherit;
        box-shadow: none;
        padding: 8px;
        z-index: 9;

        &:focus {
            border-color: #66afe9;
            z-index: 10;
            outline: 0;
            -webkit-box-shadow: 0px 0px 8px 2px rgba(102,175,233,.6);
            box-shadow: 0px 0px 8px 2px rgba(102,175,233,.6);
        }

        .navigation {
            margin: 3px 0 13px 0;
        }

        .grid {
            margin: 0 auto;
        }

        td, th {
            font-size: 12px;
            line-height: 16px;
        }
    }
}

.time-picker {

    .dropdown-style();
    padding: 8px 0;
    max-height: 160px;
    max-width: 100px;
    overflow-y: auto;

    .date {
        color: #707070;
        font-size: 13px;
        line-height: 16px;
        padding: 0 16px;
    }

    .date.fullhour {
        color: #333;
        font-weight: 500;
        margin-top: 3px;
        border-top: 1px solid #ccc;
        padding-top: 4px;
    }

    .date.fullhour:first-child {
        margin-top: 0;
        border-top: 0;
        padding-top: 0;
    }
}
