// TODO: Rework layout guide.

#customization-container {
	overflow-y: auto;
}

#customization-content-container,
#customization-footer {
	width: 849px;
	margin: 0 auto;
}

#customization-content-container {
	min-height: unset !important;
	padding-top: 52px;
}

#customization-footer {
	margin-top: 30px !important;
	padding: 0 !important;
}

#customization-header,
#customization-palette {
	margin: 0 !important;
}

#customization-header {
	margin: 0 !important;
	margin-bottom: 0px !important;
	margin-left: 0px !important;
	margin-left: 3px !important;
	font-weight: normal !important;
	font-size: 14pt !important;
	margin-bottom: 25px !important;
	font-kerning: none !important;
}

#customization-palette {
	overflow: unset !important;
	display: grid !important;
	padding: 0 !important;
	flex: unset !important;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 24px;
}

#customization-panel-container {
    display: none !important;
}

toolbarpaletteitem[place='palette'] {
	display: flex;
	margin: 0 !important;
	--size: 150px;
	height: var(--size) !important;
	width: var(--size) !important;
	max-width: unset !important;
	--tileBorder: rgb(217,217,217);
	border: 1px solid var(--tileBorder);
	background-color: white;
	padding: 8px;
	transform: unset !important;

	&::after {
		text-align: unset !important;
	}

	toolbarbutton {
		width: fit-content !important;
		padding: 0 !important;
		margin-bottom: 12px !important;

		.toolbarbutton-icon {
			width: 32px !important;
			height: 32px !important;
		}
	}

	toolbaritem {
		width: fit-content !important;
		padding: 0 !important;

		.toolbarbutton-icon,
		#fxa-avatar-image {
			width: 32px !important;
			height: 32px !important;
		}
	}
}

#nav-bar:not([urlbar-exceeds-toolbar-bounds]),
toolbar[overflowable][customizing] > .customization-target {
    overflow: visible !important;
}

html {
    #TabsToolbar {
        transition: opacity .5s linear;
    }

    #navigator-toolbox-background {
        background-color: rgb(0,0,0,0) !important;
        transition: background-color .5s linear;
        flex-direction: column !important;
    }

    #statusbarBackground {
        &::before {
            content: '';
            position: absolute;
            height: 100%;
            width: 100%;
            background-color: rgb(0,0,0,0) !important;
            transition: background-color .5s linear;
        }
    }

    /*#nav-bar-customization-target,
    #endToolbar,
    #addonsBar,
    #PersonalToolbar > toolbarpaletteitem:first-of-type,
    #PersonalToolbar > toolbarpaletteitem:last-of-type {
        position: relative !important;

        &::before,
        &::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            left: 50%;
            transform: translateX(-50%);
            bottom: -70%;
            opacity: 0 !important;
            transition: opacity .5s;
            pointer-events: none;
        }

        &::before {
            width: calc(100% - 40px);
            height: 100%;
            animation: guidePulseBefore 1.8s linear infinite;
            filter: blur(8px);
        }

        &::after {
            background-color: white;
            width: calc(100% - 70px);
            height: 80%;
            opacity: 80%;
            animation: guidePulseAfter 1.8s linear infinite;
            filter: blur(4px);
        }
    }

    #nav-bar-customization-target {
        &::before {
            background-color: rgba(43, 255, 0, 0.9)
        }
    }

    #endToolbar {
        min-width: 79px !important;

        &::before {
            background-color: rgba(255, 196, 0, 0.9)
        }
    }*/

    /*#PersonalToolbar > toolbarpaletteitem:first-of-type {
        &::before,
        &::after {
            position: absolute;
            width: 44px;
            height: calc(100% + 15px);
            bottom: -7px;
            z-index: 1;
        }

        &::before {
            left: -17px;
            background-color: rgba(0, 0, 255, 0.9)
        }

        &::after {
            left: -23px;
        }
    }*/

    /*#PersonalToolbar > toolbarpaletteitem:last-of-type {
        &::before,
        &::after {
            position: absolute;
            width: 44px;
            height: calc(100% + 15px);
            bottom: -7px;
            left: unset !important;
            z-index: 1;
        }

        &::before {
            right: -56px;
            background-color: rgba(247, 0, 255, 0.9)
        }

        &::after {
            right: -60px;
        }
    }

    #addonsBar {
        &::before {
            background-color: rgba(255, 0, 0, 0.9)
        }
    }*/

    &[customizing='true'] {
        #customization-palette {
            #bookmarks-menu-button,
            #bookmarksSidebarButton {
                background: none !important;
            }
        }

        /*#wrapper-stop-reload-button {
            filter: drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 4px rgba(43, 255, 0, 0.9))
                    drop-shadow(0px 0px 4px rgba(43, 255, 0, 0.9))
        }

        #search-container {
            #searchbar {
                filter: drop-shadow(0px 0px 2px #fff)
                        drop-shadow(0px 0px 2px #fff)
                        drop-shadow(0px 0px 4px rgba(43, 255, 0, 0.9))
                        drop-shadow(0px 0px 4px rgba(43, 255, 0, 0.9))
                        
            }
        }

        #home-button,
        #bookmarksSidebarButton,
        #IEMenuButton,
        #feedbackButton {
            filter: drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 4px rgba(255, 196, 0, 0.9))
                    drop-shadow(0px 0px 4px rgba(255, 196, 0, 0.9))
        }

        #addToBookmarksBarButton {
            filter: drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 4px rgba(0, 0, 255, 0.9))
                    drop-shadow(0px 0px 4px rgba(0, 0, 255, 0.9))
        }

        #cBHomeButton,
        #cBReadMailButton,
        #cBToolsMenuButton,
        #cBPageMenuButton,
        #cBHelpMenuButton,
        #cBPrintButton,
        #cBSafetyMenuButton,
        #_a9c2ad37-e940-4892-8dce-cd73c6cbbc0c_-browser-action {
            filter: drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 4px rgba(247, 0, 255, 0.9))
                    drop-shadow(0px 0px 4px rgba(247, 0, 255, 0.9))
        }

        #zoomMenuButton {
            filter: drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 2px #fff)
                    drop-shadow(0px 0px 4px rgba(255, 0, 0, 0.9))
                    drop-shadow(0px 0px 4px rgba(255, 0, 0, 0.9))
        }

        #TabsToolbar {
            opacity: .3;
        }

        /*#navigator-toolbox-background {
            background-color: rgb(0,0,0,.5) !important;
        }

        #statusbarBackground {
            &::before {
                background-color: rgb(0,0,0,.5) !important;
            }
        } */   
        
        #nav-bar-customization-target {
            clip-path: polygon(-100% -50%, 200% -50%, 150% 35px, -100% 35px);
        }

        #endToolbar {
            clip-path: polygon(-100% -50%, 200% -50%, 150% 27px, -100% 27px);

            @supports -moz-bool-pref("BeautyFox.appearance.IE9PreRelease") {
                clip-path: polygon(-100% -50%, 200% -50%, 150% 29px, -100% 29px);
            }
        }
        
        #addonsBar {
            overflow: hidden !important;
        }

        #nav-bar-customization-target,
        #endToolbar,
        #PersonalToolbar > toolbarpaletteitem:first-of-type,
        #PersonalToolbar > toolbarpaletteitem:last-of-type,
        #addonsBar {
            &::before,
            &::after {
                opacity: 1 !important;
            }
        }
    }
}

#wrapper-firefox-view-button,
#wrapper-edit-controls,
#wrapper-print-button,
#wrapper-email-link-button,
#wrapper-history-panelmenu,
#wrapper-find-button,
#wrapper-open-file-button,
#wrapper-sidebar-button,
#wrapper-logins-button,
#wrapper-sync-button,
#wrapper-screenshot-button,
#wrapper-save-to-pocket-button,
#wrapper-developer-button,
#wrapper-import-button,
#wrapper-library-button,
#wrapper-fxa-toolbar-menu-button,
[id*='wrapper-customizableui-special-spring'] {
	display: none !important;
}

#customization-uidensity-button {
    display: none !important;
}

#customization-toolbar-visibility-button {
    display: none !important;
}

#customization-reset-button {
	display: none !important;
}