@import '../imports/colours';
@import "../imports/mixins/grid";
@import "../imports/mixins/opacity";

/* Some old admin forms have toolbars up top */
.toolbar {
    background-color: var(--ds-background-input, #fefefe);
    border: 1px dotted var(--ds-border-accent-gray, #bbb);
    float: right;
    padding: 3px 5px;
    text-align: right;
    vertical-align: middle;
}

.toolbar .sectionStart {
    margin-left: 16px;
}

.toolbar a {
    text-decoration: none;
}

.toolbar a:hover {
    text-decoration: underline;
}

form.aui {
    select.imagebacked option,
    option.imagebacked {
        background-position: 5px 5px;
        background-repeat: no-repeat;
        background-size: 16px 16px;
        line-height: 20px;
        padding: 5px 5px 5px 26px;
    }

    &.top-label {
        .ajax_autocomplete > label {
            display: block;
            float: none;
            margin: 0 0 5px;
            padding: 0;
            text-align: left;
            width: auto;
        }
    }

    & .icon-required {
        &::before {
            text-indent: 0;
        }
    }

    div.error {
        clear: both;
        display: block;
        margin: 5px 0 0;
    }

    div.description {
        .aui-icon.aui-icon-small {
            margin-top: -2px;
        }
    }
}

/* Used on the admin project select issue type form only */
.tools {
    background-color: var(--ds-background-input, #fefefe);
    border: 1px dotted var(--ds-border-accent-gray, #bbb);
    padding: 3px 5px;
    text-align: left;
    vertical-align: middle;
}

select.imagebacked option,
option.imagebacked,
option.selectall {
    background-position: 1px 2px;
    background-repeat: no-repeat;
    padding: 2px 0 2px 20px;
    vertical-align: middle;
}

option.selectall {
    background-image: url(../../../images/icons/table_sql_select_16.png);
    border-bottom: 1px var(--ds-border-brand, #0085eb) dotted;
}

.jiraform {
    border-collapse: collapse;
    font-size: 13px;
    margin-top: @gutter;
    width: 100%;
}

.jiraform:first-child {
    margin-top: 0;
}

.jiraform td {
    padding: 0 5px 10px;
}

.jiraform td.formErrors {
    padding-top: 5px;
}

.descriptionrow td.jiraformheader {
    padding-bottom: 14px;
}

.formtitle {
    border-bottom: 1px solid var(--ds-border, #ddd);
}

.aui-buttons ~ .help-lnk {
    display: inline-block;
    margin: 10px 0 10px 10px;
}

.help-lnk + .formtitle {
    margin-top: 0;
}

.fieldLabelArea,
.fieldLabelAreaTop {
    vertical-align: top;
    text-align: right;
}

.fieldLabelArea {
    width: 180px;
}

.fieldValueArea {
    vertical-align: top;
}

.fieldLabelAreaBulk {
    text-align: left;
}

.buttons-container td {
    border-top: 1px solid var(--ds-border, #ddd);
    padding-top: 10px;
}

.formtitle + .aui-message,
.module + .buttons-container,
table.aui + .buttons-container {
    margin-top: @gutter;
}

.radio[disabled] + label {
    color: var(--ds-text-subtlest, @aui-color-mid);
}

/* // remove border for AUI table and Stepped processes */
table#issuetable + div.buttons-container,
table.aui + div.buttons-container,
.sub-heading {
    color: var(--ds-text-subtlest, #999);
}

.jiraform .radio {
    margin-right: 5px;
}

.availableActionRow td {
    vertical-align: top;
    padding-top: 2px;
    padding-bottom: 3px;
}

.availableActionRow .description {
    clear: left;
}

/* old deprecated classes - will be refactored out */
.redText {
    color: var(--ds-text-danger, @aui-color-R400);
}

.greenText {
    color: var(--ds-text-accent-green, #14892c);
}

/* Aim to remove - overrides */
.intform form {
    background-color: var(--ds-surface, #fff);
}

.intform form .fieldLabelArea {
    background-color: var(--ds-surface, #fff);
    width: 20%;
}

.intform form .fieldValueArea {
    background-color: var(--ds-surface, #fff);
    width: 70%;
}

.intform form table.maxWidth.jiraform {
    width: 100%;
}

.aui-popup .intform {
    max-height: 100%;
}

.aui-popup .intform #cancelButton {
    display: none;
}

.intform .jiraformheader {
    padding: 0.5em 1em;
}

.intform .formtitle {
    color: var(--ds-text, #333);
}

.intform .descriptionrow .jiraformheader {
    background-color: var(--ds-surface, #fff);
}

.intform .descriptionrow .desc-wrap,
.intform .jiraformfooter {
    padding: 0.75em 0.5em;
    text-align: left;
}

.intform .descriptionrow .notify {
    background-color: var(--ds-background-accent-magenta-bolder, #ff1493) !important;
}

/* Temp style to highlight old messages that should be updated. Remove before 4.4 JRADEV-4717 */
td.issue-fields-wrap {
    background-color: var(--ds-surface, #fff);
    padding: 0;
    width: 100%;
}

td.issue-fields-wrap .tabwrap {
    margin: 1em 0.5em;
}

/* Aim to remove - used in setup steps */
.formOne div {
    margin-bottom: 0.25em;
}

.formOne div .radio {
    position: relative;
    top: 2px;
}

body:first-of-type .formOne div .radio {
    top: 0;
}

/* safari only fix for JRA-17632 */
.field-description {
    margin: 0;
}

.disabled .field-description {
    .opacity(0.25);
}

.field-description p {
    margin: 0;
    padding: 0;
    font-size: 0.8em;
}

/* Project Import */
#project-import-panel {
    width: 800px;
    margin: 0 auto;
}

#project-import-panel ol {
    margin: 0 auto;
}

#project-import-panel .pb_border {
    margin: 15px 0;
    padding: 5px 0;
    border: none;
}

#project-import-panel .pb_border .pb_description {
    font-weight: normal;
}

.jiraform #projectDetailsTable.grayBox th {
    padding: 5px;
    vertical-align: top;
}

.field_label {
    color: var(--ds-text, #000);
    font-size: 12px;
    left: 7px;
    position: absolute;
    top: 1px;
}

.field_description {
    font-size: 12px;
    margin: 0 10px 0 10em;
}

.first .field_description {
    margin-top: 5px;
}

.last .field_description {
    margin-bottom: 3px;
}

.first .field_label {
    top: 6px;
}

.last .field_label {
    top: 1px;
}

.only .field_description {
    margin-bottom: 3px;
    margin-top: 5px;
}

.only .field_label {
    top: 6px;
}

.field_error {
    font-size: 11px;
    padding: 0 5px 1px 0;
    position: relative;
}

/* Old Wizards */
.wizard-buttons td {
    text-align: right;
}

.wizard-buttons .wizardInfo {
    float: left;
    text-align: left;
}

.hiddenButton {
    position: absolute;
    margin-left: -999em;
}

.darkFooter {
    background-color: var(--ds-surface, #f0f0f0);
    padding-bottom: 0.5em;
    padding-top: 0.5em;
    text-align: center;
    vertical-align: top;
}

.wizardCell {
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.wizardRow {
    background-color: var(--ds-surface, #f0f0f0);
    height: 40px;
    padding: 0;
    vertical-align: middle;
}

.wizardTable {
    padding: 0;
}

.wizardTable tbody table td {
    padding: 0 0.462em;
    vertical-align: top;
}

.wizardTable tbody table td:first-child {
    padding-left: 0;
}

/* Project config */
.projectOptions {
    clear: both;
    margin-top: 1.5em;
}

.projectOptions li {
    display: inline;
    background-color: var(--ds-background-input, #f2f2f2);
    margin-right: 1em;
    padding: 0.4em 0.3em;
    border: 1px solid var(--ds-border-accent-gray, #bbb);
}

/* Importers */
.codearea {
    border-radius: 10px;
    background-color: var(--ds-background-input, #f6f6f6);
    border: 1px dashed var(--ds-border-accent-gray, #bbb);
    margin: 1em auto;
    padding: 0 1em;
    width: 80%;
}

pre.codearea h4 {
    border-bottom: 1px solid var(--ds-border-accent-gray, #bbb);
}

pre.codearea textarea {
    background-color: var(--ds-background-input, #f6f6f6);
    border: none;
    font-family: monospace;
    font-size: 100%;
    height: 300px;
    margin-bottom: 1em;
    width: 100%;
}

/* Misc */
.fieldDescription {
    display: block;
    clear: left;
}

#issuelinks-linktype {
    display: block;
    margin-bottom: 5px;
}

#changeTranslationLocale {
    margin-top: 2em;
}

#changeTranslationLocale .button {
    margin-top: 0;
}

/* Contextual Overrides */

/* Issue Nav */
.iss-nav .formLabel,
.iss-nav .fieldLabelArea,
.iss-nav .fieldLabelAreaTop,
.iss-nav .fieldLabelAreaBulk {
    background-color: var(--ds-surface, #fff);
}

.iss-nav .maxWidth {
    width: 100%;
}

.iss-nav .titlerow td {
    padding-left: 0;
}

.iss-nav .formtitle {
    border-bottom: 1px solid var(--ds-border, #ddd);
    color: var(--ds-text, #222);
    font-size: 16px;
    margin-top: 5px;
}

.add-group {
    clear: both;
}

/* draggable grabable items */
.ab-drag-wrap {
    clear: both;
    background-color: var(--ds-surface-overlay, #f0f0f0);
    float: left;
    overflow: auto;
    margin-top: 14px;
    padding: 7px;
    min-width: 350px;
    border-radius: 7px;
}

.ab-drag-wrap .buttons-container {
    margin-top: @grid;
}

.ab-drag-container {
    float: left;
    width: 340px;
    margin-left: 16px;
}

.ab-drag-container:first-child {
    margin-left: 0;
}

.ab-drag-container h4 {
    margin: 7px 0;
}

.ab-items {
    background-color: var(--ds-surface, #fff);
    border: 1px solid var(--ds-border-accent-gray, #bbb);
    padding: 7px;
}

.grabable {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 100px;
    padding-bottom: 28px;
}

.grabable li {
    background-color: var(--ds-background-input, #f7f7f7);
    border: 1px solid var(--ds-border, #ddd);
    cursor: move;
    margin: 3px;
    padding: 3px;
    border-radius: 3px;
}

.grabable li:hover {
    background-color: var(--ds-surface-hovered, #d8e4f0);
}

/* used in oAuth pages admin and look & feel view */
#userformat .module,
#userformat .mod-header h3,
#userformat .mod-header {
    background-color: transparent;
}

#userformat .mod-header {
    background-image: none;
}

#darktheme-warning {
    margin: 16px 0;
}

#darktheme-warning .title {
    padding-bottom: 10px;
    font-size: 1.2em;
}

html[data-color-mode="light"] {
    #darktheme-warning {
        display: none;
    }
}

#userformat #full_profile_ops .item-details,
.user-details-container #full_profile_ops .item-details {
    list-style-type: disc;
    padding-left: 16px;
}

.user-details-container {
    width: 60%;
    margin-bottom: 2em;
}

/* look and feel edit */
.landf-restore {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid var(--ds-border, #ddd);
}

/* edit user defaults */
#edit_user_defaults .fieldLabelArea {
    width: 30%;
}

/* integrity checks */
.integrity-checks {
    margin: 6px 0;
}

.integrity-checks p {
    margin-bottom: 0;
    padding-left: 20px;
}

.integrity-checks input {
    margin-right: 3px;
}

/* view logging */
.logging-container {
    margin-bottom: 2em;
}

/* viewgroup.jsp */
.view-group-container .item-details {
    margin-bottom: 1em;
}

.view-group-container h4 {
    margin: 0.5em 0;
}

/* subscribefilter.jsp */
table#filter-subscription-cron {
    border-spacing: 0;
    border-collapse: collapse;

    .fieldLabelArea {
        width: 130px;
    }
    .fieldLabelArea + .fieldValueArea {
        padding-left: 10px;
    }

    .fieldValueArea label + label {
        margin-left: 10px;
    }

    .cron-options-tab-panel {
        padding: 0;
        margin: 0;

        > table {
            border-collapse: collapse;
            padding: 0;
        }

        td {
            padding: 10px 0 0;
        }
    }

    td {
        padding: 0;
    }
}

/* projectimportselectproject.jsp
***
*** Be good to re-factor the js in this and use proper aui-messages
***
*/
#project_summary {
    margin-bottom: 1em;
}

table.bulk-edit-user-groups thead tr th,
table.bulk-edit-user-groups tr.butt-row td {
    text-align: center;
}

table.bulk-edit-user-groups .field-group {
    width: 90%;
    margin: 0 auto;
}

table.bulk-edit-user-groups .field-group select {
    min-width: 100%;
    margin-bottom: 1em;
}

/* May be able to remove this once updating this form to use AUI Forms */
#filterSearchForm {
    margin-bottom: 0;
}

.filterSearchInput {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

.filterSearchInput .fieldLabelArea {
    width: 150px;
}

/* .filterSearchInput .buttons input { margin-left: 157px; } */
.filterSearchInput font {
    font-size: 0.9em !important;
}

.filterSearchInput .fieldDescription {
    font-size: 0.9em;
}

#filter_search_results {
    padding-top: @grid;
}

#filter_search_results .pagination {
    clear: both;
    margin: 0 0 0.714em;
}

#oauth-plugin form.aui fieldset div {
    margin-top: 1em;
}

#oauth-plugin form.aui label {
    display: block;
    font-weight: 700;
}

#oauth-plugin form.aui .description {
    display: block;
    font-size: 11px;
}

#oauth-plugin form.aui label .form-icon {
    display: inline-block;
    width: 16px;
}

#oauth-plugin form.aui label .form-icon span {
    display: none;
}

#oauth-plugin form.aui .field-value {
    margin-bottom: 6px;
}

#oauth-plugin div.content .content {
    margin: 0;
}

#embcwd.list-directories {
    padding: 0;
}

#embcwd.list-directories h3 {
    font-size: 16px;
    margin: 10px 0;
}

#embcwd.list-directories p.description {
    padding: 0;
    margin: 16px 0 0;
}

#embcwd.list-directories p.description:first-child {
    margin-top: 0;
}

#embcwd.list-directories #new-directory {
    margin: 16px 0;
}

.issuepicker {
    border-top: 1px solid var(--ds-border-focused, @aui-color-atlassian);
}

.multi-picker-pop {
    border-top: 1px solid var(--ds-border, @aui-border-color);
    padding-top: @grid;
}

.overlabel {
    color: var(--ds-text-subtlest, @aui-color-mid);
    display: none;
}

.overlabel-apply {
    color: var(--ds-text-subtlest, @aui-color-mid);
    cursor: text;
    font-style: italic;
    position: absolute;
    text-align: left;
    left: 0;
    top: 0;
    padding: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

form.aui .field-group label.overlabel {
    left: 3px;
    top: 3px;
}

#add-project-fields {
    .sample-project-container {
        max-width: 340px;
    }

    input.text[name="key"] {
        width: 125px;
    }

    .jira-inline-avatar-picker-trigger {
        cursor: pointer;
    }
}

#edit-project-warning-message {
    margin: 0 0 10px;
}

#project-edit-key {
    width: 125px;
}

#edit-project-key-toggle {
    margin-left: 10px;
}

a.aui-iconised-link div.yad {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#manage-attachments .buttons-container.form-footer {
    border-top: 0;
}

#assign-to-me-trigger {
    display: inline-block;
    margin-left: 10px;
}

.full-width-field ~ #assign-to-me-trigger,
.jira-dialog #assign-to-me-trigger {
    display: table;
    margin-left: 0;
    margin-top: 5px;
}

#issue-filter .date-searcher,
.date-searcher {

    min-width: 370px;

    .field-group {
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 12px;
        font-weight: 600;
        color: var(--ds-text-subtle, @aui-color-N200);
        white-space: nowrap;

        &[data-date-type=nowOverdue] {
            margin-bottom: 8px;
        }

        .error {
            margin-left: 25px;
        }

        .js-dp-type-toggle {
            margin-left: 0;
            margin-right: 8px;
        }

        label,
        input,
        select,
        span.icon-date {
            float: none;
            display: inline-block;
        }

        input,
        select,
        span.icon-date,
        .helpLink {
            margin: 0 1px;
        }

        input[type='text'] {
            width: 90px;
        }
        label {
            width: auto;
            margin: 0 3px 0 0;
        }
    }
    .field-group:last-of-type {
        margin-bottom: 0;
    }
    ~ .description {
        padding-top: 5px;
    }
}

.m-datePicker-btn {
    color: inherit;
    background: none;
    cursor: pointer;
}

//JRADEV-18576 spacing issue. If time wasn't a factor it would be nice to re-write these pickers.
.selectorform {
    margin-bottom: @gutter;
}

//JRA-24112 overriding AUI form field "T-Shirt" widths for user-created select/multiselect custom fields
#issue-workflow-transition .cf-select,
#create-issue-dialog .cf-select,
#edit-issue-dialog .cf-select,
#issue-create .cf-select,
#issue-edit .cf-select {
    max-width: 100%;
    min-width: 0;
    width: auto;
}

#assign-issue,
#log-work,
#comment-add,
#comment-edit {
    .jira-attachment-field {
        display: none;
    }
}

// The things that shouldn't have been dumped in to forms.less, but were anyway and now need to be included elsewhere
@import "content/options-list.less";
@import "popups/create-issue-popup.less";
@import "popups/create-project-popup.less";
@import "popups/share-issue-popup.less";
@import "popups/manage-watchers-popup.less";
@import "popups/add-comment-popup.less";
