/* Sass Document */ 
@import variables

=themeIconify($listname, $suffix)
	input, button, img, .panel-collapse, .arrow-right
		@each $icon, $link in $listname
				--#{$icon}#{$suffix}: url(../images/#{$link})
	.light-theme
		input, button, img, .panel-collapse, .arrow-right
			@each $icon, $link in $listname
				--#{$icon}#{$suffix}: url(../images/#{$link}) !important
	@media (prefers-color-scheme: dark)
		input, button, img, .panel-collapse, .arrow-right
			@each $icon, $link in $listname
				--#{$icon}#{$suffix}: url(../images/dark/#{$link})
	.dark-theme
		input, button, img, .panel-collapse, .arrow-right
			@each $icon, $link in $listname
				--#{$icon}#{$suffix}: url(../images/dark/#{$link})
	
=themeClassify($listname, $suffix)
	@each $icon, $link in $listname
		.#{$icon}#{$suffix}
			content: var(--#{$icon}#{$suffix})
 
+themeIconify($icons, Icon)
+themeIconify($dytable, Icon)
+themeClassify($dytable, Icon)

/* Mocha Toolbar - Main Toolbar */
#downloadButton img, .insertLink
	content: var(--insertLinkIcon) 
#uploadButton img, .listAdd
	content: var(--listAddIcon)
#deleteButton img, .deleteIcon, .listRemoveIcon
	content: var(--listRemoveIcon)
#resumeButton img, .mediaStart
	content: var(--startIcon)
#pauseButton img, .mediaPause
	content: var(--pauseIcon)
#topPrioButton img
	content: var(--goTopIcon)
#increasePrioButton img
	content: var(--goUpIcon)
#decreasePrioButton img
	content: var(--goDownIcon)
#bottomPrioButton img
	content: var(--goBottomIcon)
#preferencesButton img, .configureIcon
	content: var(--preferencesIcon)
#btn-toggle img
	content: var(--themeIcon)

/*statusFilterList
#all_filter a img
	content: var(--filterAllIcon)
#downloading_filter a img
	content: var(--downloadingIcon)
#seeding_filter a img
	content: var(--uploadingIcon)
#completed_filter a img
	content: var(--completedIcon)
#resumed_filter a img
	content: var(--resumedIcon)
#paused_filter a img
	content: var(--pausedIcon)
#active_filter a img
	content: var(--filterActiveIcon)
#inactive_filter a img
	content: var(--filterInactiveIcon)
#stalled_filter a img
	content: var(--filterStalledIcon)
#stalled_uploading_filter a img
	content: var(--stalledUPIcon)
#stalled_downloading_filter a img
	content: var(--stalledDLIcon)
#checking_filter a img
	content: var(--forceCheckIcon)
#errored_filter a img
	content: var(--errorIcon)

/* Footer Icons */
#desktopFooter 
	img
		height: 16px
		max-width: 16px
	table tbody tr 
		td:nth-of-type(5) img
			content: var(--firewalledIcon)
		td:nth-of-type(7) img
			content: var(--slowOffIcon)
			position: relative
			top: 2px
			width: 24px
			max-width: 24px  /* !important */
		td:nth-of-type(9) img
			content: var(--downloadingIcon)
		td:nth-of-type(11) img
			content: var(--uploadingIcon)
.connectedIcon
	content: var(--connectedIcon) !important
.firewalledIcon
	content: var(--firewalledIcon) !important
.disconnectedIcon
	content: var(--disconnectedIcon) !important
.slowOffIcon
	content: var(--slowOffIcon) !important
.slowIcon
	content: var(--slowIcon) !important

/* Pref Pane Overrides */
#SpeedTab .settings
	&:nth-of-type(1) table tbody tr td
		&:nth-of-type(1) img
			content: var(--slowOffIcon)
	&:nth-of-type(2) table tbody tr td
		&:nth-of-type(1) img
			content: var(--slowIcon)

/* Search Tab Icons */
#searchResultsGranularFiltersWarning
	content: var(--warningIcon)

/* RSS Downloader View
#newRuleButton
	background-image: var(--listAddIcon) !important
#deleteRuleButton
	background-image: var(--listRemoveIcon) !important

/* Log View
#logTableMenu
	.copyLogDataToClipboard img
		content: var(--editCopyIcon)
	li:nth-of-type(2)
		a img
			content: var(--listRemoveIcon) 

/*Main Menu Icons and Ovverides*/
#uploadLink img 
	content: var(--listAddIcon)
#downloadLink img
	content: var(--insertLinkIcon)
#logoutLink img
	content: var(--logOutIcon)
#shutdownLink img
	content: var(--applicationExitIcon)
#resumeAllLink img, #resumeLink img
	content: var(--startIcon)
#pauseAllLink img, #pauseLink img
	content: var(--pauseIcon)
#deleteLink img
	content: var(--listRemoveIcon)
#topPrioLink img
	content: var(--goTopIcon)
#increasePrioLink img
	content: var(--goUpIcon)
#decreasePrioLink img
	content: var(--goDownIcon)
#bottomPrioLink img
	content: var(--goBottomIcon)
#showTopToolbarLink, #showStatusBarLink, #speedInBrowserTitleBarLink, #showSearchEngineLink, #showRssReaderLink, #showFiltersSidebarLink, #showLogViewerLink
	img
		content: var(--checkedIcon)
#StatisticsLink img
	content: var(--viewStatsIcon)
#preferencesLink img
	content: var(--preferencesIcon)
#registerMagnetHandlerLink img
	content: var(--magnetIcon)
#docsLink img
	content: var(--helpContentIcon)
#bugLink img
	content: var(--walletIcon)
#aboutLink img
	content: var(--helpAboutIcon)

/* Header Menus */
#torrentsTableDiv_headerMenu, #torrentTrackersTableDiv_headerMenu, #torrentPeersTableDiv_headerMenu, #torrentsTableDiv_headerMenu, #torrentFilesTableDiv_headerMenu
	img
		content: var(--checkedIcon)

/* Misc Icons */
#watched_folders_tab
	tbody tr td
		&:nth-of-type(2) img
			content: var(--listAddIcon)
.filterTitle img
	content: var(--goDownIcon)
#categoryFilterList, #tagFilterList
	li a
		img
			content: var(--folderIcon)
#trackerFilterList
	li a
		img
			content: var(--trackersIcon)

/* Context menu Icons */
#torrentsTableMenu > li
	&:nth-of-type(1) a img
		content: var(--startIcon)
	&:nth-of-type(2) a img
		content: var(--pauseIcon)
	&:nth-of-type(3) a img
		content: var(--forceStartIcon)
	&:nth-of-type(4) a img
		content: var(--listRemoveIcon)
	&:nth-of-type(5) a
		&:nth-of-type(1) img
			content: var(--setLocationIcon)
	&:nth-of-type(6) > a, &:nth-of-type(7) > a
		&:nth-of-type(1) img
			content: var(--editRenameIcon)
	&:nth-of-type(8) > a img
		content: var(--viewCatIcon)
	&:nth-of-type(9) > a img
		content: var(--checkedIcon)
	&:nth-of-type(10) a img
		content: var(--downloadingIcon)
	&:nth-of-type(12)a img
			content: var(--uploadingIcon)
	&:nth-of-type(13) a img
			content: var(--ratioIcon)
	&:nth-of-type(16), &:nth-of-type(14), &:nth-of-type(15) 
		a img
			content: var(--checkedIcon)
	&:nth-of-type(17) a img
		content: var(--forceCheckIcon)
	&:nth-of-type(18) a img
		content: var(--reannounceIcon)
	&:nth-of-type(19)
		ul li
			&:nth-of-type(1) a img
				content: var(--goTopIcon)
			&:nth-of-type(2) a img
				content: var(--goUpIcon)
			&:nth-of-type(3) a img
				content: var(--goDownIcon)
			&:nth-of-type(4) a img
				content: var(--goBottomIcon)
	&:nth-of-type(20)
		a:nth-of-type(1) img
			content: var(--editCopyIcon)
		ul li
			&:nth-of-type(1) a img
				content: var(--nameIcon)
			&:nth-of-type(2), &:nth-of-type(3) 
				> a img
					content: var(--hashIcon)
			&:nth-of-type(4) a img
				content: var(--magnetIcon)
			&:nth-of-type(5) a img
				content: var(--helpAboutIcon)
	&:nth-of-type(21)
		a:nth-of-type(1) img
			content: var(--editCopyIcon)

#contextCategoryList li
	a img
		content: var(--folderIcon)
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img
		content: var(--editClearIcon)

#contextTagList li
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img
		content: var(--editClearIcon)

#categoriesFilterMenu li
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img
		content: var(--listAddIcon)
	&:nth-of-type(3) a img
		content: var(--editRenameIcon)
	&:nth-of-type(4) a img, &:nth-of-type(5) a img
		content: var(--listRemoveIcon)
	&:nth-of-type(6) a img
		content: var(--startIcon)
	&:nth-of-type(7) a img
		content: var(--pauseIcon)
	&:nth-of-type(8) a img
		content: var(--listRemoveIcon)
#tagsFilterMenu li
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img, &:nth-of-type(3) a img
		content: var(--listRemoveIcon)
	&:nth-of-type(4) a img
		content: var(--startIcon)
	&:nth-of-type(5) a img
		content: var(--pauseIcon)
	&:nth-of-type(6) a img
		content: var(--listRemoveIcon)
#trackersFilterMenu li
	&:nth-of-type(1) a img
		content: var(--startIcon)
	&:nth-of-type(2) a img
		content: var(--pauseIcon)
	&:nth-of-type(3) a img
		content: var(--listRemoveIcon)

#torrentTrackersMenu li
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img
		content: var(--editRenameIcon)
	&:nth-of-type(3) a img
		content: var(--listRemoveIcon)
	&:nth-of-type(4) a img
		content: var(--editCopyIcon)
#torrentPeersMenu li
	&:nth-of-type(1) a img
		content: var(--peersAddIcon)
	&:nth-of-type(2) a img
		content: var(--editCopyIcon)
	&:nth-of-type(3) a img
		content: var(--peersRemoveIcon)
#torrentFilesMenu li:nth-of-type(1) a img
	content: var(--editRenameIcon)

#searchResultsTableMenu li
	&:nth-of-type(1) a img
		content: var(--downloadIcon)
	&:nth-of-type(2) a img
		content: var(--worldIcon)
	&:nth-of-type(3) a img
		content: var(--editCopyIcon)
#searchPluginsTableMenu li
	&:nth-of-type(1) a img
		content: var(--checkedIcon)
	&:nth-of-type(2) a img
		content: var(--listRemoveIcon)

#rssFeedMenu li
	&:nth-of-type(1) a img
		content: var(--viewRefreshIcon)
	&:nth-of-type(2) a img
		content: var(--taskCompleteIcon)
	&:nth-of-type(3) a img
		content: var(--editRenameIcon)
	&:nth-of-type(4) a img
		content: var(--editClearIcon)
	&:nth-of-type(5) a img
		content: var(--listAddIcon)
	&:nth-of-type(6) a img
		content: var(--folderNewIcon)
	&:nth-of-type(7) a img
		content: var(--viewRefreshIcon)
	&:nth-of-type(8) a img
		content: var(--editCopyIcon)
#rssDownloaderRuleMenu li
	&:nth-of-type(1) a img
		content: var(--listAddIcon)
	&:nth-of-type(2) a img
		content: var(--listRemoveIcon)
	&:nth-of-type(3) a img
		content: var(--editRenameIcon)
	&:nth-of-type(4) a img
		content: var(--editClearIcon)
#rssArticleMenu li
	&:nth-of-type(1) a img
		content: var(--downloadIcon)
	&:nth-of-type(2) a img
		content: var(--worldIcon)
