/* ==UserStyle==
@name           Discord AdBlock
@namespace      https://github.com/CroissantDuNord/discord-adblock
@version        1.0.0
@description    Removes annoying Nitro upsells from Discord.
@author         CroissantDuNord & contributors
==/UserStyle== */

/* Temporary: Spring 2025 Fullscreen Nitro ad */
div[class^=layerContainer_]:has(img[src="//cdn.discordapp.com/promotions/premium-marketing/1339699795819892826/1346282189033181216.gif"]) {
  display: none;
}

/* Fullscreen Nitro trial ad */
div[class^=layerContainer_]:has(div[class*="freeTrialPillWithSparkles_"]) {
  display: none;
}

/* Hide Nitro quality selectors and upsell */
div[class^="qualitySettingsContainer_"] > div > div > div > div> button[class*=premiumUpsell] {
    display: none;
}
div[class^="qualitySettingsContainer_"] > div[class^=upsellBanner__] {
    display: none;
}

/* Chat view blocks */
/* App launcher icons (chat box, guild menu, AI apps on image hover) */
div[class^=channelAppLauncher_] {
  display: none !important;
}
div[class^="jumpToPresentBar_"] {
  right: 16px;
}
div[id="guild-header-popout-application-directory"] {
  display: none;
}
div[class^=hoverButton_]:has(g[transform="matrix(2.700000047683716,0,0,2.700000047683716,-79.60000610351562,-81.35110473632812)"]) {
  display: none;
}

/* Store tab */
li[class^=channel_]:has(a[href="/shop"]) {
    display: none;
}

/* Nitro tab */
li[class^=channel_]:has(a[href="/store"]) {
    display: none;
}

/* Store popup ads */
[id^=popout]:has([class^=buttonContainerVertical]) {
    display:none;
}

/* Gift button */
div[class^=buttons__] button:has(path[d=" M-7,10 C-8.104999542236328,10 -9,9.104999542236328 -9,8 C-9,8 -9,2.5 -9,2.5 C-9,2.2239999771118164 -8.776000022888184,2 -8.5,2 C-8.5,2 -1.5,2 -1.5,2 C-1.2239999771118164,2 -1,2.2239999771118164 -1,2.5 C-1,2.5 -1,9.5 -1,9.5 C-1,9.776000022888184 -1.2239999771118164,10 -1.5,10 C-1.5,10 -7,10 -7,10z M1,9.5 C1,9.776000022888184 1.2239999771118164,10 1.5,10 C1.5,10 7,10 7,10 C8.104999542236328,10 9,9.104999542236328 9,8 C9,8 9,2.5 9,2.5 C9,2.2239999771118164 8.776000022888184,2 8.5,2 C8.5,2 1.5,2 1.5,2 C1.2239999771118164,2 1,2.2239999771118164 1,2.5 C1,2.5 1,9.5 1,9.5z"]) {
    display: none;
}

/* Super reactions -- Doesn't seem like these are being pushed on free users anymore. */
/* Leaving them as is, but raise an issue if they break normal reactions. */
#message-add-reaction-1 {
    display: none;
}
#message-actions-add-reaction-1 {
    display: none;
}

/* Settings pages */
/* Banner ads */
#profile-customization-tab>div:has(div[class*="artContainer"][role="presentation"]) {
  display: none;
}
#profile-customization-tab > div[class^=upsellContainer__] {
display: none;
}

/* Avatar decoration settings */
#profile-customization-tab > div > div[class*=profileCustomizationSection_] > div[class*=baseLayout_] > div[class*=sectionsContainer_] > div[class*=customizationSection_]:nth-of-type(4) {
    display: none;
}

/* Profile effect settings */
#profile-customization-tab > div > div[class*=profileCustomizationSection_] > div[class*=baseLayout_] > div[class*=sectionsContainer_] > div[class*=customizationSection_]:nth-of-type(5) {
    display: none;
}

/* Profile Nitro preview */
#profile-customization-tab > div:has(div[class^=premiumFeatureBorder__]) {
display: none;
}

/* "Try Nitro!" ad */
#profile-customization-tab > [class*=premiumFeatureBorder_] {
    display: none;
}

/* Server profiles upsell */
#profile-customization-tab > div > div[class*=profileCustomizationSection_] > div[class*=baseLayout_] > div[class*=sectionsContainer_] > div[class*=upsellOverlayContainer_] {
    display: none;
}

/* App colour */
#appearance-tab > div > div > div > div > div > div > div > section:has(svg[class*=nitroWheel_]) {
  display: none;
}

/* Icon Theme (just edit the .ico file) */
#appearance-tab > div > div div[class^=selectionGroup__]:has(svg[class*=nitroWheel_]) {
  display: none;
}

/* BOGO button in settings */
div[class^=premiumLabel_] > div[class^=badgeContainer_]:has(span[class*="star_"]) {
  display: none;
}

/* Billing info sidebar --- I've decided it's better to just leave this, it's not too intrusive.
Blocking each element in the list is tedious and can break some client mods that add their own settings entries.
If anyone knows a better way to block precisely the billing info settings, please make a PR :) */

/*
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div:nth-child(2) > div > div.sidebarRegion__60457 > div > nav > div > div.premiumTab__57bdc.item__48dda.themed_b957e8 {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.separator_fdbcfd:nth-of-type(11) {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.header_f72511:nth-of-type(12) {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.themed_b957e8.item__48dda:nth-of-type(14) {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.themed_b957e8.item__48dda:nth-of-type(15) {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.themed_b957e8.item__48dda:nth-of-type(16) {
    display: none
}
#app-mount > div.appAsidePanelWrapper__714a6 > div.notAppAsidePanel__9d124 > div.app_b1f720 > div > div > div > div.standardSidebarView__1129a > div.sidebarRegion__60457 > div.sidebarRegionScroller__1fa7e.thin_b1c063.scrollerBase_dc3aa9.fade_ba0fa0 > nav.sidebar__9e3e2 > div.side_b4b3f6 > div.themed_b957e8.item__48dda:nth-of-type(17) {
    display: none
} */

/* Guilds blocking */
/* Server boost button */
#guild-header-popout > div > div:nth-child(1), #guild-header-popout > div > div:nth-child(2) {
    display: none;
}

/* Custom Join Sound AD (No discord I dont want to play a random meme sound when I join a call)*/
#popout_4611 > div > div > div.gridNoticeWrapper__548b9 > div {
    display: none;
}

/* Hide upsell banner for messages that are too long */
div[class*=characterCount] > div[class*=upsell_] {
    display: none;
}

/* Hide message length Nitro "subscribe" button */
div[role=dialog] > div > div > div[class*=primaryActions_] > button:has(svg[class*=premiumIcon]) {
  display: none;
}

/* Desktop app ad */
[class^=notice_]:has(i[class^=iconApple]){
    display:none;
}

/* You have X days left to try Nitro banner */
div[class^=base_] > div[class^=notice_]:has([class^=premiumIcon_]) {
    display: none;
}

/* Profile popup upsell */
div[class^="inner_"] > div[class^="body_"] > div[class^="upsellContainer_"] {
    display: none;
}

/* Try nitro and get avatar decorations banner */
div[class^=notice_][class*=colorPremium_] {
  display: none;
}

/* Bookmarks with Nitro popout */
div[id^=popout_]:has(div[class*="upsellTooltipWrapper__"]) {
  display: none;
}

/* Notification sounds setting */
div[id="user-context"] > div[class^="scroller_"] > div[role="group"] > div:has(div[id="user-context-notification-sounds"]) {
  display: none;
}
