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

 .vgrid.editable .vgrid-cell.tasks {
    padding-left: ~"calc(1.5rem + 24px)";
 }

.vgrid-cell.tasks {

    padding-bottom: 11px;

    .vgrid-cell-checkbox { padding-top: 11px; }

    .first-row {
        display: flex;
        display: -webkit-flex;
        line-height: 18px;
    }

    .end_date {
        color: #767676;
        margin-left: 0.5em;
        margin-right: 0.5em;
        overflow: visible;
        font-weight: 300;
        float: right;
    }

    .status {
        margin-left: 0.5em;
        float: right;
        margin-top: -1px;
    }

    .priority {
        font-size: 16;
        font-weight: bold;
        padding: 0 0.5em 0 0.5em;
        display: inline-block;
        float: right;
        position: relative;
        overflow:visible;

        i.fa-star { display: inline-block; }
    }

    .title {
        font-weight: 500;
        display: inline-block;
        white-space: nowrap;
        flex-grow: 1;
    }

    .private-flag {
        float: left;
        font-size: 18px;
        margin-right: 3px;
        color: #aaa;
        min-width: 12px;
        max-width: 12px;
    }

    .second-row {
        margin-top: 8px;
        height: 16px;
        overflow: visible;
    }

    .participants {
        line-height: 1em;
        margin-right: 1em;
        float: left;
    }

    .progress {
        height: 13px;
        margin: 0 1em 0 0;
        background-color: #eee;
        border-radius: 3px;
        border: 1px solid #fff;
        background-position: -1px 0;
        background-repeat: repeat-y;
        background-size: 0%;
        overflow: hidden;
        // The background image is an opaque #283F73 1px png
        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mPUsC/+DwADTAHbRU1B9QAAAABJRU5ErkJggg==);
        transition: background-size 0.6s ease;
    }
}

.vgrid-cell.tasks.selected .progress { border: 1px solid #ddd; }
.has-focus .vgrid-cell.tasks.selected .progress { border: 1px solid #283f73; }

.tasks-detailview {
    .io-ox-inline-links:first-child { margin: 0 0 26px 0; }

    .task-header {
       margin-bottom: 16px;
       padding-top: 1px;

       &:after {
            content: "\00A0";
            display: block;
            clear: both;
            visibility: hidden;
            line-height: 0;
            height: 0;
        }
        .title {
            margin: 0 0 10px 0;
            font-size: 24px;
            padding-top: 1px;
        }
    }

    .note {
        border-top: 1px solid #ddd;
        padding-top: 15px;
        line-height: 24px;
    	margin-bottom: 16px;
    	white-space: pre-wrap;
		word-wrap: break-word;
		cursor: text;
    }

    .info-panel {
        margin-left: 2em;
        display: inline;
        float: right;
        line-height: 20px;

        .state {
            margin-bottom: 2px;
            margin-top: 2px;
        }
    }

    .state, .end-date, .alarm-date, .task-progress {
    	float: right;
    	clear: both;
    	margin-bottom: 4px;
    }

    .attachments-container {

        border-top: 1px solid #ddd;
        padding-top: 15px;
        margin-bottom: 7px;
        line-height: 24px;

        .attachments {
            color: #333;
            font-weight: bold;
            margin-right: 16px;
        }

        .dropdown {
            margin-right: 16px;
            display: inline-block;
            padding-bottom: 2px;
            line-height: 24px;
        }
    }

    .attachment-item {
        color: #333;
        word-break: break-all;
    }

    .task-details {
        padding: 7px 0 0 0;
        border-top: 1px solid #ddd;
        margin: 0 0 8px 0;
    }

    .detail-label {
        cursor: default;
        color: #767676;
        text-align: left;
        padding-top: 8px;
        line-height: 24px;
    }

    @media (min-width: 768px) {
        .dl-horizontal dt.detail-label {
            width: 220px;
        }

        .dl-horizontal dd {
            margin-left: 240px;
        }
    }

    .detail-value {
        line-height: 24px;
        padding-top: 8px;
    }

    .private-flag {
        font-size: 20pt;
        margin-right: 12px;
        color: #aaa;
    }

    .priority {
        font-weight: bold;
        vertical-align: top;
        white-space: nowrap;

        .high, .low, .medium {
            margin-right: 10px;
            font-size: 16px;
            color: @task-priority;
        }
    }
}

@media (max-width: @smartphone-breakpoint), (max-device-width: @smartphone-breakpoint) {
    .vgrid-cell.tasks {
        z-index: 2;
        width: 100%;
        font-size: 14px;
        border-top: 1px solid #ddd;
        left: 0;
        .transition(e('left 0.40s cubic-bezier(0.1, 0.7, 0.1, 1), padding 0.40s cubic-bezier(0.1, 0.7, 0.1, 1)'));

        &:first-child { border-top-width: 0; }

        &.swipe-left { left: -80px; }
    }

    .tasks-detailview {

        .title {
            margin: 0;
            padding-bottom: 1px;
        }

        .detail-label, .detail-value,
        .participants-table-confirmmessage { display: block; }

        .detail-label { margin-bottom: 0; }

        .detail-value { padding-top: 0; }

        .io-ox-inline-links:first-child {
            margin: 0;
            padding: 15px 0;
        }

        .participants-table-confirmmessage { padding-left: 0; }

        // to push the title under the info panel, prevents long titles to be ripped apart
        .info-panel { width: 100%; }
    }

    div.io-ox-tasks-edit.task-edit-wrapper.container.default-content-padding { padding-bottom: 40px; }

}

//io.ox/tasks/listview, io.ox/tasks/common-extensions
.task-item {

    .title {
        .ellipsis();
        font-weight: 500;
    }

    .date {
        font-weight: 300;
        display: inline-block;
        margin-left: 0.5em;
        float: right;
        opacity: 0.50;
    }

    .prog { color: rgb(119, 119, 119); }
}
