%define WINSTRIPE_AERO
%include browser.css
%undef WINSTRIPE_AERO

%define customToolbarColor hsl(214,44%,87%)
%define glassActiveBorderColor rgb(37, 44, 51)
%define glassInactiveBorderColor rgb(102, 102, 102)

@media not all and (-moz-windows-classic) {
  #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container {
    margin-top: 1px;
  }

  #appmenu-button {
    border-width: 2px;
    -moz-border-left-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
    -moz-border-bottom-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
    -moz-border-right-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
    margin-bottom: 1px; /* compensate white outer border */
    box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
                0 0 2px 1px rgba(255,255,255,.25) inset;
  }

  #main-window[privatebrowsingmode=temporary] #appmenu-button {
    -moz-border-left-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
    -moz-border-bottom-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
    -moz-border-right-colors: rgba(255,255,255,.5) rgba(43,8,65,.9);
  }

  #appmenu-popup {
    margin-top: -1px;
    -moz-margin-start: 1px;
  }

  .panel-promo-message {
    font-style: italic;
  }
}

@media all and (-moz-windows-default-theme) {
  #navigator-toolbox > toolbar:not(:-moz-lwtheme),
  #addon-bar:not(:-moz-lwtheme) {
    background-color: @customToolbarColor@;
  }

  .tabbrowser-tab:not(:-moz-lwtheme),
  .tabs-newtab-button:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@, @bgTabTexture@,
                      -moz-linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  .tabbrowser-tab:not(:-moz-lwtheme):hover,
  .tabs-newtab-button:not(:-moz-lwtheme):hover {
    background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
                      -moz-linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  .tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) {
    background-image: -moz-linear-gradient(white, @toolbarHighlight@ 50%),
                      -moz-linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  #main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
    background-image: @toolbarShadowOnTab@,
                      -moz-linear-gradient(white, @toolbarHighlight@ 50%),
                      -moz-linear-gradient(@customToolbarColor@, @customToolbarColor@);
  }

  #sidebar-splitter {
    border: 0;
    -moz-border-end: 1px solid #A9B7C9;
    min-width: 0;
    width: 3px;
    background-color: transparent;
    -moz-margin-start: -3px;
    position: relative;
  }
}

@media all and (-moz-windows-compositor) {
  /* These should be hidden w/ glass enabled. Windows draws its own buttons. */
  .titlebar-button {
    display: none;
  }

  #main-window[sizemode="maximized"] #titlebar-buttonbox {
    -moz-margin-end: 3px;
  }

  #main-window {
    -moz-appearance: -moz-win-borderless-glass;
    background: transparent;
  }

  #appcontent {
    -moz-appearance: -moz-win-exclude-glass;
  }

  #main-window[chromemargin^="0,"][sizemode=normal] #navigator-toolbox {
    margin-top: -7px;
  }

  /* Artificially draw window borders that are covered by lwtheme, see bug 591930. */
  #main-window[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme {
    border-top: 2px solid;
    -moz-border-top-colors: @glassActiveBorderColor@ rgba(255,255,255,.6);
  }

  #main-window[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme:-moz-window-inactive {
    -moz-border-top-colors: @glassInactiveBorderColor@ rgba(255,255,255,.6);
  }

  #main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container:-moz-lwtheme {
    margin-top: -1px;
  }

  #main-window[sizemode="normal"] #titlebar-buttonbox:-moz-lwtheme {
    margin-top: -2px;
  }

  #appmenu-button {
    margin-bottom: -1px; /* compensate white outer border */
  }

  #main-window[sizemode=fullscreen]:not(:-moz-lwtheme) {
    -moz-appearance: none;
    background-color: #556;
  }

  #toolbar-menubar:not(:-moz-lwtheme),
  #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
  #navigator-toolbox[tabsontop=false] > #nav-bar:not(:-moz-lwtheme),
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child:not(:-moz-lwtheme) {
    background-color: transparent !important;
    color: black;
    text-shadow: 0 0 .5em white, 0 0 .5em white, 0 1px 0 rgba(255,255,255,.4);
    border-left-style: none !important;
    border-right-style: none !important;
  }

  /* Vertical toolbar border */
  #main-window[sizemode=normal] #navigator-toolbox::after,
  #main-window[sizemode=normal] #navigator-toolbox[tabsontop=true] > toolbar:not(#toolbar-menubar):not(#TabsToolbar),
  #main-window[sizemode=normal] #navigator-toolbox[tabsontop=false] > toolbar:not(#toolbar-menubar):not(#nav-bar) {
    border-left: 1px solid @toolbarShadowColor@;
    border-right: 1px solid @toolbarShadowColor@;
    background-clip: padding-box;
  }
  #main-window[sizemode=normal] #navigator-toolbox > toolbar:-moz-lwtheme {
    border-color: transparent !important;
  }
  #main-window[sizemode=normal] #browser-border-start,
  #main-window[sizemode=normal] #browser-border-end {
    display: -moz-box;
    background-color: @toolbarShadowColor@;
    width: 1px;
  }
  #main-window[sizemode=normal] #browser-bottombox {
    border: 1px solid @toolbarShadowColor@;
    border-top-style: none;
  }

  #main-window[sizemode=normal][tabsontop=false] #PersonalToolbar:not(:-moz-lwtheme) {
    border-top-left-radius: 3.5px;
    border-top-right-radius: 3.5px;
  }

  /* Toolbar shadow behind tabs */
  /* This code is only needed for restored windows (i.e. sizemode=normal)
     because of the border radius on the toolbar below the tab bar. */
  #main-window[sizemode=normal][tabsontop=true] #nav-bar:not(:-moz-lwtheme),
  #main-window[sizemode=normal][tabsontop=true] > #nav-bar[collapsed=true]:not([customizing]) + toolbar:not(:-moz-lwtheme),
  #main-window[sizemode=normal][tabsontop=true] > #nav-bar[collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme) {
    border-top: 1px solid @toolbarShadowColor@;
    border-top-left-radius: 3.5px;
    border-top-right-radius: 3.5px;
    background-clip: padding-box;
  }
  #main-window[sizemode=normal]:not([disablechrome]) #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
    margin-bottom: -1px;
    background-image: none !important;
  }
  #main-window[sizemode=normal]:not([disablechrome]) #tabbrowser-tabs[tabsontop=true] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox > .scrollbox-innerbox:not(:-moz-lwtheme) {
    position: relative;
  }

  #navigator-toolbox[tabsontop=false] > #PersonalToolbar {
    margin-top: 3px;
  }
  #navigator-toolbox[tabsontop=false] > #PersonalToolbar:not(:-moz-lwtheme) {
    margin-top: 2px;
    border-top: 1px solid @toolbarShadowColor@;
    background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
  }

  #main-window[sizemode=normal] #TabsToolbar[tabsontop=true] {
    padding-left: 4px;
    padding-right: 4px;
  }

  #main-window[sizemode=normal] #TabsToolbar[tabsontop=false] {
    padding-left: 2px;
    padding-right: 2px;
  }

  /* Make the window draggable by glassed toolbars (bug 555081) */
  #toolbar-menubar:not([autohide="true"]),
  #TabsToolbar[tabsontop="true"],
  #navigator-toolbox[tabsontop="false"] > #nav-bar,
  #nav-bar + #customToolbars + #PersonalToolbar[collapsed="true"] + #TabsToolbar[tabsontop="false"]:last-child,
  #navigator-toolbox > toolbar:not(#toolbar-menubar):-moz-lwtheme {
    -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
  }

  #appcontent:not(:-moz-lwtheme) {
    background-color: -moz-dialog;
  }

  #browser-bottombox:not(:-moz-lwtheme) {
    background-color: -moz-dialog;
    background-clip: padding-box;
  }

  #main-window[sizemode=normal] #browser-bottombox:not(:-moz-lwtheme),
  #main-window[sizemode=normal] #addon-bar:not(:-moz-lwtheme) {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  #addon-bar:not(:-moz-lwtheme) {
    -moz-appearance: none;
    border-bottom-style: none;
    background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
  }

  #main-menubar:not(:-moz-lwtheme):not(:-moz-window-inactive) {
    background-color: rgba(255,255,255,.5);
    border-radius: 4px;
  }

  #urlbar,
  .searchbar-textbox {
    background-color: rgba(255,255,255,.725);
    @navbarTextboxCustomBorder@
    color: black;
  }

  html|*.urlbar-input:-moz-placeholder,
  .searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input:-moz-placeholder {
    color: #777;
  }

  #urlbar:hover,
  .searchbar-textbox:hover {
    background-color: rgba(255,255,255,.898);
  }

  #urlbar[focused="true"],
  .searchbar-textbox[focused="true"] {
    background-color: white;
  }

  .tabbrowser-tab:not(:-moz-lwtheme) {
    text-shadow: none;
  }

  #main-window[sizemode=normal] .statuspanel-inner {
    /* align with the browser's side borders */
    padding-left: 1px;
    padding-right: 1px;
  }

  #allTabs-panel,
  #ctrlTab-panel {
    background: transparent;
    -moz-appearance: -moz-win-glass;
    border-radius: 0;
    border: none;
    font: normal 1.2em "Segoe UI";
    color: black;
    text-shadow: white -1px -1px .35em, white -1px 1px .35em, white 1px 1px .35em, white 1px -1px .35em;
  }

  #tab-view:-moz-lwtheme {
    background-image: url("chrome://browser/skin/tabview/grain.png"),
                      -moz-linear-gradient(rgba(255,255,255,0), #CCD9EA 200px, #C7D5E7);
    background-attachment: fixed;
  }
}

@media not all and (-moz-windows-compositor) {
  #main-window:-moz-system-metric(windows-default-theme) {
    background-color: rgb(185,209,234);
  }
  #main-window:-moz-system-metric(windows-default-theme):-moz-window-inactive {
    background-color: rgb(215,228,242);
  }

  #toolbar-menubar:not([autohide=true]):not(:-moz-lwtheme):-moz-system-metric(windows-default-theme),
  #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme):-moz-system-metric(windows-default-theme),
  #navigator-toolbox[tabsontop=false] > toolbar:not(#toolbar-menubar):not(:-moz-lwtheme):-moz-system-metric(windows-default-theme) {
    -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
    background-color: transparent;
  }
  #toolbar-menubar[autohide=true]:-moz-system-metric(windows-default-theme) {
    background-color: transparent;
  }

  #print-preview-toolbar:not(:-moz-lwtheme) {
    -moz-appearance: -moz-win-browsertabbar-toolbox;
  }
}

/* ::::: fullscreen window controls ::::: */

#window-controls {
  -moz-box-align: start;
}

#minimize-button,
#restore-button,
#close-button {
  -moz-appearance: none;
  border-style: none;
  margin: 0;
}
#close-button {
  -moz-image-region: rect(0, 49px, 16px, 32px);
}
#close-button:hover {
  -moz-image-region: rect(16px, 49px, 32px, 32px);
}
#close-button:hover:active {
  -moz-image-region: rect(32px, 49px, 48px, 32px);
}

#minimize-button:-moz-locale-dir(rtl),
#restore-button:-moz-locale-dir(rtl),
#close-button:-moz-locale-dir(rtl) {
  -moz-transform: scaleX(-1);
}

/* ::::: splitmenu highlight style that imitates Windows 7 start menu ::::: */
@media all and (-moz-windows-default-theme) {
  .splitmenu-menuitem,
  .splitmenu-menu {
    -moz-appearance: none;
    padding-top: 2px;
    padding-bottom: 2px;
    border: 1px solid transparent;
  }
  .splitmenu-menuitem {
    -moz-margin-end: 0;
  }
  .splitmenu-menu {
    -moz-margin-start: -1px;
  }
  .splitmenu-menuitem:-moz-locale-dir(ltr),
  .splitmenu-menu:-moz-locale-dir(rtl) {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
  }
  .splitmenu-menu:-moz-locale-dir(ltr),
  .splitmenu-menuitem:-moz-locale-dir(rtl) {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
  }

  .splitmenu-menuitem > .menu-text {
    -moz-margin-start: 1px !important;
    -moz-margin-end: 3px !important;
  }
  .splitmenu-menu > .menu-right {
    -moz-margin-end: -3px;
  }

  .splitmenu-menuitem[iconic],
  .splitmenu-menu[iconic] {
    padding-bottom: 1px;
  }
  .splitmenu-menuitem[iconic] > .menu-iconic-left {
    margin-top: -3px;
    margin-bottom: -2px;
    -moz-margin-start: -1px;
  }
  .splitmenu-menuitem[iconic] > .menu-iconic-text {
    -moz-margin-start: 2px !important;
    -moz-margin-end: 3px !important;
  }
  .splitmenu-menu[iconic] > .menu-right {
    margin-top: -1px;
  }

  .splitmenu-menuitem[_moz-menuactive],
  .splitmenu-menu[_moz-menuactive] {
    background-color: transparent;
    background-image: -moz-linear-gradient(#fafbfd, #ebf3fd);
    border-color: #aeccf1;
  }

  .splitmenu-menuitem[disabled][_moz-menuactive],
  .splitmenu-menu[disabled][_moz-menuactive] {
    background-image: -moz-linear-gradient(#f8f9f9, #eaeaea);
    border-color: #d8d7d7;
  }

  .splitmenu-menu[_moz-menuactive]:not(:hover):not([open]) {
    background-image: none;
  }
}
