/**
 * Custom CSS for dBase, post Steven.
 */



/* General CSS Styles */
textarea {
    height: 50px;
    background-color: #00A8A8;
}

input:disabled {
    background-color: #777;
}

main {
    position: relative;
}

table,
thead,
tbody,
tr,
th,
td {
    position: relative;
    z-index: 1;

    box-sizing: border-box;
}

table {
    margin-top: 1em;
    margin-bottom: 1em;
}

table tr,
table th,
table td {
    position: relative;
    z-index: 2;
    overflow: hidden;
}

main i {
    font-size: 70%;
}

table tr th.sortable {
    text-decoration: underline;
    cursor: pointer;

    border-right: 1px solid grey;
    border-left: 1px solid grey;
}

button.btn {
    cursor: pointer;
}

/* General CSS Classes */
.collapsible-trigger {
    cursor: pointer;
}

.collapsible-icon {
    float: left;
    margin-left: 40px;
    margin-right: -40px;
    cursor: pointer;
}

.add-form-button {
    text-decoration: none;
    background-color: #EEEEEE;
    color: #333333;
    padding: 2px 6px 2px 6px;
    border-top: 1px solid #CCCCCC;
    border-right: 1px solid #333333;
    border-bottom: 1px solid #333333;
    border-left: 1px solid #CCCCCC;
    border-radius: 5px;

    cursor: pointer;
}


/* Modal CSS */
.modal {
    font-size: 20px;
    background-color: #123f51;
    border: 1px solid grey;
}

.modal input {
    background-color: #016464;
}

.modal-trigger-button {
    width: 100%;
    height: 25px;
    background: buttonface;
    padding: 10px;
    text-align: center !important;
    justify-content: center !important;
    border-radius: 5px;
    color: buttontext;
    font-weight: bold;
    line-height: 25px;
    text-decoration: none;
}

/* Select2 CSS  */
.form-widget-select2,
.form-widget-select2-multiple,
.form-widget-select2-with-tagging {
    width: 100%;
    min-width: 15em;
}

.select2-container,
.select2-dropdown,
.select2-container-default,
.select2-results,
.select2-search,
.select2-container--default .select2-selection,
.select2-container--default .select2-selection .select2-selection__rendered,
.select2-container--default .select2-search__field {
    color: #003333;
    background-color: #00A8A8;
    border-radius: 4px;
    border-color: #00A8A8;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #016464;
    color: #6badad;
}

.select2-container > .selection {
    min-width: 100%;
    max-width: 100%;
}

/* Disabled Select2 */
.select2-selection[aria-disabled="true"],
.select2-selection[aria-disabled="true"] .select2-selection,
.select2-selection[aria-disabled="true"] .select2-selection__rendered,
.select2-selection[aria-disabled="true"] .select2-selection__arrow b {
    color: darkgray;
    background-color: gray;
    border-color: gray;
    cursor: default;
}

.select2-selection[aria-disabled="true"] .select2-selection__arrow {
    display: none;
}

/* Placeholder text */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #006161;
}

/* Dropdown Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #000 transparent transparent transparent;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #000 transparent;
}

/* Currently selected element */
.select2-container--default .select2-results__option[aria-selected="true"] {
    color: teal;
    background-color: #123f51;
}

/* Currently hovered element */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff;
    background-color: #1b4993;
}

/* formatting for django form.as_table */
div.form-table {
    border: 2px solid #808080;
    border-radius: 8px;
    padding: 1em;
    margin: 1em;
    font-size: 0.9em;
    font-family: Arial, Helvetica, sans-serif;
}

.form-table {
    border-collapse: collapse;
    min-width: 700px;
    width: auto;
    max-width: max-content;
}

.form-table table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

.form-table table span.select2,
.form-table table input,
.form-table table select {
    font-family: Arial, Helvetica, sans-serif;
    color: #003333;
    border-radius: 4px;
    max-width: 100%;
}

.form-table table input,
.form-table table select {
    padding: .25em;
    /* font-size: 1.1em; */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

table.form-table input::placeholder,
table.form-table select::placeholder {
    color: #006161;
}

.form-table tr {
    height: 2em;
}

.form-table tr td:first-child {
    border-bottom: 1px solid gray;
}

.form-table tr.form-submit-action-buttons td {
    border-bottom: none;
}

br + span.helptext {
    display: inline;
}

/* Formatting for formsets */
div.formset-table-container {
    border: 2px solid #808080;
    border-radius: 8px;
    padding: 1em;
    /* width: 100%; */
    max-width: 100%;
    margin-top: 1em;
    margin-bottom: 1em;
}

table.formset-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9em;
}

table.formset-table span.select2 {
    /* width: 100%; */
    font-size: 0.9em;
}

table.formset-table input {
    /* width: 100%; */
    font-family: inherit;
    font-size: inherit;
    border-radius: 4px;
    /* padding: .30em; */
    color: #003333;
}

table.formset-table input::placeholder {
    color: #006161;
}

table.formset-table input[type="checkbox"] {
    width: 1em;
    height: 1em;
    accent-color: #00A8A8;
    vertical-align: middle;
}

/* Ensure anchor tags are inline with inputs inside td elements */
table.formset-table td {
    white-space: nowrap;
}

table.formset-table td input,
table.formset-table td a {
    display: inline-block;
    vertical-align: middle;
}

/* Button to add a form to a formset */
div.formset-table button.add-form {
    background-color: #4CAF50;
    color: white;
}

/* Button to remove a form from a formset */
div.formset-table-container button.remove-form {
    background-color: #9e0000;
    color: white;
    border: none;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 0.3em;
}

/* Big Button - to span across the form */
.big-button {
    color: white;
    background-color: darkslategray;
    width: 100%;
    padding: 1em;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1em auto;
    cursor: pointer;
    font-size: 1em;
    border-radius: 8px;
}

/* Buttons from form ChoiceField choices */
button.submit-action-button {
    font-size: 1em;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Anchor tag that looks like the buttons above */
a.link-button {
    font-size: 1em;
    padding: 8px 16px;
    margin: 1em;
    background-color: darkslategray;
    border-radius: 8px;
    text-decoration: none;
}

/* css to expand an anchor in the first td of a table to be clickable across the tr */
div.link-table {
    overflow: hidden;
}

table.link-table.table tr.link-row:hover {
    background-color: darkslategray;
}

table.link-table tr td:first-child {
    position: relative;
}

tr.link-row td a.link-row:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: block;
    width: 100vw;
}

tr.link-row td a.link-row {
    color: inherit;
    text-decoration: none;
}

/* Menu Display CSS */
.core-menu-options {
    width: 325px;
    margin-right: 2%;

    border-right: 1px solid #808080;
}

.core-menu-options ul {
    text-align: left;
}

.core-menu-items {
    display: flex;
    flex-direction: column;
    flex: 5;

    margin-right: 5%;
    margin-left: 5%;
}

.core-menu-items hr {
    width: 100%;
}

.core-menu-items ul {
    margin-left: 20%;

    text-align: left;
}


/* Extra report formatting. */
main .report-form > div {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

main .report-form > div > div {
    width: 100%;
}

main .report-form .default-report-form-fields {
    padding-left: 5%;

    border-left: 1px solid #808080;
}



/* Custom formatting specific to updated BillTo/ShipTo edit views */
main .customer-edit-sticky {
    position: sticky;
    top: 0;
    right: 0;
    left: 0;

    z-index: 10;

    padding-top: 5px;

    background-color: #000;
    border-bottom: 1px solid grey;
}

main .customer-edit-submit-sticky {
    position: sticky;
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 10;

    padding-top: 5px;

    background-color: #000;
    border-top: 1px solid grey;
}

main .customer-edit-form {
    padding: 10px;
}

main .customer-edit-form h2,
main .customer-edit-form h3 {
    font-weight: bold;
    text-align: center;
}

main .customer-edit-form .form-subsection,
main .customer-contact-form .form-subsection,
main .customer-virtual-note-form .form-subsection {
    margin-top: 15px;
    margin-bottom: 15px;

    background-color: #123f51;
    border: 1px solid grey;
    border-radius: 15px;
}

main .customer-contact-form > div,
main .customer-virtual-note-form > div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

main .customer-contact-form .form-subsection,
main .customer-virtual-note-form .form-subsection {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    min-width: 25%;
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 10px;
    padding-left: 10px;
}

main .customer-virtual-note-form .virtual-note {
    width: 100%;
}

main .customer-contact-form .form-subsection > *,
main .customer-contact-form .form-subsection > * > *,
main .customer-virtual-note-form .form-subsection > *,
main .customer-virtual-note-form .form-subsection > * > * {
    display: flex;
    flex-direction: row;
    flex: 1;
    width: 100%;
}

main .customer-virtual-note-form .form-subsection > p.text-area {
    display: block;
}

main .customer-contact-form .empty-form,
main .customer-virtual-note-form .empty-form {
    display: none;
}

main .new-customer-overarching {
    background-color: #202f35 !important;
}

main .new-customer-billto {
    background-color: #333b5c !important;
}

main .new-customer-shipto {
    background-color: #36263b !important;
}

main .customer-edit-form .form-subsection > div,
main .customer-contact-form .form-subsection > div,
main .customer-virtual-note-form .form-subsection > div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;

    padding: 10px;
}

main .customer-edit-form .form-subsection > div > div,
main .customer-contact-form .form-subsection > div > div,
main .customer-virtual-note-form .form-subsection > div > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex: 1;

    min-width: 25%;
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 10px;
    padding-left: 10px;

    box-sizing: border-box;
}

main .customer-edit-form .form-subsection > div > div > *,
main .customer-contact-form .form-subsection > div > div > *,
main .customer-virtual-note-form .form-subsection > div > div > * {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;

    margin-right: 10px;
    margin-left: 10px;

    text-align: left;
}

main .customer-edit-form .form-subsection > div > div > p {
    margin-bottom: 3px;
}

main .customer-contact-form .form-subsection > p,
main .customer-virtual-note-form .form-subsection > p {
    margin-top: 3px;
    margin-bottom: 3px;
}

main .customer-edit-form .form-subsection > div > p,
main .customer-edit-form .form-subsection > div > hr,
main .customer-edit-form .form-subsection > div > div > input[type=text],
main .customer-edit-form .form-subsection > div > div > input[type=number],
main .customer-edit-form .form-subsection > div > div > select,
main .customer-edit-form .form-subsection > div > div > textarea,
main .customer-edit-form .form-subsection > div > div > p,
main .customer-contact-form .form-subsection > div > div > input[type=text],
main .customer-contact-form .form-subsection > div > div > input[type=number],
main .customer-contact-form .form-subsection > div > div > select,
main .customer-contact-form .form-subsection > div > div > textarea,
main .customer-contact-form .form-subsection > div > div > p,
main .customer-virtual-note-form .form-subsection > div > div > input[type=text],
main .customer-virtual-note-form .form-subsection > div > div > input[type=number],
main .customer-virtual-note-form .form-subsection > div > div > select,
main .customer-virtual-note-form .form-subsection > div > div > textarea {
    width: 100%;
}

main .customer-edit-form .form-subsection > div > div > p {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;

    border-bottom: 1px solid grey;
}

main .customer-edit-form .form-subsection > div > div > p > i {
    flex: 1;
    text-align: right;
}

main .customer-edit-form .form-subsection > div > p {
    text-align: center;
}

main .customer-edit-form .form-subsection > .header-div,
main .header-div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

main .customer-edit-form .form-subsection > .header-div span,
main .header-div span {
    min-width: 150px;
}

main .customer-edit-form .form-subsection > .header-div .button,
main .header-div .button {
    flex: 0;
    min-width: auto;
    width: auto;

    white-space: nowrap;
    cursor: pointer;
}

main .customer-edit-form .form-subsection > div > div > .relation-info,
main .customer-contact-form .form-subsection > p > .relation-info,
main .customer-virtual-note-form .form-subsection > p > .relation-info {
    color: white;
    background-color: #016464;
    width: 100%;
}

main .customer-edit-form .form-subsection h4 {
    text-decoration: underline;
    width: 100%;
    text-align: center;
}

main .customer-edit-form .form-subsection > div > div > div.date-wrapper {
    align-items: center;
    width: 100%;
}

main .customer-edit-form .form-subsection > div > div > div > .date {
    width: 100%;
}


main .customer-edit-form table tr:nth-child(2n) td {
    background-color: #1C5C5C;
}

/* Specific CSS for customer merge pages */
p.merge-primary,
th.merge-primary {
    color: #9dff9d;
    font-weight: bold;
}

p.merge-secondary,
th.merge-secondary {
    color: #ff8d8d;
    font-weight: bold;
}

col.merge-primary {
    background-color: #003300;
}

col.merge-secondary {
    background-color: #330000;
}
