/* Dark mode toggle styling */
a.dark-mode-toggle {
    cursor: pointer;
}

html.dark {
    background-color: #191919;
}

body.dark {
    filter: invert(90%);
}

/* Keep header logo colors when the whole page is inverted */
body.dark #header h1,
body.dark #header h1 a,
body.dark #header h1 img,
body.dark #header #logo,
body.dark #header .logo {
    filter: invert(112.5%);
}

body.dark:not(.theme-Rtmaterial) .icon{
    filter: invert(100%);
    color: #555 !important;
}

body.dark .badge,
body.dark img.gravatar,
body.dark .wiki img,
body.dark table.indicator.summary,
body.dark canvas.chartjs-render-monitor {
    filter: invert(100%);
}

body.dark table.list tr.overdue td.due_date,
body.dark div.issue.overdue .due-date .value {
    filter: invert(100%);
    color: lightcoral;
}

body.dark #sidebar a.selected {
    background-color: unset !important;
}

body.dark #header, body.dark #top-menu {
    color: #555 !important;
    background-color: white !important;
}

body.dark #header, 
body.dark #top-menu, 
body.dark #login-form, 
body.dark .nodata {
    background: unset !important;
}

body.dark #login-form  {
    border: unset !important;
}

body.dark svg.icon-svg {
    stroke: #555 !important;
}

body.dark input {
    accent-color: #555 !important;
}


body.dark #header a, body.dark #top-menu a,
body.dark #content h1, body.dark h2, body.dark h3, body.dark h4, body.dark h5, body.dark h6,
body.dark .wiki a, body.dark .wiki a:link, body.dark .wiki a:visited, body.dark #main a.user {
    color: #555 !important;
}

body.dark input[type="submit"], 
body.dark div.flash.notice,
body.dark table.list:not(.odd-even) tbody tr:nth-child(odd):hover,
body.dark .odd:hover,
body.dark #issue-changesets div.changeset:nth-child(odd):hover,
body.dark table.list:not(.odd-even) tbody tr:nth-child(even):hover,
body.dark .even:hover,
body.dark #issue-changesets div.changeset:nth-child(even):hover,
body.dark #main-menu .menu-children li a:hover,
body.dark .pagination ul.pages li.page:hover {
    background-color: darkgrey;
}

body.dark , 
body.dark #main-menu, 
body.dark #main-menu li a, 
body.dark #main-menu li a.selected, 
body.dark #main-menu li a:hover, 
body.dark .nodata, 
body.dark .warning, 
body.dark #errorExplanation, 
body.dark #flash_error, 
body.dark a, 
body.dark a:link, 
body.dark a:visited, 
body.dark a:hover, 
body.dark a:focus, 
body.dark div.flash.notice, 
body.dark #main-menu .menu-children li a:hover {
    color: rgb(17,17,17);
}

body.dark #main-menu, 
body.dark #main-menu li a.selected, 
body.dark #main-menu li a:hover, 
body.dark #main-menu li a.new-object {
    background: white;
}

body.dark #main-menu li a.selected, 
body.dark #content .tabs ul li a.selected, 
body.dark input[type="submit"], 
body.dark input[type="submit"]:hover, 
body.dark div.flash.notice, 
body.dark .ui-widget-header, 
body.dark #main-menu .menu-children {
    border-color: #78909c !important;
}

body.dark .pagination ul.pages li:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

body.dark .pagination ul.pages li {
    border: 1px solid #ddd;
}

body.dark .pagination ul.pages li.current {
    color: white;
    background-color: #ddd ;
    border-color: #ddd;
}

body.dark.theme-Rtmaterial tr.priority-default td.priority {
    border-color: #AB47BC;
}

body.dark.theme-Rtmaterial tr.priority-lowest td.priority {
    border-color: #F57F17; 
}

body.dark.theme-Rtmaterial tr.priority-highest td.priority {
    border-color: #29B6F6;
}

body.dark.theme-Rtmaterial tr.overdue td:first-child,
body.dark.theme-Rtmaterial #my-page tr.overdue td.id {
    border-left: 3px solid #29B6F6 !important;
}

/* Only follow browser dark theme preference when setting is enabled */
@media (prefers-color-scheme: dark) {
    body.follow-browser-theme:not(.dark) #dark {
        display:none;
    }

    body.follow-browser-theme:not(.dark) html {
        background-color: #191919;
    }

    body.follow-browser-theme:not(.dark) {
        filter: invert(90%);
    }

    /* Keep header logo colors when the whole page is inverted */
    body.follow-browser-theme:not(.dark) #header h1,
    body.follow-browser-theme:not(.dark) #header h1 a,
    body.follow-browser-theme:not(.dark) #header h1 img,
    body.follow-browser-theme:not(.dark) #header #logo,
    body.follow-browser-theme:not(.dark) #header .logo {
        filter: invert(112.5%);
    }

    body.follow-browser-theme:not(.dark):not(.theme-Rtmaterial) .icon{
        filter: invert(100%);
        color: #555 !important;
    }

    body.follow-browser-theme:not(.dark) .flyout-menu {
        background-color: #ccc
    }

    body.follow-browser-theme:not(.dark) .badge,
    body.follow-browser-theme:not(.dark) img.gravatar,
    body.follow-browser-theme:not(.dark) .wiki img,
    body.follow-browser-theme:not(.dark) img.filecontent.image,
    body.follow-browser-theme:not(.dark) table.indicator.summary,
    body.follow-browser-theme:not(.dark) .attachments .images img,
    body.follow-browser-theme:not(.dark) canvas.chartjs-render-monitor {
        filter: invert(100%);
    }

    body.follow-browser-theme:not(.dark) table.list tr.overdue td.due_date,
    body.follow-browser-theme:not(.dark) div.issue.overdue .due-date .value {
        filter: invert(100%);
        color: lightcoral;
    }

    body.follow-browser-theme:not(.dark) #sidebar a.selected {
        color: #000;
    }

    body.follow-browser-theme:not(.dark) #header,
    body.follow-browser-theme:not(.dark) #top-menu,
    body.follow-browser-theme:not(.dark) #project-jump .drdn-trigger {
        color: #555;
        background-color: white;
    }

    body.follow-browser-theme:not(.dark) .diff_out,
    body.follow-browser-theme:not(.dark) .diff_in {
        filter: invert(1);
    }

    body.follow-browser-theme:not(.dark) #header a, body.follow-browser-theme:not(.dark) #top-menu a,
    body.follow-browser-theme:not(.dark) #content h1, body.follow-browser-theme:not(.dark) h2, body.follow-browser-theme:not(.dark) h3, body.follow-browser-theme:not(.dark) h4, body.follow-browser-theme:not(.dark) h5, body.follow-browser-theme:not(.dark) h6 {
        color: #555 !important;
    }

    body.follow-browser-theme:not(.dark) #main a.user {
	      color: #205D86;
    }

    body.follow-browser-theme:not(.dark) a.issue,
    body.follow-browser-theme:not(.dark) a.issue:link,
    body.follow-browser-theme:not(.dark) a.issue:visited,
    body.follow-browser-theme:not(.dark) div.wiki .wiki-page,
    body.follow-browser-theme:not(.dark) div.wiki .external {
        color: #205D86;
    }

    body.follow-browser-theme:not(.dark) .highlight {
        color: #000;
    }

    body.follow-browser-theme:not(.dark) input[type="submit"],
    body.follow-browser-theme:not(.dark) div.flash.notice,
    body.follow-browser-theme:not(.dark) table.list:not(.odd-even) tbody tr:nth-child(odd):hover,
    body.follow-browser-theme:not(.dark) .odd:hover,
    body.follow-browser-theme:not(.dark) #issue-changesets div.changeset:nth-child(odd):hover,
    body.follow-browser-theme:not(.dark) table.list:not(.odd-even) tbody tr:nth-child(even):hover,
    body.follow-browser-theme:not(.dark) .even:hover,
    body.follow-browser-theme:not(.dark) #issue-changesets div.changeset:nth-child(even):hover,
    body.follow-browser-theme:not(.dark) #main-menu .menu-children li a:hover,
    body.follow-browser-theme:not(.dark) .pagination ul.pages li.page:hover {
        background-color: darkgrey;
    }

    body.follow-browser-theme:not(.dark),
    body.follow-browser-theme:not(.dark) #main-menu,
    body.follow-browser-theme:not(.dark) #main-menu li a,
    body.follow-browser-theme:not(.dark) #main-menu li a.selected,
    body.follow-browser-theme:not(.dark) #main-menu li a:hover,
    body.follow-browser-theme:not(.dark) .nodata,
    body.follow-browser-theme:not(.dark) .warning,
    body.follow-browser-theme:not(.dark) #errorExplanation,
    body.follow-browser-theme:not(.dark) #flash_error,
    body.follow-browser-theme:not(.dark) a,
    body.follow-browser-theme:not(.dark) a:link,
    body.follow-browser-theme:not(.dark) a:visited,
    body.follow-browser-theme:not(.dark) a:hover,
    body.follow-browser-theme:not(.dark) a:focus,
    body.follow-browser-theme:not(.dark) div.flash.notice,
    body.follow-browser-theme:not(.dark) #main-menu .menu-children li a:hover {
        color: rgb(17,17,17);
    }

    body.follow-browser-theme:not(.dark) #main-menu,
    body.follow-browser-theme:not(.dark) #main-menu li a.selected,
    body.follow-browser-theme:not(.dark) #main-menu li a:hover,
    body.follow-browser-theme:not(.dark) #main-menu li a.new-object {
        background: white;
    }

    body.follow-browser-theme:not(.dark) #main-menu li a.selected,
    body.follow-browser-theme:not(.dark) #content .tabs ul li a.selected,
    body.follow-browser-theme:not(.dark) input[type="submit"],
    body.follow-browser-theme:not(.dark) input[type="submit"]:hover,
    body.follow-browser-theme:not(.dark) div.flash.notice,
    body.follow-browser-theme:not(.dark) .ui-widget-header,
    body.follow-browser-theme:not(.dark) #main-menu .menu-children {
        border-color: #78909c !important;
    }

    body.follow-browser-theme:not(.dark) input[type="date"] {
        color-scheme: dark;
    }

    body.follow-browser-theme:not(.dark) input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(100%);
    }

    body.follow-browser-theme:not(.dark) .pagination ul.pages li:first-child {
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    body.follow-browser-theme:not(.dark) .pagination ul.pages li {
        border: 1px solid #ddd;
    }

    body.follow-browser-theme:not(.dark) .pagination ul.pages li.current {
        color: white;
        background-color: #ddd ;
        border-color: #ddd;
    }

    body.follow-browser-theme:not(.dark) select option,
    body.follow-browser-theme:not(.dark) select optgroup {
        color: #ccc;
        background-color: #191919;
    }

    body.follow-browser-theme:not(.dark) #activity .issue a,
    body.follow-browser-theme:not(.dark) #activity .issue-note a,
    body.follow-browser-theme:not(.dark) #activity .issue-edit a,
    body.follow-browser-theme:not(.dark) #activity .issue-closed a,
    body.follow-browser-theme:not(.dark) #activity .wiki-page a,
    body.follow-browser-theme:not(.dark) #activity .news a,
    body.follow-browser-theme:not(.dark) #activity .attachment a,
    body.follow-browser-theme:not(.dark) #search-results dt a {
        color: #ccc;
    }

    body.follow-browser-theme:not(.dark).theme-Rtmaterial tr.priority-default td.priority {
        border-color: #AB47BC;
    }

    body.follow-browser-theme:not(.dark).theme-Rtmaterial tr.priority-lowest td.priority {
        border-color: #F57F17;
    }

    body.follow-browser-theme:not(.dark).theme-Rtmaterial tr.priority-highest td.priority {
        border-color: #29B6F6;
    }

    body.follow-browser-theme:not(.dark).theme-Rtmaterial tr.overdue td:first-child,
    body.follow-browser-theme:not(.dark).theme-Rtmaterial #my-page tr.overdue td.id {
        border-left: 3px solid #29B6F6 !important;
    }
}
