@media (prefers-color-scheme:dark){
   :root{
      --bg: #1a1b26;

      --urlbar-bg: #0d0d15;
      --urlbar-border-top: #000;
      --urldrop-bg: #0d0d15;
      --urlbar-border-bottom: #404040;
      --urlbar-outline: #414868;

      --fullscreen-warn: rgb(25,25,25);

      --arrowpanel-background: var(--urlbar-bg) !important;
      --button-hover-bgcolor: rgba(159, 159, 159, 0.35) !important;
      --button-active-bgcolor: rgba(255, 255, 255, .2) !important;
      --button-bgcolor: rgba(117, 117, 117, 0.9) !important;
      --toolbarbutton-icon-fill-opacity: 0.8 !important;
      --arrowpanel-border-color: rgb(55, 55, 55) !important;
      --identity-btn-hover-color: rgba(117,117,117) !important;

      --dark-menu-background-color: rgba(34, 34, 36, .5) !important;
      --dark-menu-border-color: rgb(55, 55, 55) !important;
      --dark-menuitem-hover-background-color: rgba(159, 159, 159, 0.35) !important;
   }
}

@media (prefers-color-scheme:light){
   :root{   
      --bg: #f1f5f9;

      --urlbar-bg: #e1e8ef;
      --urlbar-border-top: #9ca3af;
      --urlbar-border-bottom: #fff;
      --urldrop-bg: #e1e8ef;
      --urlbar-outline: #94a3b8;

      --fullscreen-warn: rgb(25,25,25);

      --arrowpanel-background: #e2e8f0 !important;
      --button-hover-bgcolor: #e1e8ef !important;
      --button-active-bgcolor: #e1e8ef !important;
      --identity-btn-hover-color: white !important;
   }
}

 /* Suppress Connecting/Waiting/Reading/Transerring */
/*  #statuspanel[type="status"] {
   display: none !important;
 } */

 /* Suppress Link Destination Overlay */
/*  #statuspanel[type="overLink"] {
   display: none !important;
 } */

/* URL BAR */
#urlbar {
   border-radius: 30px !important;
   border: 0 !important;
}

#urlbar:not(.megabar):hover {
  outline: 1px solid var(--urlbar-outline) !important;
}

#urlbar[focused="true"] {
   border: 0 !important;
   border-top: 1px solid var(--urlbar-border-top) !important;
   border-bottom: 1px solid var(--urlbar-border-bottom) !important;
}

#urlbar-container{
   margin-bottom: 4px;
   display: initial;

}

#urlbar-background {
   box-shadow: none !important;
   border-radius: 30px !important;
   background: var(--urlbar-bg) !important;  
}

#urlbar[focused="true"] #urlbar-background{
   box-shadow: inset 1px 1px 1px 0px rgba(0, 0, 0, 0.35) !important;
   outline: none !important;
}

#wrapper-urlbar-container #urlbar {
  height: 30px !important;
}

 /* Active Address/Search Field Dropdown */
#urlbar[breakout][breakout-extend]{
   border: none !important;
   box-shadow: rgba(0, 0, 0, 0.09) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px,
      rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px,
      rgba(0, 0, 0, 0.09) 0px 32px 16px !important;
   top: calc(
      (var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2 ) !important;
   /* left: 0 !important; */
   /* width: 100% !important; */
   width: calc(--urlbar-width) !important;
   border-radius: 15px !important;
}

#urlbar[breakout][breakout-extend] > #urlbar-background {
   outline: none !important;
   box-shadow: none !important;
   background: var(--urldrop-bg) !important;
   border-radius: 15px !important;
}

#urlbar[breakout][breakout-extend] > #urlbar-input-container,
#urlbar-input-container {
  height: var(--urlbar-height) !important;
  padding-block: 0px !important;
  padding-inline: 0px !important;
  transition: none !important;
}

/* Idendity icon button */
#identity-icon-box.identity-box-button{
   margin: 3px 0 3px 3px;
   border-radius: 14px !important;
   background-color: var(--bg) !important;
   opacity: 0.8
}

#identity-icon-box.identity-box-button:hover{
   cursor: pointer;  
   background-color: var(--identity-btn-hover-color) !important;
}

/* Track protection icon */
#tracking-protection-icon-container{
   border-radius: 16px !important;
}

#tracking-protection-icon-container:hover{
   cursor: pointer !important;
}

/* Star button */
#star-button-box{
   border-radius: 16px !important;
}

#star-button-box:hover{
   cursor: pointer !important;
}

 /* | Borders | */
 
 .tabbrowser-tab::after {
    border: 0 !important;
 }
 .titlebar-spacer[type="pre-tabs"] {
    border: 0 !important;
 }
 #navigator-toolbox {
    border: 1 !important;
 }
 
 .titlebar-spacer[type="pre-tabs"] {
    border: 0 !important;
 }
 
 .tabbrowser-tab::after {
    border: 0 !important;
 }
 
 #urlbar-background {
    border: 0 !important;
 }
 
#urlbar[open] > .urlbarView > .urlbarView-body-outer > .urlbarView-body-inner {
     border-top: 0 !important;
 }

 
 /* Active Tab */
 :root:not([lwt-default-theme-in-dark-mode]) .tab-background[selected],
 .tab-background[multiselected="true"] {	
    background: rgba(0,0,0,.05) !important;
 }
 
 :root[lwt-default-theme-in-dark-mode] .tab-background[selected],
 .tab-background[multiselected="true"] {	
    background: rgba(0,0,0,.2) !important;
 }
 
 
 /* Navigation Bar */
 
#nav-bar {
   background-color: var(--bg) !important;
}

 /* Bookmarks Bar */
#PersonalToolbar {
    background-color: var(--bg) !important;
 }

 /* Navigation Bar Separator */
#navigator-toolbox {
   border-color: var(--bg) !important;
   background-color: var(--bg) !important;
   padding-top: 8px;
}

 /* Navigation bar Buttons */
toolbarbutton{
   margin-top: -5px !important;
}

toolbarbutton:hover{
   cursor: pointer !important;;
}

toolbarbutton#urlbar-zoom-button{
   margin-top: auto !important;
   margin-bottom: auto !important;
}

 /* Show Tab close button on hover */
.tabbrowser-tab:not([pinned]) .tab-close-button {
  display: -moz-box !important;
  opacity: 0;
  visibility: collapse !important;
  transition: opacity 0.25s, visibility 0.25s ease-in !important;
}
.tabbrowser-tab:not([pinned]):hover .tab-close-button {
  opacity: 1;
  visibility: visible !important;
  border-radius: 3px 3px 3px 3px !important;
}

/* Show URL buttons on Hover */
   #nav-bar:not([customizing="true"])
  > #nav-bar-customization-target
  > #urlbar-container:not(:hover)
  > #urlbar:not([focused])
  > #urlbar-input-container
  > #page-action-buttons {
  opacity: 0;
}
#page-action-buttons {
  transition: opacity 0.15s ease;
}
#nav-bar:not([customizing="true"])
  > #nav-bar-customization-target
  > #urlbar-container:not(:hover)
  > #urlbar:not([focused])
  > #urlbar-input-container
  > #tracking-protection-icon-container {
  opacity: 0;
}
#tracking-protection-icon-container {
  transition: opacity 0.15s ease;
}


/*Full Screen Warning*/

#fullscreen-warning{
   background-color: var(--fullscreen-warn) !important;
   border-color: var(--fullscreen-warn) !important;
   max-width: 500px !important;
   max-height: 50px !important;
   border-radius: 50px !important;
   font-size: 12px !important;
   opacity: 0.8 !important;
}

.pointerlockfswarning-generic-text,
.pointerlockfswarning-domain-text{
    font-size: 15px !important;
    color: rgb(255,255,255) !important;
    text-shadow: none !important;
}


/* Uncomment to Hide tabs bar for Tree style tabs (Credit u/jfgxyz on Reddit) */
toolbar#TabsToolbar {
    height: 0px;
    width: 80px;
    min-height: 0 !important;
    padding-top: 15px;
    background-color: var(--bg) !important;     
}
toolbar#TabsToolbar > .private-browsing-indicator-with-label {
   display: none;
}
.toolbar-items {
   visibility: collapse;
}
hbox#nav-bar-customization-target {
    padding-left: 80px !important;
}

/* SIDEBERY */

/* hides the sidebar header */
#sidebar-header {
	display: none !important;
}

.tab[selected="true"] {
	visibility: collapse;
	height: 0px;
}

.tabbrowser-tab {
	visibility: collapse;
	height: 0px;
}

.tabbrowser-tab[visuallyselected="true"] {
	visibility: collapse;
	height: 0px;
}

/* AUTO HIDE SIDE BAR */

#sidebar-box {
	--uc-sidebar-width: 40px; 
	--uc-sidebar-hover-width: 260px;
	--uc-autohide-sidebar-delay: 1ms; /* Waiting time before hiding sidebar */
	position: relative;
	min-width: var(--uc-sidebar-width) !important;
	width: var(--uc-sidebar-width) !important;
	max-width: var(--uc-sidebar-width) !important;
	z-index: 100;
}

#sidebar-box[positionend] {
	direction: rtl;
}
#sidebar-box[positionend] > * {
	direction: ltr;
}

#sidebar-box[positionend]:-moz-locale-dir(rtl) {
	direction: ltr;
}
#sidebar-box[positionend]:-moz-locale-dir(rtl) > * {
	direction: rtl;
}

/* HIDE SIDE BAR IN FULL SCREEN */
/* #main-window[inFullscreen="true"] #sidebar-box {
	--uc-sidebar-width: 0px;
} */

#sidebar-splitter {
	display: none;
}

#sidebar-header {
	overflow: hidden;
	color: var(--chrome-color, inherit) !important;
}

#sidebar {
	transition: min-width 115ms linear var(--uc-autohide-sidebar-delay) !important;
	min-width: var(--uc-sidebar-width) !important;
	will-change: min-width;
}

#sidebar-box:hover > #sidebar {
	min-width: var(--uc-sidebar-hover-width) !important;
	transition-delay: 0ms !important;
}

.sidebar-panel {
	background-color: transparent !important;
	color: var(--newtab-text-primary-color) !important;
}

.sidebar-panel #search-box {
	-moz-appearance: none !important;
	background-color: rgba(249, 249, 250, 0.1) !important;
	color: inherit !important;
}

/* Add sidebar divider and give it background */

#sidebar,
#sidebar-header {
	background-color: inherit !important;
/* 	border-inline: 1px solid rgb(80, 80, 80); */
	border-inline-width: 0px 1px;
}

#sidebar-box:not([positionend]) > :-moz-locale-dir(rtl),
#sidebar-box[positionend] > * {
	border-inline-width: 1px 0px;
}

/* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */

#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel {
	inset-inline: auto 0px !important;
}
#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label {
	margin-inline: 0px !important;
	border-left-style: solid !important;
}

.titlebar-buttonbox{
   margin-bottom: -40px !important;
}
