/* macOS specific styles */
@media (-moz-platform: macos) {
  /* Hide horizontal tabs strip */
  :is([titlepreface="[Sidebery]"], [titlepreface="Tab Center Reborn"]) {
    & #TabsToolbar:not([customizing="true"]) {
      visibility: collapse !important;
    }
  }

  :root:not([customizing="true"]):is(
      [titlepreface="[Sidebery]"],
      [titlepreface="Tab Center Reborn"]
    ) {
    /* Move content of browser toolbar to the right to accomodate traffic lights */
    & #nav-bar.browser-toolbar {
      padding-left: 80px !important;
    }

    /* Move traffic lights down in the space */
    & #TabsToolbar .titlebar-buttonbox-container {
      visibility: visible !important;
      position: absolute;
      top: 14px;
      left: 0px;
      display: block;
    }
  }
}

/* Windows specific styles */
@media (-moz-platform: windows) {
  :is([titlepreface="[Sidebery]"], [titlepreface="Tab Center Reborn"]) {
    /* Hide horizontal tabs */
    & #TabsToolbar:not([customizing="true"]) {
      visibility: collapse !important;
    }

    /* Hide sidebar border */
    & .sidebar-splitter {
      opacity: 0;
    }
  }

  :root:not([customizing="true"]):is(
      [titlepreface="[Sidebery]"],
      [titlepreface="Tab Center Reborn"]
    ) {
    /* Move content of toolbar to the left to accomodate titlebar controls */
    & #nav-bar.browser-toolbar {
      padding-right: 140px !important;
    }
    /* Move titlebar controls down */
    & #TabsToolbar .titlebar-buttonbox-container {
      visibility: visible !important;
      position: absolute;
      top: 0;
      right: 0px;
      display: block;
      height: 40px;

      /* Make sure titlbar buttons stretch */
      & .titlebar-buttonbox {
        height: 100%;
      }
    }

    /* Necessary to tweak layering of titlebar controls */
    & #titlebar {
      z-index: 500;
    }
    & #nav-bar {
      z-index: 499;
    }
  }
}

/* Hides mutli-account containers icon */
#page-action-buttons #pageAction-urlbar-_testpilot-containers {
  display: none;
}

/* Hide header of sidebar for Sidebery/Tab Center Reborn */
:is(
    #sidebar-box[sidebarcommand*="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"],
    #sidebar-box[sidebarcommand*="tabcenter-reborn_eramdam-sidebar-action"]
  )
  #sidebar-header {
  visibility: collapse;
  display: none;
}

/* Optional: one-button bookmarks bar */
toolbarbutton[label="★"][type="menu"][container="true"] > label {
  visibility: collapse !important;
}

toolbarbutton[label="★"][type="menu"][container="true"] > image {
  list-style-image: url("chrome://browser/skin/bookmark-star-on-tray.svg");
  margin-left: 4px !important;
}
/* /Optional: one-button bookmarks bar */

/* Hide the blue light thing when an extension requires more permission (some extensions ask it on every website and it bothers me) */
#unified-extensions-button[attention] > .toolbarbutton-icon,
.unified-extensions-item[attention]
  > .unified-extensions-item-action-button.toolbarbutton-1
  > .toolbarbutton-badge-stack {
  background-image: none !important;
}
