@import 'core/css/variables';

.daiquiri-query {
    min-height: 750px;
}

h2.daiquiri-query-form-title,
h2.daiquiri-query-job-title {
    margin-top: 0;
    margin-bottom: 10px;
}

p.daiquiri-query-form-help {
    margin-bottom: 20px;
}

.daiquiri-query-form-bar {
    margin-bottom: 20px;
}

.daiquiri-query-job-tabs {
    margin-top: 20px;
    margin-bottom: 20px;
}

.daiquiri-query-plot {
    .daiquiri-query-plot-button {
        margin-top: 25px;
    }
    .daiquiri-query-plot-canvas {
        margin-bottom: 10px;
        height: 500px;
    }
}

.daiquiri-query-download {
    h4:first-child {
        margin-top: 20px;
    }
}

.daiquiri-query-joblist {
    .daiquiri-query-joblist-jobs {
        max-height: 400px;
        overflow-y: auto;

        .list-group-link:last-child > a {
            border-radius: 0;
        }

        .daiquiri-query-joblist-run-id {
            background-color: #f9f9f9;
        }

    }

    .daiquiri-query-joblist-jobs:last-child {
        .daiquiri-query-joblist-group {
            .list-group-link:first-child {
                // the first li of any group should have a top border
                border-top-width: 1px;
            }
        }

        .daiquiri-query-joblist-group:first-child {
            .list-group-link:first-child {
                // the first li of the first group should not have border
                border-top-width: 0;
            }
        }

        .daiquiri-query-joblist-group:last-child {
            .list-group-link:last-child {
                > a {
                    // the link of the last li of the last group should have a border bottom radius
                    // if no footer is present
                    border-bottom-right-radius: 4px;
                    border-bottom-left-radius: 4px;
                }
            }
        }
    }

    .daiquiri-query-joblist-no-jobs .list-group-link {
        border-bottom-width: 0;
    }

    // .list-group+.panel-footer {
    //     border-top-width: 1px;
    // }
}

.daiquiri-query-dropdowns {
    position: relative;
    margin-bottom: 10px;

    @media (max-width: $screen-xs-max) {
        >button {
            width: 100%;
            margin-bottom: 10px;
            text-align: left;

            &.pull-right {
                float: none !important;
            }
        }
    }

    .daiquiri-query-dropdown {

        @media (min-width: $screen-xs-max) {
            position: absolute;
            top: 39px;
            left: 0;
            right: 0;
        }

        .daiquiri-browser {
            margin-bottom: 5px;
        }
        .daiquiri-browser-body {
            height: 168px;
        }
        &.daiquiri-query-dropdown-filter {
            .daiquiri-browser-body {
                height: 123px;
            }
        }
        .daiquiri-query-dropdown-head {
            border-top: 1px solid $border-color;
            border-right: 1px solid $border-color;
            border-left: 1px solid $border-color;

            padding: 5px 15px;

            .daiquiri-query-dropdown-form {
                margin: 0;
            }
        }
        .daiquiri-query-dropdown-body {
            border: 1px solid $border-color;
            height: 155px;

            overflow-y: auto;

            ul.text-danger {
                margin: 0;

                li {
                    margin: 8px;
                }
            }
            table {
                margin: 0;
            }
        }
    }
}

@media (min-width: $screen-xs-max) {
    .daiquiri-query-dropdowns-area {
        height: 220px;
    }
}

.CodeMirror {
    height: 250px;
}

.has-error .CodeMirror {
    border-color: $error-color;
}

.codemirror-error {
    border-radius: 1px;
    background-color: $error-background-color;
}
