/* transparency */
:root {
  @media (-moz-bool-pref: "mod.sameerasw.zen_bg_color_enabled") {
    --zen-main-browser-background: var(
      --mod-sameerasw-zen_transparency_color,
      #00000000
    ) !important;
  }
}

/* Remove new tab background color added in 1.8b */
.browserStack {
  browser {
    @media (-moz-bool-pref: "mod.sameerasw.zen_light_tint_flip") {
      background-color: light-dark(
        rgba(255, 255, 255, 0.1),
        rgba(0, 0, 0, 0.1)
      ) !important;
    }
    @media (-moz-bool-pref: "mod.sameerasw.zen_light_tint_disabled") {
      background-color: transparent !important;
    }
  }
}

/* hide shadow */
hbox.browserSidebarContainer,
#zen-tabbox-wrapper {
  @media (-moz-bool-pref: "mod.sameerasw.zen_no_shadow") {
    box-shadow: none !important;
  }
}

/* removed tab bg added in 1.9b */
#browser:has([zen-empty-tab="true"][selected="true"]) .browserStack {
  browser {
    @media (-moz-bool-pref: "mod.sameerasw.zen_empty_page_transparency") {
      background-color: transparent !important;
      opacity: 0 !important;
    }
  }
}

/* Animations */
/* Tab switch animation */
#tabbrowser-tabpanels
  > hbox:not([zen-split="true"]):not(:has(.zen-glance-background)) {
  @media (-moz-bool-pref: "mod.sameerasw.zen_tab_switch_anim") {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.35),
      filter 0.45s ease-in-out, opacity 0.35s ease-in-out !important;
    scale: 0.9 !important;
    opacity: 0;
  }
}
#tabbrowser-tabpanels > hbox.deck-selected:not([zen-split="true"]) {
  @media (-moz-bool-pref: "mod.sameerasw.zen_tab_switch_anim") {
    scale: 1 !important;
    opacity: 1 !important;
  }
}

/* website view animations */
#browser:not(:has(.zen-glance-background)) #tabbrowser-tabpanels {
  @media (-moz-bool-pref: "mod.sameerasw.zen_urlbar_zoom_anim") {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.35) !important;
  }
}

/* URL bar page animation */
#browser:has(#urlbar[open][zen-floating-urlbar="true"]) #tabbrowser-tabpanels {
  @media (-moz-bool-pref: "mod.sameerasw.zen_urlbar_zoom_anim") {
    pointer-events: none;
    scale: 1.1 !important;
    filter: blur(10px) brightness(70%) !important;
  }
}

#urlbar[open][zen-floating-urlbar="true"] #urlbar-background {
  @media (-moz-bool-pref: "mod.sameerasw.zen_urlbar_zoom_anim") {
    border-radius: 1em !important;
  }
}

/* trackpad gestures*/
tabpanels .browserStack browser {
  @media (-moz-bool-pref: "mod.sameerasw.zen_trackpad_anim") {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1) 0.1s !important;
    border-radius: 0.75em !important;
  }
}

/* Previous animation*/
.browserStack:has(
    #historySwipeAnimationPreviousArrow:not([style="translate: none;"])
  )
  browser {
  @media (-moz-bool-pref: "mod.sameerasw.zen_trackpad_anim") {
    scale: 0.95 !important;
    transform: translateX(3%) !important;
    border-radius: 2em !important;
  }
}

/* Next animation*/
.browserStack:has(
    #historySwipeAnimationNextArrow:not([style="translate: none;"])
  )
  browser {
  @media (-moz-bool-pref: "mod.sameerasw.zen_trackpad_anim") {
    scale: 0.95 !important;
    transform: translateX(-3%) !important;
    border-radius: 2em !important;
  }
}
