/*
    Optimalscans DJANGO Admin style
*/

@import url(fonts.css);

/* VARIABLE DEFINITIONS */
:root {
    /* Optimalscans logo colors */
    --optimalscans-dark-dark-blue: rgb(49, 91, 166);
    --optimalscans-dark-blue: rgb(62, 141, 204);
    --optimalscans-blue: rgb(0, 146, 249);
    --optimalscans-green: rgb(163, 176, 60);
    --optimalscans-yellow: rgb(250, 170, 25);
    --optimalscans-red: rgb(165, 29, 23);
    --optimalscans-dark-green: rgb(10,133,32);

    /* Global site colors */
    --default-white: rgb(235, 235, 235);
    --default-black: rgb(10, 10, 10);
    --dark-dark-gray: rgb(23, 23, 23);
    --dark-gray: rgb(51, 51, 51);
    --gray: rgb(105, 105, 105);
    --light-gray: rgb(215, 215, 215);
    --light-light-gray: rgb(230, 230, 230);

    /* Light mode colors (default site color) */
    --primary: rgb(53, 54, 58);
    --secondary: rgb(235, 235, 235);
    --header-color: rgb(235, 235, 235);
    --accent: rgb(23, 23, 23);

    --primary-fg: rgb(235, 235, 235);
    --body-fg: rgb(51, 51, 51);
    --body-bg: rgb(235, 235, 235);
    --body-quiet-color: rgb(51, 51, 51);
    --body-loud-color: rgb(0, 0, 0);
    --container-bg: rgb(250, 250, 250);
    --darkened-bg: rgb(231, 231, 231);
    --selected-bg: rgb(228, 228, 228);

    --header-bg: rgb(231, 231, 231);
    --header-link-color: var(--default-black);
    --breadcrumbs-link-fg: var(--default-black);
    --breadcrumbs-fg: var(--default-black);
    --breadcrumbs-bg: var(--default-white);
    --link-hover-color: rgb(0, 51, 102);
    --link-fg: var(--dark-gray);
    --link-selected-fg: rgb(91, 128, 178);
    --hairline-color: rgb(232, 232, 232);
    --border-color: rgb(204, 204, 204);
    --fieldset: rgb(242, 242, 242);
    --moduleh1: var(--light-gray);
    --moduleh2: var(--optimalscans-green);
    --inlineh3: var(--light-gray);
    --inlineh3-text: var(--default-black);

    --selected-row: var(--light-gray);
    --tablerow: var(--default-white);
    --tablerowodd: var(--light-light-gray);
    --table-link: var(--dark-gray);

    --error-fg: rgb(186, 33, 33);
    --message-success-bg: rgb(221, 255, 221);
    --message-warning-bg: rgb(255, 255, 204);
    --message-error-bg: rgb(255, 239, 239);

    --button-fg: rgb(255, 255, 255);
    --button-bg: var(--optimalscans-blue);
    --button-hover-bg: var(--optimalscans-dark-blue);
    --default-button-bg: var(--optimalscans-green);
    --default-button-hover-bg: rgb(122, 131, 20);
    --close-button-bg: var(--gray);
    --close-button-hover-bg: rgb(116, 116, 116);
    --delete-button-bg: var(--optimalscans-red);
    --delete-button-hover-bg: rgb(97, 11, 11);

    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);
    --usertools-fg: var(--gray);
    --app-link-color: var(--default-black);
    --content-related-bg: rgb(242, 242, 242);
    --label-color: var(--default-black);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode colors */
        --darkmode-primary: rgb(18, 18, 18);
        --darkmode-secondary: rgb(31, 31, 31);
        --darkmode-gray: rgb(41, 41, 41);
        --darkmode-dblue: rgb(31, 63, 119);
        --darkmode-dark-blue: rgb(49, 91, 166);

        --primary: var(--darkmode-primary);
        --secondary: var(--darkmode-secondary);
        --header-color: var(--default-white);
        --accent: var(--dark-dark-gray);
        --button-bg: var(--optimalscans-dark-dark-blue);
        --link-fg: var(--default-white);
        --breadcrumbs-fg: var(--default-white);
        --breadcrumbs-link-fg: rgb(224, 224, 224);

        --primary-fg: rgb(238, 238, 238);
        --body-fg: rgb(238, 238, 238);
        --body-bg: var(--default-black);
        --body-quiet-color: var(--default-white);
        --body-loud-color: rgb(255, 255, 255);
        --container-bg: rgb(5, 5, 5);
        --darkened-bg: var(--secondary);
        --selected-bg: rgb(27, 27, 27);

        --breadcrumbs-bg: var(--default-black);
        --link-hover-color: rgb(74, 193, 247);
        --link-selected-fg: rgb(111, 148, 198);
        --header-link-color: var(--default-white);
        --hairline-color: rgb(39, 39, 39);
        --border-color: rgb(53, 53, 53);
        --app-link-color: var(--default-white);
        --fieldset: var(--default-black);
        --inlineh3: var(--secondary);
        --moduleh1: var(--dark-dark-gray);
        --moduleh2: var(--darkmode-dark-blue);
        --inlineh3-text: var(--default-white);

        --error-fg: rgb(227, 95, 95);
        --message-success-bg: rgb(0, 107, 27);
        --message-warning-bg: rgb(88, 51, 5);
        --message-error-bg: rgb(87, 8, 8);
        --close-button-bg: rgb(51, 51, 51);
        --close-button-hover-bg: rgb(102, 102, 102);

        --selected-row: var(--dark-dark-gray);
        --tablerow: rgb(38, 38, 38);
        --tablerowodd: rgb(28, 28, 28);
        --table-link: var(--default-white);
        --content-related-bg: var(--primary);
        --label-color: var(--default-white);

        --header-bg: var(--secondary);
        --button-fg: rgb(255, 255, 255);
    }
}

/* Ensure that no transitions are loaded on pageload */
.preload {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}

body {
    font-size: 0.875rem;
    font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#container {
    min-width: 320px;
}

/* LINKS */
a {
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

a:hover,
a:focus {
    overflow-wrap: break-word;
    white-space: unset;
}

a:link, a:visited {
    color: var(--optimalscans-dark-blue);
    font-weight: 600;
    transition: color 0.15s, background 0.15s;
    -webkit-transition: color 0.15s, background 0.15s;
    -moz-transition: color 0.15s, background 0.15s;
    -ms-transition: color 0.15s, background 0.15s;
    -o-transition: color 0.15s, background 0.15s;
}

a.section:link, a.section:visited {
    color: var(--app-link-color);
    font-weight: 600;
}

a.section:focus, a.section:hover {
    font-weight: 600;
}

/* GLOBAL DEFAULTS */
h1 {
    font-size: 1.625rem;
    font-weight: 200;
}

h2 {
    font-size: 1.375rem;
    font-weight: 200;
}

h3,
h4,
h5 {
    font-weight: 200;
}

h1,
h2,
h3,
h4,
h5 {
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}


h1:hover,
h1:focus,
h2:hover,
h2:focus,
h3:hover,
h3:focus,
h4:hover,
h4:focus,
h5:hover,
h5:focus {
    overflow-wrap: break-word;
    white-space: unset;
}


#content>h1:first-of-type,
#content>h2:first-of-type {
    max-width: 60%;
}

/* MODIFIERS */
/* Show elements by using this class */
.show {
    display: block !important;
}

/* Hide elements by using this class */
.hidden {
    display: none !important;
}

/* TABLES */
td, th {
    border-bottom: 0;
}

th,
td {
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

th:hover,
th:focus,
td:hover,
td:focus {
    overflow-wrap: break-word;
}

table.sortable thead tr th span#sorttable_sortfwdind, 
table.sortable thead tr th span#sorttable_sortrevind {
    min-width: 15px;
    display: inline-block;
}

table.sortable thead {
    cursor: pointer;
    user-select: none;
}

table.sortable th:not(.sorttable_sorted):not(.sorttable_sorted_reverse):not(.sorttable_nosort):after { 
    content: " \25B4\25BE";
    min-width: 15px;
    display: inline-block;
}

th,
td {
    max-width: 200px;
}

tr.alt {
    background: var(--tablerow);
}

tr:nth-child(odd), .row-form-errors {
    background: var(--tablerowodd);
}

tr:nth-child(even),
tr:nth-child(even) .errorlist,
tr:nth-child(odd)+.row-form-errors,
tr:nth-child(odd)+.row-form-errors .errorlist {
    background: var(--tablerow);
}

/* SORTABLE TABLES */

table thead th.sorted .sortoptions a.sortremove:focus:after,
table thead th.sorted .sortoptions a.sortremove:hover:after {
    color: var(--table-link);
}

/* FORM BUTTONS */
.button, input[type=submit], input[type=button], .submit-row input, a.button {
    transition: background 0.15s;
    -webkit-transition: background 0.15s;
    -moz-transition: background 0.15s;
    -ms-transition: background 0.15s;
    -o-transition: background 0.15s;
}

/* REQUIRED FORM FIELDS */
.required:before {
    content: '*';
    color: red;
}

/* MODULES */
.module h2, .module caption, .inline-group h2 {
    font-weight: 200;
    background: var(--moduleh2);
    color: var(--label-color);
}

.djn-fieldset {
    border: 1px solid var(--hairline-color);
}

/* BREADCRUMBS */
div.breadcrumbs {
    display: none;
    padding: 10px 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    white-space: nowrap;
}

div.breadcrumbs a:link {
    font-weight: 200;
}

div.breadcrumbs a:focus, div.breadcrumbs a:hover {
    color: var(--optimalscans-dark-dark-blue);
}

/* ACTION ICONS */
a.deletelink:link, a.deletelink:visited {
    color: rgb(204, 52, 52);
}

a.deletelink:focus, a.deletelink:hover {
    color: rgb(153, 51, 51);
    text-decoration: none;
}

.material-icons {
    color: var(--label-color);
}

.label {
    color: var(--label-color);
}

/* OBJECT TOOLS */
.object-tools {
    z-index: 99;
}

/* PAGE STRUCTURE */
.main>.content {
    flex: 1 0;
    background-color: var(--container-bg);
}

/* Adjust max site width when navbar is open */
.main.shifted>.content {
    max-width: calc(100% - 252px);
}

.dashboard #content {
    min-width: 300px;
}

/* HEADER */
#header {
    position: static;
    height: 50px;
    padding: 10px 15px;
    gap: 12px;
    box-shadow: 0 3px 5px rgba(57, 63, 72, 0.3);
    -webkit-box-shadow: 0 3px 5px rgba(57, 63, 72, 0.3);
    -moz-box-shadow: 0 3px 5px rgba(57, 63, 72, 0.3);
    z-index: 100;
}

@media (prefers-color-scheme: dark) {
    #header {
        box-shadow:
            0 24px 38px 3px rgba(0, 0, 0, 0.14),
            0 9px 46px 8px rgba(0, 0, 0, 0.12),
            0 11px 15px -7px rgba(0, 0, 0, 0.2);
        -webkit-box-shadow:
            0 24px 38px 3px rgba(0, 0, 0, 0.14),
            0 9px 46px 8px rgba(0, 0, 0, 0.12),
            0 11px 15px -7px rgba(0, 0, 0, 0.2);
        -moz-box-shadow:
            0 24px 38px 3px rgba(0, 0, 0, 0.14),
            0 9px 46px 8px rgba(0, 0, 0, 0.12),
            0 11px 15px -7px rgba(0, 0, 0, 0.2);
    }

    #brand { 
        filter: brightness(0) invert(1); 
    }
}

#header a:link, #header a:visited {
    color: var(--header-link-color);
}

#branding {
    margin-top: 3px;
    height: 55px;
}

#brand {
    height: 100%;
}

/* LANGUAGE BUTTON */
.switch-language {
    margin-left: auto;
}

.switch-language>* {
    cursor: default;
    color: var(--header-link-color);
    font-family: 'Helvetica Neue';
}

.material-icons.language-icon {
    color: var(--header-link-color);
    font-size: 1rem;
    vertical-align: middle;
}

.language-button {
    color: var(--header-link-color);
    background: transparent;
    font-size: 0.8rem;
    text-transform: uppercase;
    border: none;
    padding: 3px;
    cursor: pointer;
    font-family: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
    font-weight: 300;
}

.language-button:hover {
    color: var(--gray);
}

.selected {
    font-weight: 900;
}

#user-tools {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--header-link-color);
    margin-left: 0;
}

/* SIDEBAR */
#content-related {
    background: var(--content-related-bg);
}

#content-related h4 {
    font-size: 0.8125rem;
}

/* MODULES */
.module {
    background: var(--container-bg);
}

/* RECENT ACTIONS MODULE */
#content-related {
    position: absolute;
    right: 0;
    top: 0;
    margin-right: 30px;
    margin-top: 175px;
}

#content-related .actionlist {
    padding: 0 0 5px;
}

#content-related .actionlist li {
    width: 205px;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -ms-text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#content-related .actionlist li:hover {
    overflow-wrap: break-word;
    white-space: unset;
}

/* SELECTORS */
.selector select {
    overflow-x: scroll;
}

.font_bold {
    font-weight: bold;
}

/* SNACKBARS */
.snackbar {
    position: fixed;
    top: 10px; /* Top of the page */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust the width of the snackbar to truly center it */
    background-color: var(--gray);
    color: var(--default-white);
    padding: 16px;
    font-size: 1.2rem;
    border-radius: 4px;
    z-index: 1000;
    max-width: 80%;
    width: auto;
}