/*********************************************
 *  Copyright (c) 2015 Ansible, Inc.
 *
 *  job-details.less
 *
 *  Styles for job details page
 *
 */


@failed-hosts-color:        @red;
@successful-hosts-color:    @green;
@changed-hosts-color:       @changed;
@skipped-hosts-color:       @skipped;
@unreachable-hosts-color:   @unreachable;


#host-events-modal-dialog {
    overflow: hidden;
    i[class*='icon-job'] {
        font-size: 12px;
        vertical-align: middle;
    }
    #search-form {
        margin-left: 7px;
    }
    #host-events-search-name {
        width: 200px;
        padding-right: 15px;
    }
    #search-all-input-icons {
        position: absolute;
        right: 3px;
        top: 3px;
        a {
            color: #a9a9a9;
        }
        a:hover {
            color: @black;
        }
    }
    #status-field {
        margin-left: 15px;
    }
    #host-events-table {
        margin-top: 15px;
    }
    #host-events {
        height: 200px;
        overflow: scroll;
        tr:first-of-type {
            border-top-color: @white;
            td {
                border-top-color: @white;
            }
        }
    }
    #fixed-table-header {
        margin-bottom: 0;
    }
    #search-indicator {
        margin-left: 15px;
    }
}

@media (max-width: 768px) {
    #host-events-modal-dialog {
        #search-form-input-icons {
            position: absolute;
            top: 30px;
            left: 185px;
        }
        #status-field {
            margin-left: 0;
        }
        .form-group {
            margin-bottom: 15px;
        }
    }
}

#jobs-detail {

    #play-help {
        width: 1px;
        height: 1px;
        color: #fff;
    }

    .job_summary {
        .table {
            margin-bottom: 0;
            border: 1px solid @grey;
            background-color: @white;
        }
        .table>tbody>tr>td {
            border-top-color: @grey;
            padding-bottom: 0;
        }
        .table>thead>tr>th {
            border-bottom-color: @grey;
            padding-bottom: 0;
            height: 22px;
        }
    }

    .status-bar {
        height: 16px;
        overflow: hidden;
        border-radius: 4px;
        border: 1px solid @grey;
        margin-top: 2px;
    }

    .inner-bar {
        display: inline-block;
        overflow: hidden;
        height: 16px;
        text-align: center;
        font-size: 12px;
        font-weight: bold;
        line-height: normal;
    }

    .scroll-spinner {
        display: none;
        background-color: transparent;
        color:#000;
        float:right;
        margin-right: 5px;
    }

    #hostResultsMoreRows.scroll-spinner {
        padding-top: 0;
        position: relative;
        top: 12px;
    }

    #hostSummariesMoreRows.scroll-spinner {
        margin-right: 0;
    }

    .failed-hosts {
        background-color: @failed-hosts-color;
    }
    .failed-hosts-color {
        color: @failed-hosts-color;
    }
    .successful-hosts {
        background-color: @successful-hosts-color;
    }
    .successful-hosts-color {
        color: @successful-hosts-color;
    }
    .changed-hosts {
        background-color: @changed-hosts-color;
    }
    .changed-hosts-color {
        color: @changed-hosts-color;
    }
    .skipped-hosts, .no-matching-hosts {
        background-color: @skipped-hosts-color;
    }
    .unreachable-hosts {
        background-color: @unreachable-hosts-color;
    }
    .unreachable-hosts-color {
        color: @unreachable-hosts-color;
    }

    .job_well {
        padding: 8px;
        background-color: @white;
        border: 1px solid @grey;
        border-radius: 4px;
        /*-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
                box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);*/
    }

    #hide-summary-button {
        text-align: right;
        margin-bottom: 15px;
    }

    .section {
        margin-bottom: 20px;
        h5 {
            margin-top: 0;
            margin-bottom: 12px;
            font-weight: bold;
        }
    }

    .section:last-child {
        margin-bottom: 0;
    }


    #job_options {
        height: 100px;
        overflow-y: auto;
        overflow-x: none;
    }

    #job_plays, #job_tasks {
        overflow-y: auto;
        overflow-x: none;
    }

    #breadcrumb-container {
        padding-right: 15px;
        .nav-path {
            margin-bottom: 15px;
        }
    }

    #job-detail-container {

        .well {
            overflow: hidden;
        }

        #job-status-form {
            label {
                font-weight: bold;
            }
            .control-label {
                padding-top: 0;
                padding-right: 0;
                text-align: left;
            }
            .form-group {
                margin-bottom: 15px;
            }
            hr {
                margin-top: 0;
            }
            .more-or-less {
                font-size: 12px;
                text-align: left;
                margin-bottom: 15px;
            }
            #started-time,
            #finished-time,
            #elapsed-time {
                display: inline-block;
            }
            #finished-time,
            #elapsed-time {
                padding-left: 15px;
            }
        }

    }

    #job-summary-container {
        position: absolute;
        top: 0;
        right: 0;
        padding-right: 15px;
        padding-left: 7px;
        width: 41.66666667%;
    }

    .table-header {
        font-weight: bold;
        font-size: 12px;
        .table>thead>tr>th {
            border-bottom-color: @white;
        }
        .table {
            margin-bottom: 0;
        }
    }

    .table-detail {
        overflow-x: hidden;
        overflow-y: auto;
        background-color: @white;
        min-height: 40px;

        .row {
            border-top: 1px solid @grey;
        }
        .row:first-child {
            border: none;
        }
        .loading-info {
            padding-top: 5px;
            padding-left: 3px;
        }
        .table {
            margin-bottom: 0;
        }
        .table-condensed > tbody > tr > td {
            padding-top: 0;
            padding-bottom: 0;
        }
    }

    .status-column i {
        font-size: 12px;
    }

    #plays-table-header table,
    #plays-table-detail table,
    #tasks-table-detail table,
    #tasks-table-header table,
    #tasks-table-detail table {
        table-layout:fixed;
    }

    #plays-table-detail td,
    #plays-table-header td,
    #tasks-table-detail td,
    #tasks-table-header td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #play-section {
        .table-detail {
            min-height: 40px;
        }
    }

    .title {
        font-size: 14px;
        font-weight: 600;
    }

    .header {
        width: 100%;
        height: 28px;
        padding-bottom: 5px;


        .search-field {
            display: inline-block;
            position: relative;
            float: right;
            input {
                width: 250px;
                padding-right: 20px;
            }
            a {
                position: absolute;
                right: 3px;
                top: 3px;
                color: #a9a9a9;
            }
            a:hover {
                color: @black;
            }
        }
    }

    #summary-search-section {
        .remove-left-padding {
            padding-left: 0;
        }
        label {
            text-align: left;
            font-weight: normal;
            padding-left: 0;
            padding-right: 0;
            padding-top: 6px;
        }
        #search_all_hosts_name {
            width: 100%;
            padding-left: 3px;
            padding-right: 20px;
        }
    }

    #event-help-link {
        margin-left: 3px;
        font-size: 14px;
    }

    .title-row {
        margin-bottom: 15px;
        margin-top: 20px;
    }

    .search-form {
        font-size: 12px;
        .form-control {
            font-size: 12px;
        }
        .form-group:nth-of-type(2) {
            margin-left: 10px;
        }
    }

    .search-name {
        .input-xs {
            height: 25px;
        }
    }

    #search-all-input-icons {
        position: absolute;
        right: 3px;
        top: 3px;
        a {
            color: #a9a9a9;
        }
        a:hover {
            color: @black;
        }
    }

    label.small-label {
        font-size: 12px;
    }

    #task-hosts-section {
        position: relative;
        top: 0;
        left: 0;
        #hosts-table-header table {
            table-layout: fixed;
        }
        #hosts-table-detail {
            background-color: @white;
        }
        #hosts-table-detail table {
            table-layout: fixed;
        }
        #hosts-table-detail td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }

    #hosts-summary-section {
        .col-lg-4, .col-md-4, .col-sm-4, .col-xs-4 {
            width: 33%;
        }
        .col-lg-2, .col-md-2, .col-sm-2, .col-xs-2 {
            width: 16.5%;
        }
        .table-header {
            font-size: 12px;
        }
        .table-detail {
            height: 200px;
        }
        .name {
            word-break: break-all;
        }
        .badge {
            font-size: 12px;
        }
        .badge-column a {
            width: 20%;
        }
    }

    // .legend-row {
    //     margin-bottom: 15px;
    // }

    // .legend {
    //     display: inline-block;
    //     font-size: 12px;
    //     text-align: center;
    //     i {
    //         font-size: 10px;
    //         margin-left: 5px;
    //     }
    //     i:first-child {
    //         margin-left: 0;
    //     }
    // }

    #graph-section {
        position: relative;
        .legend {
            font-size: 12px;
            font-family: 'Open Sans';
        }
        rect {
            stroke-width: 2;
        }
        .donut-tooltip {
            display: none;
            font-size: 12px;
            font-family: 'Open Sans';
            left: 280px;
            padding: 10px;
            position: absolute;
            text-align: center;
            top: 85px;
            width: 100px;
            z-index: 10;
            color: white;
            background-color: black !important;
            border-radius:4px;
            border: 1px solid black;
        }
    }

    #graph-section svg{
        margin: 0 auto;
    }

    path.slice{
        stroke-width:2px;
    }

    polyline{
        opacity: .3;
        stroke: black;
        stroke-width: 2px;
        fill: none;
    }

    svg text.percent{
        fill:@black;
        text-anchor:middle;
        font-size:12px;
        font-weight: bold;
    }

    #pre-formatted-variables {
        border-radius: 4px;
        border: 1px solid @grey;
        overflow: auto;
        white-space: pre;
        word-break: break-all;
        word-wrap: break-word;
        padding: 9.5px;
        font-family: Fixed, monospace;
        max-height: 200px;
    }

    .footer-row {
        height: 20px;
    }

    .host_summary_row {
        margin-top: 15px;
        margin-bottom: -15px;
        margin-left: 0;
    }

    @media (max-width: 767px) {
        #job-detail-container {
            #job-status-form {
                #finished-time,
                #elapsed-time {
                    display: block;
                }
                #finished-time,
                #elapsed-time {
                    padding-left: 0;
                    margin-left: 0;
                    padding-top: 15px;
                }
            }
        }
    }
}
