/*
--------------------------------------------------------------
Dark Version of colors.css
--------------------------------------------------------------
*/
@media (prefers-color-scheme: dark) {
    :root {
        --background: #121212;
        --tf-blue: #0D2F74;
        --tf-blue-gradient: #1241a1;
        --tf-light: #4871A2;
        --tf-light-gradient: #648bb9;
        --text-brighter: #c0c0c0;
        --text-content: #bfbfbf;
        --text-lighter: #959595;
        --bg-post-1: #2d2d2d;
        --bg-post-2: #262626;
        --bg-panel-1: #212121;
        --bg-panel-2: #262626;

    }

    html,
    body {
        background: var(--background);
        color: #adadad;
    }


    /*
    --------------------------------------------------------------
    Colours and backgrounds for links.css
    --------------------------------------------------------------
    */

    a {
        color: #c0c0c0;
    }

    a:hover,
    a:focus {
        color: var(--tf-light);
    }

    .forabg,
    .forumbg,   
    .cp-main table.table1 {
        background: #3d3d3d;
    }

    ul.forums,
    ul.topics,
    table.table1 tbody {
        background: #1c1c1c;
    }
    .forabg, .forumbg, .cp-main table.table1 {
        border-color: #3d3d3d;
    }

    /* Row (single forum) */
    ul.topiclist li {
        color: #858585;
    }

    /* Different background for even rows */
    li.row:nth-child(even),
    table.table1 tbody tr:nth-child(even) {
        background: #262626;
    }

    ul.topiclist li.row dt:nth-child(odd),
    ul.topiclist li.row dd:nth-child(odd) {
        background-color: #282828;
    }

    ul.topiclist li.row:nth-child(odd) dt:nth-child(odd),
    ul.topiclist li.row:nth-child(odd) dd:nth-child(odd) {
        background-color: #202020;
    }



    /* Different background in odd columns */
    ul.topiclist li.row dt:nth-child(even),
    ul.topiclist li.row dd:nth-child(even),
    .forabg ul.topiclist li.row dt:nth-child(odd),
    .forabg ul.topiclist li.row dd:nth-child(odd),
    .forumbg ul.topiclist li.row dt:nth-child(odd),
    .forumbg ul.topiclist li.row dd:nth-child(odd),
    table.table1 tbody td:nth-child(even) {
        background-color: #202020;
    }

    .forabg ul.topiclist li.row dt:nth-child(even),
    .forabg ul.topiclist li.row dd:nth-child(even),
    .forumbg ul.topiclist li.row dt:nth-child(even),
    .forumbg ul.topiclist li.row dd:nth-child(even) {
        background-color: #171717;
    }

    ul.topiclist li.row:nth-child(even) dt:nth-child(even),
    ul.topiclist li.row:nth-child(even) dd:nth-child(even),
    .forabg ul.topiclist li.row:nth-child(even) dt:nth-child(odd),
    .forabg ul.topiclist li.row:nth-child(even) dd:nth-child(odd),
    .forumbg ul.topiclist li.row:nth-child(even) dt:nth-child(odd),
    .forumbg ul.topiclist li.row:nth-child(even) dd:nth-child(odd),
    table.table1 tbody tr:nth-child(even) td:nth-child(even) {
        background-color: #282828;
    }

    .forabg ul.topiclist li.row:nth-child(even) dt:nth-child(even),
    .forabg ul.topiclist li.row:nth-child(even) dd:nth-child(even),
    .forumbg ul.topiclist li.row:nth-child(even) dt:nth-child(even),
    .forumbg ul.topiclist li.row:nth-child(even) dd:nth-child(even) {
        background-color: #1f1f1f;
    }

    .forumbg ul.topiclist li.reported dt:nth-child(odd),
    .forumbg ul.topiclist li.reported dd:nth-child(odd),
    ul.topiclist li.reported dt:nth-child(even),
    ul.topiclist li.reported dd:nth-child(even) {
        background-color: #1d1d1d !important;
    }

    ul.topiclist li.row a.subforum:before {
        color: #949494;
    }

    ul.topiclist li.row a.subforum.unread:before {
        color: #bc2a4d;
    }

    /* Last post author and date icons */
    dd.lastpost .fa {
        color: #949494;
    }

    table.table1 td {
        color: #adadad;
    }

    .cp-main table.table1 thead th {
        color: #000000;
    }

    div.rules {
        color: #0d2f73;
        background: #dadada;
    }

    /**
    * Panels
    */
    .panel {
        background-color: var(--background);
        color: #adadad;
    }

    .bg1,
    .bg3 {
        background-color: #212121;
    }

    .bg2, .section-ucp ul.topiclist .bg2, .section-mcp ul.topiclist .bg2  {
        background-color: #262626;
    }

    /* PMs */
    .cp-main .pm {
        background-color: #262626;
    }
    .postbody h3, .postbody h3.first {
        color: #c0c0c0;
    }
    .cp-mini {
        background-color: #323232;
    }
    dl.mini dt {
        color: #c0c0c0;
    }

    /* give new notifications a distinctive background colour */
    .notification_list .bg2 {
        background-color: #121b1b;
    }

    dl.faq dt {
        color: #c0c0c0;
    }

    .online {
        background-image: none;
    }

    .post.bg1 {
        background: var(--bg-post-1);
    }

    .post.bg2 {
        background: var(--bg-post-2);
    }

    .post.bg1 .postprofile {
        background-color: #272727;
    }

    .post.bg2 .postprofile {
        background-color: #212121;
    }

    .post.reported .postprofile {
        background-color: #0b1e19;
    }
    

    /* User profile */
    .postprofile,
    .pm .postprofile,
    .search .postprofile {
        color: #adadad;
    }

    .postprofile strong {
        color: var(--text-content);
    }

    .post.bg1 .postbody:before {
        border-color: transparent var(--bg-post-1) transparent transparent;
    }

    .post.bg2 .postbody:before {
        border-color: transparent var(--bg-post-2) transparent transparent;
    }

    .post.reported .postbody:before {
        border-color: transparent #f7ecef transparent transparent;
    }

    p.author {
        color: var(--text-content);
    }

    .postbody h3 {
        /* preview title */
        color: var(--text-brighter);
    }
    .postbody .content,
    .post:target .content {
        color: var(--text-content);
    }

    .post .signature {
        color: var(--text-content);
    }

    /* Poll preview background */
    .section-posting .preview .content {
        background-color: #f1f1f1;
    }

    /* Post related links */
    .postprofile a:link,
    .postprofile a:visited,
    .search .postprofile a {
        color: var(--tf-light);
    }

    .postprofile a:focus,
    .postprofile a:hover,
    .postprofile a:active,
    .search .postprofile a:focus,
    .search .postprofile a:hover,
    .search .postprofile a:active {
        color: var(--tf-light-gradient);
        text-decoration: underline;
    }

    fieldset.polls dl {
        border-color: #dadada;
        color: #525252;
    }

    .attachbox dd {
        border-color: #cccccc;
    }

    dl.file dd {
        color: #525252;
    }

    dl.codebox {
        border-color: #cccccc;
    }

    blockquote {
        border-color: #353535;
        background: #303030;
    }

    blockquote blockquote {
        background: #3a3a3a;
    }

    blockquote blockquote blockquote {
        border-color: #494949;
        background: #444444;
    }

    a.postlink {
        border-bottom: 1px dotted #6b6b6b;
        color: #6b6b6b;
    }

    a.postlink:visited {
        color: #959595;
    }

    a.postlink:active,
    a.postlink:focus,
    a.postlink:hover {
        border-color: var(--tf-light);
        background: none;
        color: var(--tf-light);
    }

    .signature a:active,
    .signature a:focus,
    .signature a:hover {
        border-bottom: 1px dotted var(--tf-light);
    }

    .postprofile ul.profile-icons li a,
    .postbody ul.profile-icons li a {
        background: #dfdfdf;
        color: #6b6b6b;
    }

    /* More dark profile icons */
    .postprofile ul.profile-icons li a {
        border-color: #c5c5c5;
        background: #dfdfdf;
    }

    .postprofile ul.profile-icons li a:focus,
    .postprofile ul.profile-icons li a:hover,
    .postprofile ul.profile-icons li a:active,
    .postbody ul.profile-icons li a:focus,
    .postbody ul.profile-icons li a:hover,
    .postbody ul.profile-icons li a:active {
        border-color: #91203c;
        background: #bc2a4d;
        color: #ffffff;
        text-decoration: none;
    }

    .section-search .postprofile {
        color: var(--text-content);
    }

    .section-search .postprofile strong {
        color: var(--text-lighter);
    }

    .viewprofile .signature {
        color: #414141;
    }

    .button, input.button1, input.button2, input.button3 {
        border-color: #C7C3BF;
        background-color: #E9E9E9;
        background-image: -webkit-linear-gradient(top, var(--tf-blue) 0%, var(--tf-blue-gradient) 100%);
        background-image: linear-gradient(to bottom, var(--tf-blue) 0%, var(--tf-blue-gradient) 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#E9E9E9',GradientType=0 );
        box-shadow: 0 0 0 1px var(--tf-light) inset;
        -webkit-box-shadow: 0 0 0 1px var(--tf-light) inset;
        color: #ffffff;
    }
    .button:hover, .button:focus,
    input.button1:hover, input.button2:hover, input.button3:hover,
    input.button1:focus, input.button2:focus, input.button3:focus {
        border-color: white;
        background-color: #FFFFFF;
        background-image: -webkit-linear-gradient(top, var(--tf-light) 0%, var(--tf-light-gradient) 100%);
        background-image: linear-gradient(to bottom, var(--tf-light) 0%, var(--tf-light-gradient) 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E9E9E9', endColorstr='#FFFFFF',GradientType=0 );
        /*text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2);*/
        text-shadow: none;
        color: #ffffff;
    }
    .button .icon, .button-secondary {
        color: var(--text-content);
    }
    .button-secondary:focus, .button-secondary:hover, .button:focus .icon, .button:hover .icon {
        color: #ffffff;
    }

    .buttons div a {
        background: #e9e9e9;
        color: #6b6b6b;
    }

    .buttons div a:focus,
    .buttons div a:hover,
    .buttons div a:active {
        border-color: #91203c;
        background: #bc2a4d;
        color: #ffffff;
        text-decoration: none;
    }

    /* Forums layout related links */
    .search-box a:hover,
    .search-box a:active,
    .navbg a:hover,
    .navbg a:active,
    .forumbg .header a:hover,
    .forumbg .header a:active,
    .forabg .header a:hover,
    .forabg .header a:active,
    th a:link,
    th a:visited,
    th a:hover,
    th a:active {
        color: #ffffff;
    }

    a.topictitle,
    a.topictitle:visited {
        color: var(--text-content);
    }

    a.forumtitle:hover,
    a.forumtitle:active,
    a.topictitle:hover,
    a.topictitle:active
    {
        color: var(--tf-light);
    }
    

    a.top {
        color: #b5b5b5;
    }

    a.top:focus,
    a.top:hover,
    a.top:active {
        color: #959595;
    }

    a.top2 {
        display: none;
        background-image: none;
    }

    a.left:hover,
    a.right:hover {
        color: #bc2a4d;
    }

    a.left:before,
    a.right:after {
        color: #959595;
    }

    /* search highlight */
    .posthilit {
        background-color: var(-tf-light);
        color: var(--tf-blue);
    }

    .codebox {
        background: transparent;
    }
    .codebox code {
        background: var(--background);
    }


    /* Write post */
    label, dd label, label:hover, dd label:hover, fieldset dl:hover dt label {
        color: inherit;
    }
    #message-box textarea {
        color: var(--text-content);
        background: var(--bg-post-1);
        box-shadow: none;
    }
    select, input, .inputbox {
        color: var(--text-content);
        background: var(--bg-post-1);
        box-shadow: none;
    }
    select:focus, .inputbox:focus {
        color: var(--text-content);
    }
    .button1, .button2, .button3 {
        border-radius: 4px;
    }
    input::placeholder, .inputbox::placeholder {
        color: var(--text-lighter);
    }

    /* Pagination */
    .pagination li a {
        background: var(--tf-blue);
        color: var(--text-content);
        border-color: var(--text-content);
    }
    .pagination li a:hover, .pagination li a:hover .icon, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger {
        background: var(--tf-light);
        border-color: white;
        color: white;
    }
    .pagination li.active span {
        border-color: var(--tf-blue);
        background: #f2f2f2;
        color: var(--tf-blue);
    }
    .pagination li.ellipsis span {
        color: inherit;
    }


    /* jQuery popups
    ---------------------------------------- */
    .dropdown-extended ul li:hover {
        background-color: #E1E1E1;
        color: #000000;
    }

    .dropdown-extended .header {
        background-color: #F1F1F1; /* Old browsers */ /* FF3.6+ */
        background-image: -webkit-linear-gradient(top, #F1F1F1 0%, #CACACA 100%);
        background-image: linear-gradient(to bottom, #F1F1F1 0%,#CACACA 100%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F1F1F1', endColorstr='#CACACA',GradientType=0 ); /* IE6-9 */
    }

    .dropdown-extended .pointer-inner {
        border-color: #F1F1F1 transparent;
    }


    /* Inventea */

    .inventea-wrapper {
        background: #1C1C21;
        border-color: #252525;
    }

    li.row, .cp-main .panel li.row, table.table1 tbody tr  {
        border-color: #000000;
    }

    /* ProSilver overrides */
    h1, h2, h3, h4 {
        color: inherit;
    }
    .panel h2, .panel h3, .content h2 {
        color: inherit;
    }
    .post h3 a.first-unread, .post:target h3 a {
        color: #c0c0c0;
    }

    .dropdown .dropdown-contents {
        background: var(--background);
        border-color: #B9B9B9;
        box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2);
    }

    dl.details dt {
        color: inherit;
    }
    dl.details dd {
        color: var(--text-lighter);
    }

    .phpbb_alert {
        background-color: var(--bg-panel-2);
    }
    .alert_close .icon:before {
        background-color: var(--background);
    }

    /* MCP */

    .tabs .tab > a {
        background: #323232;
        color: var(--text-content);
    }
    .tabs .tab > a:hover {
        background: #323232;
        color: white;
    }
    .tabs .activetab > a, .tabs .activetab > a:hover {
        background-color: var(--bg-panel-1);
        border-bottom-color: var(--bg-panel-1);
        color: white;
    }
    .panel-container .panel {
        background-color: var(--background);
    }

    .navigation a {
        background: var(--bg-panel-2);
        color: var(--text-content);
    }
    .navigation a:hover {
        background: var(--bg-panel-2);
        color: white;
    }
    .navigation .active-subsection a {
        background: var(--tf-light);
        color: white;
    }
    .navigation .active-subsection a:hover {
        background: var(--tf-light);
        color: white;
    }


    /* Jumpbox */
    .jumpbox-cat-link {
        background-color: var(--tf-blue);
        border-top-color: var(--tf-blue);
        color: #FFFFFF;
    }
    .jumpbox-cat-link:hover {
        background-color: var(--tf-blue-gradient);
    }
    .jumpbox-sub-link {
        background-color: inherit;
    }
    .jumpbox-sub-link:hover {
        background-color: var(--tf-light);
        color: white;
    }
}
