@import 'core/css/variables';

html, body {
    height: 100%;
    background-color: $background-color;
}

h1, h2, h3, h4 {
    color: $headline-color;
    background-color: $headline-background-color;
    line-height: 40px;
}
h5, h6 {
    color: $headline-color;
    background-color: $headline-background-color;
    font-size: medium;
    line-height: 20px;
}
h1 {
    font-size: 28px;
}
h2 {
    font-size: 24px;
}
.sidebar h2,
.modal h2 {
    font-size: 20px;
}
h3 {
    font-size: 16px;
}
h4 {
    font-size: 14px;
}
form {
    margin-bottom: 20px;
}
.extend {
    width: 100%;
}

a {
    color: $link-color;

    &:visited {
        color: $link-color-visited;
    }
    &:hover {
        color: $link-color-hover;
    }
    &:focus {
        color: $link-color-focus;
    }

    &.btn {
        color: white;

        &:visited {
            color: white;
        }
        &:hover {
            color: white;
        }
        &:focus {
            color: white;
        }
    }
}

code {
    word-wrap: break-word;

    &.code-questions {
        color: rgb(16, 31, 112);
        background-color: rgba(16, 31, 112, 0.1);
    }
    &.code-options {
        color: rgb(255, 100, 0);
        background-color: rgba(255, 100, 0, 0.1);
    }
    &.code-options-provider {
        color: white;
        background-color: rgba(255, 100, 0, 0.8);
    }
    &.code-conditions {
        color: rgb(128, 0, 128);
        background-color: rgba(128, 0, 128, 0.1);
    }
    &.code-tasks {
        color: rgb(128, 0, 0);
        background-color: rgba(128, 0, 0, 0.1);
    }
    &.code-views {
        color: rgb(0, 128, 0);
        background-color: rgba(0, 128, 0, 0.1);
    }
    &.code-order {
        color: rgb(96, 96, 96);
        background-color: rgba(96, 96, 96, 0.1);
    }
}

table {
    p {
        margin-bottom: 5px;
    }
    p:last-child {
        margin-bottom: 0;
    }
}

.table-break-word {
    td {
        word-break: break-all;
    }
}

/* navbar */

.navbar-default {
    background-color: $navigation-background-color;
    border-bottom: none;

    .navbar-brand,
    .navbar-nav > li > a,
    .navbar-nav > li > a:focus {
        color: $navigation-color;
        background-color: transparent;
    }
    .navbar-brand:hover,
    .navbar-nav > li > a:hover,
    .navbar-nav > .open > a,
    .navbar-nav > .open > a:focus,
    .navbar-nav > .open > a:hover {
        color: $navigation-hover-color;
        background-color: $navigation-hover-background-color;
    }

    .dropdown li.divider:first-child {
        display: none;
    }
}

/* content */

.content {
    padding-top: 50px; /* same height as the navbar */
}
.sidebar {
    /* make the sidebar sticky */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}
.page, .sidebar {
    height: 100%;
    margin-top: 10px;
    margin-bottom: 60px;
}
.page h2:nth-child(2) {
    margin-top: 0;
}
.sidebar h2:first-child {
    margin-top: 70px;
}

/* questions overview */

.section-panel {

}

.subsection-panel {
    margin-left: 40px;
}

.group-panel {
    margin-left: 80px;

    table th:first-child,
    table td:first-child {
        padding-left: 15px;
    }

    table th:last-child,
    table td:last-child {
        padding-right: 15px;
    }
}

/* angular forms */

.input-collection {
    margin-bottom: 15px;
}

/* forms */

.form-label {
    margin-bottom: 5px;
    font-weight: 700;
}

form .yesno label {
    margin-right: 10px;
}

.row {
    .checkbox,
    .radio {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    @media (min-width: $screen-xs-max) {
        .checkbox-padding .checkbox,
        .radio-padding .radio {
            margin-top: 32px;
            margin-bottom: 11px;
        }
    }
}

.input-xs {
    height: 24px;
    padding: 5px 10px;
    font-size: 11px;
    line-height: 1;
    border-radius: 2px;
}

.help-block.info {
    margin-top: 0;
}

.sidebar-form {
    display: flex;

    .sidebar-form-button {
        margin-left: 5px;
    }
}

.upload-form {
    .upload-form-field {
        position: relative;

        cursor: pointer;
        border-radius: 4px;

        flex-grow: 1;
        overflow: hidden;

        p,
        input {
            height: 34px;
            width: 100%;
            margin: 0px;
        }

        p {
            text-align: left;
            cursor: pointer;

            color: $link-color;
            border: 1px solid silver;
            border-radius: 4px;

            padding: 6px 14px;

            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        input {
            position: absolute;
            z-index: 1;
            padding: 0;
            opacity: 0;
        }

        &:hover {
            background-color: #e6e6e6;
        }
    }
}

/* modals */

.modal-body {
    > p:last-child,
    formgroup:last-child .form-group {
        margin-bottom: 0;
    }

    .copy-block {
        margin-bottom: 20px;
    }

    .help-block {
        font-size: small;
        word-break: break-word;
    }

    .nav.nav-tabs {
        margin-bottom: 20px;
    }
}

/* options */

.options-dropdown {
    display: inline-block;

    > a {
        cursor: pointer;
    }
}

/* panels */

.panel-default {
    min-height: 5px;
}

.panel-body {
    padding-top: 10px;
    padding-bottom: 10px;
}

.panel li > p:last-child {
    margin-bottom: 0;
}

/* lists */

ul.list-arrow li {
    margin-left: 20px;

    &.active {
        margin-left: 0;
    }

    &.active a:before {
        float: left;
        width: 20px;
        text-align: right;
        content: '\2192\0000a0'; /* right-arrow followed by a space */
    }
}

/* misc */
.form-errors {
    margin-bottom: 20px;
}
li > a.control-label > i {
    display: none;
}
li.has-error > a.control-label > i,
li.has-warning > a.control-label > i {
    display: inline;
}
.email-form label,
.connections-form label {
    display: block;
    margin: 0;
    line-height: 40px;
    border-bottom: 1px solid $modal-border-color;
}
.email-form label:first-child,
.connections-form label:first-child {
    border-top: 1px solid $modal-border-color;
}
.email-form label input,
.connections-form label input {
    margin-left: 5px;
    margin-right: 5px;
}
.email-form .email-form-buttons,
.connections-form .connections-form-buttons {
    margin-top: 10px;
}
.socialaccount_providers {
    margin: 0;
    padding: 0;
    height: 42px;
}
.socialaccount_providers li {
    float: left;
    margin: 0 5px 10px 5px;
    list-style: none;
}
.socialaccount_providers li.socialaccount_provider_break {
    float: none;
    margin-left: 0;
    margin-right: 0;
}
.socialaccount_provider_name {
    line-height: 29px;
    font-weight: bold;
}
.logout-form {
    margin: 0;
}
.logout-form .btn-link {
    padding: 3px 20px;
    color: $navigation-dropdown-color;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    white-space: nowrap;
}
.logout-form .btn-link:hover {
    color: $navigation-dropdown-hover-color;
    background-color: $navigation-dropdown-hover-background-color;
    text-decoration: none;
}
.logout-form .btn-link:focus {
    color: $navigation-dropdown-hover-color;
    background-color: $navigation-dropdown-hover-background-color;
    text-decoration: none;
    outline: none;
}
.rdmo-logo {
    width: 240px;
    margin-top: 40px;
}

// adjust background "hover" color in select2 to $link-color
.select2-results__option--highlighted{
    background-color: $link-color !important,
}

.btn-import {
    margin-top: 70px;
    width: 100%;
    display: block;
}

.cc-myself {
    .checkbox {
        margin: 0;
    }
}

.ng-binding {
    :last-child {
        margin-bottom: 0;
    }
}

.inline_image {
    max-width: 100%;
}

[data-toggle="tooltip"] {
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
}
