/* context line styles */
tabs tab.tabbrowser-tab > .tab-stack > .tab-background > .tab-context-line {
  @include InlineBox(true);
  &::before {
    content: "";
    height: 1px !important;
    border-radius: 9999px !important;
    transform: translateY(5px);
    margin-top: -1px !important;
    margin-left: 5px;
    margin-right: 5px;
    width: 100%;
  }
}

/* Override container-tab style */
tabs tab.tabbrowser-tab[usercontextid] > .tab-stack > .tab-background > .tab-context-line {
  margin: unset !important;
}

/* selected tab style */
#{built-in-light-theme()} .tab-context-line,
#{built-in-dark-theme()} .tab-context-line {
  --tab-line-color: #45a1ff;
}
.tabbrowser-tab:is([selected], [multiselected]) .tab-context-line::before {
  background-color: var(--tab-line-color, var(--lwt-tab-line-color, #45a1ff)) !important;
}

/* Set the active effect */
.tabbrowser-tab:active > .tab-stack > .tab-background > .tab-context-line::before {
  filter: brightness(70%);
  margin-left: 6px;
  margin-right: 6px;
}

/* Set the hover effect */
.tabbrowser-tab:hover:not([selected="true"], [multiselected])
  > .tab-stack
  > .tab-background
  > .tab-context-line::before {
  background-color: rgba(0, 0, 0, 0.4) !important;
  opacity: 1 !important;
}

#TabsToolbar[brighttext]
  .tabbrowser-tab:hover:not([selected="true"], [multiselected])
  > .tab-stack
  > .tab-background
  > .tab-context-line::before {
  background-color: rgba(255, 255, 255, 0.4) !important;
}


/* Animation */
@media (prefers-reduced-motion: no-preference) {
  .tabbrowser-tab:hover:not([selected="true"], [multiselected])
    > .tab-stack
    > .tab-background
    > .tab-context-line::before {
    animation: toWide 0.2s cubic-bezier(0, 0.9, 0.15, 1);
  }
}

/* Animation for hover effect */
@keyframes toWide {
  0% {
    opacity: 0.8;
    margin-left: 40%;
    margin-right: 40%;
  }
  100% {
    opacity: 1;
    margin-left: 5px;
    margin-right: 5px;
  }
}

/* --- copied (not modified) from _photon_like_contextline.scss --- */

/* Prevent identity color flashing */
.tabbrowser-tab[usercontextid] .tab-context-line {
  --identity-icon-color: none;
}
:root:not([customizing="true"]) #TabsToolbar[brighttext] tab[visuallyselected] > stack::before,
:root:not([customizing="true"]) #TabsToolbar[brighttext] tab[visuallyselected] > stack::after {
  /* As Selected Tab - Box Shadow */
  stroke: var(--toolbar-color) !important;
}

/* Remove side's background color border */
:root#{$lwtheme}
  #TabsToolbar[brighttext]
  #tabbrowser-tabs:not([noshadowfortests])
  .tabbrowser-tab:is([visuallyselected], [multiselected])
  > .tab-stack
  > .tab-background {
  --tabs-border-color: rgba(0, 0, 0, 0.3) !important;
  box-shadow: 0 0 1px var(--tabs-border-color) !important; /* Original: 0 0 1px var(--tab-line-color, rgba(128,128,142,0.9)) */
}
#TabsToolbar:not([brighttext])
  #tabbrowser-tabs:not([noshadowfortests])
  .tabbrowser-tab:is([visuallyselected], [multiselected])
  > .tab-stack
  > .tab-background {
  box-shadow: 0 0 1px var(--tabs-border-color), 0 0 4px rgba(128, 128, 142, 0.5) !important; /* Original: 0 0 1px var(--tab-line-color, rgba(128,128,142,0.9)), 0 0 4px rgba(128,128,142,0.5) */
}
