/*!
 * Copyright (c) 2014-present Cliqz GmbH. All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

@import 'shared';

:root {
    /* Override global variables */
    --tabs-top-border-width: 0;

    /* Override light theme variables */
    &:-moz-lwtheme-darktext {
        --chrome-background-color: #{$inactive-tab-color}; // Background for menu toolbar (Windows only)
    }
}

/* Add 2 more px padding on top of PersonalToolbar/Bookmark bar */
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar) {
    padding-top: 2px;
}

#navigator-toolbox {
    &:-moz-lwtheme {
        --tabs-border-color: rgba(0, 0, 0, 0.08); // Active tab border color and line below
    }

    #TabsToolbar {
        /* Move these buttons down a bit */
        #new-tab-button, #alltabs-button, .tabbrowser-arrowscrollbox > .scrollbutton-up, .tabbrowser-arrowscrollbox > .scrollbutton-down {
            margin-bottom: -2px;
        }
    }

    #nav-bar #urlbar .urlbar-textbox-container .textbox-input-box .urlbar-input::placeholder {
        color: #929292;
    }
}

/* Normal windows */
#main-window {
    &[sizemode="maximized"] {
        #TabsToolbar:-moz-lwtheme-darktext {
            margin-top: 0;

            /* Remove border left for first tab */
            #tabbrowser-tabs .tabbrowser-tab:first-of-type {
                border-left: none;
            }
        }
    }

    &[sizemode="normal"] {
        &[tabsintitlebar]:root {
            border-top-color: #1883d7;

            #toolbar-menubar[autohide="false"] + #TabsToolbar:-moz-lwtheme-darktext {
                /* Remove border left for first tab when menu bar is showing */
                #tabbrowser-tabs .tabbrowser-tab:first-of-type {
                    border-left: none;
                }
            }

            &:-moz-window-inactive {
                border-top-color: #aaa;
            }
        }
    }
}

/* Apply this hack for Windows 10 and later */
@media not all and (-moz-os-version: windows-win7) {
    @media not all and (-moz-os-version: windows-win8) {

        :root:not([uidensity="touch"]) {
            #titlebar, #tabbrowser-tabs {
                #titlebar-buttonbox {
                    max-height: 30px;
                }
            }

            #TabsToolbar {
                margin-top: -1px;
            }

            #tabbrowser-tabs {
                .tabbrowser-arrowscrollbox {
                    max-height: 30px;
                }

                .arrowscrollbox-scrollbox {
                    max-height: 30px;
                    margin-top: 3px;
                }
            }
        }
    }
}

@media (-moz-os-version: windows-win8) {

    :root:-moz-lwtheme-darktext {
        --chrome-background-color: transparent; // Background color for tab
    }

    #navigator-toolbox #TabsToolbar:-moz-lwtheme-darktext {
        background-color: transparent; // Background color for Tabstoolbar
    }

    #navigator-toolbox #TabsToolbar:-moz-lwtheme-darktext #tabbrowser-tabs .tabbrowser-tab .tab-line {
        height: 1px; // Bring back the tab line
    }

    #main-window {

        #navigator-toolbox {
            /* Remove space on tob of tabs toolbar (1) */
            #TabsToolbar {
                margin-top: -3px;
            }
        }

        &[sizemode="maximized"] {
            #navigator-toolbox {
                /* Remove space on tob of tabs toolbar +1 more for maximized mode (1) */
                #TabsToolbar {
                    margin-top: -4px;
                }
            }
        }

        &[sizemode="normal"] {
            /* Make the line on top of the window transparent */
            border-top-color: transparent;

            #navigator-toolbox {
                /* Add the missing line on the bottom of nav-bar on Windows 8 */
                &:after {
                    box-shadow: rgba(0, 0, 0, 0.19) 0 -2px 1px 3px;
                }
            }
        }
    }
}

@media (-moz-os-version: windows-win7) {

    #main-window {
        &[sizemode="maximized"] {
            #navigator-toolbox {
                /* Remove space on tob of tabs toolbar */
                #TabsToolbar {
                    margin-top: -3px;
                }
            }
        }
    }

    @media (-moz-windows-default-theme) {
        :root:-moz-lwtheme-darktext {
            --chrome-background-color: rgba(204, 204, 204, 0.4); // Background color for tab
        }

        #navigator-toolbox #TabsToolbar:-moz-lwtheme-darktext {
            background-color: transparent; // Background color for Tabstoolbar

            /* Change color of new tab button to black */
            .tabs-newtab-button.toolbarbutton-1 {
                fill: #47494a;
            }
        }
    }

    @media (-moz-windows-classic) {

    }
}

@import 'blue-theme';
@import 'purple-theme';
