/*--------------------------------------------------------------
>>> PLAYER
----------------------------------------------------------------
# Hide shadow around player bar
# Always show progress bar
# Transparent background
# Hide annotations
# Hide endscreen
# Hide cards
# Hide "Includes Paid Promotion"
# Show cards on mouse hover
# Hide "Scroll for details"
# Player Size
--------------------------------------------------------------*/
html[it-ambient-lighting='false'] #cinematics {display: none !important;}
/*--------------------------------------------------------------
# ALWAYS SHOW PROGRESS BAR
--------------------------------------------------------------*/


html[it-always-show-progress-bar='true'] .html5-video-player:not(.it-mini-player).ytp-autohide .ytp-chrome-bottom {
	opacity: 1 !important;
}

html[it-always-show-progress-bar='true'] .html5-video-player:not(.it-mini-player).ytp-autohide .ytp-chrome-bottom .ytp-chrome-controls {
	opacity: 0 !important;
}

html[it-always-show-progress-bar='true'] .html5-video-player:not(.it-mini-player).ytp-autohide .ytp-chrome-bottom .ytp-progress-bar-container {
	bottom: 0 !important;
}

html[it-always-show-progress-bar='true'] .DesktopShortsPlayerControlsHostHideProgressBar {
    visibility: visible;
}
html[it-always-show-progress-bar='true'] .html5-video-player:not(.it-mini-player).ytp-autohide .ytp-chrome-bottom .ytp-scrubber-button {
    display: none !important;
}

/*--------------------------------------------------------------
# FIX: hide full control strip in native miniplayer
--------------------------------------------------------------*/
ytd-miniplayer .ytp-chrome-bottom,
.html5-video-player.ytp-player-minimized .ytp-chrome-bottom,
.html5-video-player.ytp-small-mode .ytp-chrome-bottom {
	opacity: 0 !important;
	pointer-events: none !important;
}

ytd-miniplayer .ytp-chrome-bottom .ytp-progress-bar-container,
.html5-video-player.ytp-player-minimized .ytp-chrome-bottom .ytp-progress-bar-container,
.html5-video-player.ytp-small-mode .ytp-chrome-bottom .ytp-progress-bar-container,
ytd-miniplayer .ytp-chrome-bottom .ytp-scrubber-button,
.html5-video-player.ytp-player-minimized .ytp-chrome-bottom .ytp-scrubber-button,
.html5-video-player.ytp-small-mode .ytp-chrome-bottom .ytp-scrubber-button {
	display: none !important;
}

/*--------------------------------------------------------------
# COLOR
--------------------------------------------------------------*/

html[it-player-color='red'] {
	--it-player-color: #f03;
}

html[it-player-color='pink'] {
	--it-player-color: #e91e63;
}

html[it-player-color='purple'] {
	--it-player-color: #9c27b0;
}

html[it-player-color='deep_purple'] {
	--it-player-color: #673ab7;
}

html[it-player-color='indigo'] {
	--it-player-color: #3f51b5;
}

html[it-player-color='blue'] {
	--it-player-color: #1e88e5;
}

html[it-player-color='light_blue'] {
	--it-player-color: #03a9f4;
}

html[it-player-color='cyan'] {
	--it-player-color: #00bcd4;
}

html[it-player-color='teal'] {
	--it-player-color: #009688;
}

html[it-player-color='green'] {
	--it-player-color: #4caf50;
}

html[it-player-color='light_green'] {
	--it-player-color: #8bc34a;
}

html[it-player-color='lime'] {
	--it-player-color: #cddc39;
}

html[it-player-color='yellow'] {
	--it-player-color: #ffeb3b;
}

html[it-player-color='amber'] {
	--it-player-color: #ffc107;
}

html[it-player-color='orange'] {
	--it-player-color: #ff9800;
}

html[it-player-color='deep_orange'] {
	--it-player-color: #ff5722;
}

html[it-player-color='brown'] {
	--it-player-color: #795548;
}

html[it-player-color='blue_gray'] {
	--it-player-color: #607d8b;
}

html[it-player-color='white'] {
	--it-player-color: #fff;
}

html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytp-scrubber-button,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytp-menuitem[aria-checked='true'] .ytp-menuitem-toggle-checkbox,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytd-thumbnail-overlay-resume-playback-renderer
{
	background: var(--it-player-color) !important;
	background-color: var(--it-player-color) !important;
}

html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytp-swatch-color {
	color: var(--it-player-color) !important;
}

html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytp-settings-button.ytp-hd-quality-badge:after{
	background-color: var(--it-player-color) !important;
}

/* change all the linear gradient elements in new youtube */

html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytp-play-progress,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .YtThumbnailOverlayProgressBarHostWatchedProgressBarSegmentModern,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .YtChapteredProgressBarChapteredPlayerBarChapterRefresh,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .YtChapteredProgressBarChapteredPlayerBarFillRefresh,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .YtProgressBarLineProgressBarPlayedRefresh,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .yt-page-navigation-progress,
html[it-player-color]:not([it-player-color='default']):not([it-player-color='normal']) .ytd-progress-bar-line
{
	background: var(--it-player-color) !important;
}

/*--------------------------------------------------------------
# TRANSPARENT BACKGROUND
--------------------------------------------------------------*/

html[it-player-transparent-background='true'] #player-theater-container,
html[it-player-transparent-background='true'] #theater-background,
html[it-player-transparent-background='true'] #player-api,
html[it-player-transparent-background='true'] .player-api,
html[it-player-transparent-background='true'] #movie_player,
html[it-player-transparent-background='true'] #player-container,
html[it-player-transparent-background='true'] #movie_player video {
	background-color: transparent !important;
}


/*--------------------------------------------------------------
# VIDEO TITLE IN FULLSCREEN
--------------------------------------------------------------*/
html[it-hide-video-title-fullScreen='true'] .ytp-title-text > a,
/*--------------------------------------------------------------
# YOUTUBE RETURN BUTTON IN FULLSCREEN
--------------------------------------------------------------*/
#it-youtube-return-button {
	position: absolute !important;
	top: 20px !important;
	left: 20px !important;
	z-index: 9999 !important;
	background: rgba(0, 0, 0, 0.8) !important;
	border: none !important;
	border-radius: 4px !important;
	padding: 8px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 40px !important;
	height: 40px !important;
}

#it-youtube-return-button:hover {
	background: rgba(0, 0, 0, 0.9) !important;
	transform: scale(1.1) !important;
}

#it-youtube-return-button svg {
	width: 24px !important;
	height: 24px !important;
	fill: white !important;
}

.html5-video-player:not(.ytp-fullscreen) #it-youtube-return-button {
	display: none !important;
}

/*--------------------------------------------------------------
# SHADOW AROUND PLAYER BAR
--------------------------------------------------------------*/
html[it-hide-gradient-bottom='true'] .ytp-gradient-bottom,
/*------------------------------------------------------------------------------
# CONTROLS 
------------------------------------------------------------------------------*/
html[it-player-play-button=true] .ytp-play-button,
html[it-player-previous-button=true] .ytp-prev-button,
html[it-player-next-button=true] .ytp-next-button,
html[it-player-volume-button=true] .ytp-volume-area,
html[it-player-autoplay-button=true] .ytp-right-controls .ytp-button[data-tooltip-target-id = ytp-autonav-toggle-button],
html[it-player-settings-button=true] .ytp-settings-button,
html[it-player-subtitles-button=true] .ytp-subtitles-button,
html[it-player-miniplayer-button=true] .ytp-miniplayer-button,
html[it-player-view-button=true] .ytp-size-button,
html[it-player-screen-button=true] .ytp-fullscreen-button,
html[it-player-remote-button=true] .ytp-remote-button,
html[it-player-chaptertitle-button=true] .ytp-chapter-container {
	display: none !important;
}
html[it-player-subtitlesLine-button=true] button.ytp-subtitles-button.ytp-button::after{
    display: none;
}
/*--------------------------------------------------------------
# HIDE ANNOTATIONS
--------------------------------------------------------------*/
html[it-player-hide-annotations='true'] .annotation,
html[it-player-hide-annotations='true'] .annotation-type-text,
html[it-player-hide-annotations='true'] .annotation-shape,
/*--------------------------------------------------------------
# HIDE ENDSCREEN
--------------------------------------------------------------*/
html[it-player-hide-endscreen='true'] .html5-endscreen,
/*--------------------------------------------------------------
# HIDE CARDS
--------------------------------------------------------------*/
html[it-player-hide-cards='true'] .ytp-ce-element,
html[it-player-hide-cards='true'] .ytp-ce-video,
html[it-player-hide-cards='true'] .ytp-cards-button,
html[it-player-hide-cards='true'] .ytp-cards-teaser,
/*--------------------------------------------------------------
# SHOW CARDS ON MOUSE HOVER
--------------------------------------------------------------*/
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:not(:hover) .ytp-ce-element,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:not(:hover) .ytp-ce-video,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:not(:hover) .ytp-cards-button,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:not(:hover) .ytp-cards-teaser {
	display: none !important;
}

html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:hover .ytp-ce-element,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:hover .ytp-ce-video,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:hover .ytp-cards-button,
html[it-player-show-cards-on-mouse-hover='true'] .html5-video-player:hover .ytp-cards-teaser {
	display: block !important;
}

/*--------------------------------------------------------------
# HIDE "SCROLL FOR DETAILS"
--------------------------------------------------------------*/

html[it-hide-scroll-for-details='true'] button.ytp-fullerscreen-edu-button {
	display: none !important;
}

html[it-hide-scroll-for-details='true'] ytd-app[scrolling_] {
	overflow: hidden !important;
}

/*--------------------------------------------------------------
# Player Size
--------------------------------------------------------------*/
/*required for firefox'  autoplay:off only: */
html[data-page-type="video"][it-player-size]:not([it-player-size='do_not_change']) #movie-player .ytp-cued-thumbnail-overlay {z-index:10}

 /*--------------------------------------------------------------
# NORMAL
--------------------------------------------------------------*/

html[data-page-type=video]:not([it-header-position]) ytd-app,
html[data-page-type=video][it-header-position=normal] ytd-app,
html[data-page-type=video][it-header-position=static] ytd-app {
	--it-header-size: 56px;
}
/* 
html[data-page-type=video]:not([it-header-position]) ytd-watch-flexy:not([theater]),
html[data-page-type=video][it-header-position=normal] ytd-watch-flexy:not([theater]),
html[data-page-type=video][it-header-position=static] ytd-watch-flexy:not([theater]) {
	--it-header-size: 104px;
}

html[data-page-type=video]:not([it-header-position]) div#page,
html[data-page-type=video][it-header-position=normal] div#page,
html[data-page-type=video][it-header-position=static] div#page {
	--it-header-size: 50px;
}

html[data-page-type=video]:not([it-header-position]) div#page:not(.watch-wide),
html[data-page-type=video][it-header-position=normal] div#page:not(.watch-wide),
html[data-page-type=video][it-header-position=static] div#page:not(.watch-wide) {
	--it-header-size: 70px;
} */


/*--------------------------------------------------------------
# HIDDEN
--------------------------------------------------------------*/

html[data-page-type=video][it-header-position=hidden],
html[data-page-type=video][it-header-position=hidden_on_video_page] {
	--it-header-size: 0px;
}

html[data-page-type=video][it-header-position=hidden] ytd-watch-flexy:not([theater]),
html[data-page-type=video][it-header-position=hidden_on_video_page] ytd-watch-flexy:not([theater]) {
	--it-header-size: 48px;
}

html[data-page-type=video][it-header-position=hidden] div#page,
html[data-page-type=video][it-header-position=hidden_on_video_page] div#page {
	--it-header-size: 0px;
}

html[data-page-type=video][it-header-position=hidden] div#page:not(.watch-wide),
html[data-page-type=video][it-header-position=hidden_on_video_page] div#page:not(.watch-wide) {
	--it-header-size: 20px;
}


/*--------------------------------------------------------------
# HOVER
--------------------------------------------------------------*/

html[data-page-type=video][it-header-position=hover],
html[data-page-type=video][it-header-position=hover_on_video_page] {
	--it-header-size: 14px;
}

html[data-page-type=video][it-header-position=hover] ytd-watch-flexy:not([theater]),
html[data-page-type=video][it-header-position=hover_on_video_page] ytd-watch-flexy:not([theater]) {
	--it-header-size: 62px;
}

html[data-page-type=video][it-header-position=hover] div#page,
html[data-page-type=video][it-header-position=hover_on_video_page] div#page {
	--it-header-size: 12px;
}

html[data-page-type=video][it-header-position=hover] div#page:not(.watch-wide),
html[data-page-type=video][it-header-position=hover_on_video_page] div#page:not(.watch-wide) {
	--it-header-size: 32px;
}

html[data-page-type=video][it-header-position=hover] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) .player-theater-container,
html[data-page-type=video][it-header-position=hover_on_video_page] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) .player-theater-container {
	margin-top: 14px;
}

html[data-page-type=video][it-header-position=hover] div#page #movie_player:not(.it-mini-player):not(.ytp-fullscreen),
html[data-page-type=video][it-header-position=hover_on_video_page] div#page #movie_player:not(.it-mini-player):not(.ytp-fullscreen) {
	margin-top: 12px;
}

html[data-page-type=video][it-header-position=hover] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]),
html[data-page-type=video][it-header-position=hover_on_video_page] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) {
	margin-top: 14px;
}

 /*--------------------------------------------------------------
# FIXED PLAYER SIZE
--------------------------------------------------------------*/

html[data-page-type=video][it-player-size='240p'],
html[data-page-type=video][it-player-size='360p'],
html[data-page-type=video][it-player-size='480p'],
html[data-page-type=video][it-player-size='576p'],
html[data-page-type=video][it-player-size='720p'],
html[data-page-type=video][it-player-size='1080p'],
html[data-page-type=video][it-player-size='1440p'],
html[data-page-type=video][it-player-size='2160p'] {
	--it-header-size: 0px !important;
}

html[data-page-type=video][it-player-size='240p'] {
	--it-player-size: 240px;
}

html[data-page-type=video][it-player-size='360p'] {
	--it-player-size: 360px;
}

html[data-page-type=video][it-player-size='480p'] {
	--it-player-size: 480px;
}

html[data-page-type=video][it-player-size='576p'] {
	--it-player-size: 576px;
}

html[data-page-type=video][it-player-size='720p'] {
	--it-player-size: 720px;
}

html[data-page-type=video][it-player-size='1080p'] {
	--it-player-size: 1080px;
}

html[data-page-type=video][it-player-size='1440p'] {
	--it-player-size: 1440px;
}

html[data-page-type=video][it-player-size='2160p'] {
	--it-player-size: 2160px;
}

/*--------------------------------------------------------------
# MAX WIDTH ON PAGE
--------------------------------------------------------------*/
html[data-page-type=video][it-player-size='max_width'] ytd-browse > ytd-two-column-browse-results-renderer:not([page-subtype='subscriptions']) {
	width: auto !important;
	max-width: auto !important;
}

html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #columns.ytd-watch-flexy, 
html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #primary.ytd-watch-flexy {
	max-width: 98.5% !important;
	margin: 2px !important;
}

html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #below {
	margin-left: max(18px, calc(21vw - 230px)) !important;
	margin-right:max(18px, calc(13vw - 130px)) !important;
	max-width: 1600px !important;
	} 

html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #player {
	margin-top: -20px !important;
	object-fit: contain !important;
}
html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #player-container-outer.ytd-watch-flexy {
	max-width: 98.5% !important;
}
	
html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) #player-container-inner.ytd-watch-flexy {
	padding-top: calc(var(--ytd-watch-flexy-max-player-height) + 45px) !important;
}
	
html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) .html5-video-container {
	width: 100% !important;   
	height: 100% !important;
}  

html[data-page-type=video][it-player-size='max_width'] ytd-watch-flexy:not([fullscreen]) video {
	position: static !important; 
	top: 0 !important;
	left: 0 !important; 
	width: 100% !important;
	height: 100% !important;
    justify-content: center !important
}
	
html[data-page-type=video][it-player-size='max_width'] {
	--it-player-size: 86vh;
}

html[data-page-type=video][it-player-size='max_width'] .ytp-fit-cover-video .html5-main-video {
	object-fit: contain !important;
}
	
/*--------------------------------------------------------------
# FULL HEIGHT  "Full window"
--------------------------------------------------------------*/

html[data-page-type=video][it-player-size='full_window'] {
	--it-player-size: 100vh;
}

/*outdated line?*/ html[data-page-type=video][it-player-size='full_window'] ytd-watch-flexy[theater]:not([fullscreen]) #player-wide-container, 
html[data-page-type=video][it-player-size='fit_to_window'] ytd-watch-flexy[full-bleed-player]:not([fullscreen]) #full-bleed-container.ytd-watch-flexy,
html[data-page-type=video][it-player-size='full_window'] ytd-watch-flexy[full-bleed-player]:not([fullscreen]) #full-bleed-container.ytd-watch-flexy {
	height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
	max-height: var(--it-player-size, 100vh) !important;
}

html[data-page-type=video][it-player-size='full_window'] .ytp-fit-cover-video .html5-main-video {
	object-fit: contain !important;
}

html[data-page-type="video"][it-player-size="full_window"] ytd-watch-flexy[default-layout]:not([no-top-margin]):not([reduced-top-margin]) #primary {padding-top:0}

/*--------------------------------------------------------------
#  "FIT TO WINDOW"  (needs update)
--------------------------------------------------------------*/

html[data-page-type="video"][it-player-size="fit_to_window"] ytd-watch-flexy[default-layout]:not([no-top-margin]):not([reduced-top-margin]) #primary {padding-top:0}
html[data-page-type=video][it-player-size='fit_to_window'] {
	--it-player-size: 100vh;
}

html[data-page-type=video][it-player-size='fit_to_window'] .ytp-fit-cover-video .html5-main-video {
	object-fit: contain !important;
}
	
/*--------------------------------------------------------------
# ELEMENTS
--------------------------------------------------------------*/

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) #player-container-inner {
	padding-top: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
}

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container,
html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-theater-container {
	width: auto !important;
	height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
	min-height: auto !important;
	max-height: none !important;
}

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) .html5-video-player {
	background: #000 !important;
}

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) .html5-video-container {
	position: absolute !important;
	display: flex !important;
	width: 100% !important;
	height: 100% !important;
	justify-content: center !important;
	align-items: center !important;
}

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) .html5-video-player:not(.it-mini-player) video {
	position: relative !important;
	top: 0 !important;
	left: 0 !important;
	width: auto !important;
	max-width: 100% !important;
	height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
}


/*--------------------------------------------------------------
# THEATER: ON
--------------------------------------------------------------*/

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-theater-container {
	height: auto !important;
	min-height: 0 !important;
	max-height: unset !important;
	background: transparent !important;
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-container {
	position: static !important;
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) ytd-player>#container {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) .html5-video-container {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}


html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) video {
	position: static !important;
/*	width: auto !important;
	height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;  
	*/
	max-height: none !important;
	max-width: 100% !important;
	height: var(--height, 64vh) !important;
	width: var(--width, 36vw) !important;
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) #container {
	--height: calc(var(--it-player-size) - var(--it-header-size));
	--ratio: calc(var(--ytd-watch-flexy-width-ratio) / var(--ytd-watch-flexy-height-ratio));
	--width: calc(var(--height) * var(--ratio));
}

/*--------------------------------------------------------------
# THEATER: OFF
--------------------------------------------------------------*/

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container-inner {
	padding-top: 0 !important;
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container {
	position: static !important;
}


html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) .html5-video-player {
	width: auto;
	display: table;
	margin: auto
}

html[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) video {
	position: static !important;
	width: 100% !important;
	height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
	max-height: none !important;
}

/*--------------------------------------------------------------
# CUSTOM PLAYER SIZE
--------------------------------------------------------------*/

html[data-page-type='video'][it-player-size='custom'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container,
html[data-page-type='video'][it-player-size='custom'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-theater-container {
	width: var(--it-player-width, 64vw) !important;
	height: var(--it-player-height, 36vh) !important;
	margin: 0 auto;
	min-height: auto !important;
	max-height: none !important;
}

html[data-page-type='video'][it-player-size='custom'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container-inner {
	padding-top: var(--it-player-height) !important;
}

/*--------------------------------------------------------------
# SKIP OVERLAY
--------------------------------------------------------------*/

html[it-player-hide-skip-overlay=true] .ytp-doubletap-ui,
html[it-player-hide-skip-overlay=true] .ytp-doubletap-ui-legacy {
    visibility: hidden;
}

/*--------------------------------------------------------------
# REMOVE BLACK BARS IN FULL SCREEN MODE
--------------------------------------------------------------*/

html[data-page-type=video][it-remove-black-bars=true] ytd-watch-flexy[fullscreen] .html5-video-container {
	height: 100%;
	width: 100%;
}

html[data-page-type=video][it-remove-black-bars=true] ytd-watch-flexy[fullscreen] .html5-main-video {
	height: 100%!important;
	width: 100%!important;
	top: 0px!important;
	left: 0px!important;
	object-fit: cover;
}

/*--------------------------------------------------------------
# HIDE TOP Progress BAR
--------------------------------------------------------------*/

html[data-page-type=video][it-hide-top-loading-bar=true] #progress.style-scope.yt-page-navigation-progress,
html[data-page-type=video][it-hide-top-loading-bar=true] .ytp-load-progress,
html[data-page-type=video][it-hide-top-loading-bar=true] .ytp-loading-bar {
    display: none !important;
}

/*--------------------------------------------------------------
# HIDE PROGRESS BAR PREVIEW
--------------------------------------------------------------*/
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-preview,
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-tooltip,
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-tooltip-bg,
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-tooltip-text,
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-tooltip-text-wrapper,
html[data-page-type=video][it-hide-progress-preview='true'] .ytp-chapter-hover-container {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/*--------------------------------------------------------------
# HIDE "SCROLL FOR DETAILS"
--------------------------------------------------------------*/

html[it-hide-scroll-for-details='true'] button.ytp-fullerscreen-edu-button {
	display: none !important;
}

html[it-hide-scroll-for-details='true'] ytd-app[scrolling_] {
	overflow: hidden !important;
}

/*--------------------------------------------------------------
# HIDE Includes Paid Promotion
--------------------------------------------------------------*/
html[data-page-type=video][it-hide-includes-paid-promotion=true] .ytp-paid-content-overlay,
html[data-page-type=home][it-hide-includes-paid-promotion=true] .YtmPaidContentOverlayLink,
html[data-page-type=other][it-hide-includes-paid-promotion=true] .YtmPaidContentOverlayLink  {
  display: none !important;
}

/*--------------------------------------------------------------
# FIX FOR YOUTUBE'S NEW BIG PLAYER CONTROLS IN THEATER MODE
--------------------------------------------------------------*/

/* This targets the player only when YouTube applies the .ytp-big-mode class */
html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-chrome-bottom {
    height: 51px !important;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-chrome-controls {
    height: 48px !important;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-button {
    width: 48px !important;
    height: 48px !important;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-menu .ytp-menuitem {
    height: 48px !important;
    line-height: 48px !important;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-time-display {
	height: 48px !important;
	display: flex;
	align-items: center;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-time-duration, html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-time-separator, html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-time-current {
	font-size: 13.0691px !important;
}

html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp-time-contents {
	display: flex;
	align-items: center;
}