/* variables for controlling the jukebox css */
#jukeboxMain {
	--song-color: rgb(128, 128, 128);
}

/* actual div styling */
#jukeboxMain {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	
	width: 100%;
	flex-grow: 1;
	border-top: 2px solid white;
	
	box-shadow: inset 0 0 2em var(--song-color);
	transition: box-shadow 2s;
}

#jukeboxMain a {
	color: var(--dark-link-color);
}

#songSelect {
	background-color: rgba(0, 0, 0, .5);
	width: 40vw;
	min-width: 40vw;
}

#albumSelect {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	text-align: center;
	padding: .5em 0;
}

.switcherArrow {
	width: 1.5em;
	height: 1.5em;
	padding: .5em;
	
	filter: brightness(var(--text-brightness-background));
}

#songSwitcherLeft {
	transform: rotate(90deg);
	margin-left: .5em;
}

#songSwitcherRight {
	transform: rotate(-90deg);
	margin-right: .5em;
}

#songSelect ul {
	list-style-type: none;
	padding: 0;
	margin: 0;
}

.songList:not(:first-of-type) {
	display: none;
}

#songSelect ul li {
	display: inline-flex;
	width: 100%;
	border-top: 2px solid white;
}

#songSelect ul li:last-of-type {
	border-bottom: 2px solid white;
}

#songSelect ul li label {
	display: block;
	padding: .5em;
	width: 100%;
	height: 100%;
	
	transition: background-color .5s;
}

#songSelect ul li label:focus {
	outline: none;
	background-color: rgba(255, 255, 255, .1);
}

#songSelect ul li label:hover {
	background-color: rgba(255, 255, 255, .1);
}

#songSelect ul li input {
	display: none;
}

#songSelect ul li input:checked + label {
	background-color: rgba(255, 255, 255, .25);
}

#songCover {
	min-width: 20vw;
	min-height: 20vw;
	padding: 1.5em;
	margin: auto;
}

#songCoverImg {
	width: 100%;
	height: 100%;
}

#songDetails {
	white-space: pre;
	text-shadow: 1px 1px 2px black;
}

/* elements elsewhere on the page */
#jukeboxLink {
	--banner-height: 7.5em;
	position: absolute;
	right: 4em;
	top: calc(var(--banner-height) * -1);
	width: 3em;
	height: var(--banner-height);
	background-image: url("images/banner.png");
	background-size: contain;
	z-index: 50;
	
	text-align: center;
	
	transition: top .5s;
}

#jukeboxLink:not([data-album=""]) {
	top: var(--header-height);
}

#jukeboxLink label {
	position: absolute;
	left: 50%;
	top: 40%;
	transform: translateX(-50%) translateY(-50%);
	text-shadow: 2px 2px 2px black;
	z-index: 30;
	
	pointer-events: none;
}

#jukeboxLinkButton {
	position: absolute;
	left: -25%;
	top: 10%;
	max-width: 150%;
	width: 150%;
	z-index: 20;
	
	cursor: pointer;
}

/* disable jukebox popup on mobile */
@media (max-width: 680px) {
	#jukeboxLink {
		display: none;
	}
}

/* jukebox control panel */
#miniPlayerTray {
	display: none; /* start disabled, is set to flex by js once the menu appears */
	align-items: center;
	pointer-events: none;
	
	z-index: 500;
}

#playerTrayHider {
	height: 2em;
	width: 2em;
	margin-right: .25em;
	transform: rotate(-90deg);
	transition: margin-right 1.5s, transform .3s;
	
	pointer-events: auto;
}

#miniPlayerTray[data-hidden] #playerTrayHider {
	margin-right: 1.5em;
	transform: rotate(90deg);
}

#jukeboxControls {
	display: flex;
	justify-content: center;
	
	pointer-events: auto;
}

#jukeboxControls::before {
	filter: opacity(90%) brightness(0);
}

#jcSongCoverImg {
	max-width: 5em;
	max-height: 5em;
	margin: .3em;
	
	transition: filter .3s;
}

#jcSongCoverImg:hover, #jcSongCoverImg:focus {
	outline: none;
	
	transition: filter .3s;
	filter: brightness(1.25);
}

#jcControlPanel {
	min-width: 11em;
	margin: .3em;
}

#jcButtonsDiv {
	display: flex;
	justify-content: left;
	align-items: center;
}

#jcButtonsDiv label {
	margin-left: .25em;
	cursor: pointer;
	transition: filter .6s;
}

#jcButtonsDiv input, #jcControlHeader input {
	max-height: 1.2rem;
	min-height: 1.2rem;
	margin-left: .5em;
}

#jcControlHeader {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#jcTopRight {
	display: flex;
}

#jcVolumeSlider {
	display: none; /* enabled by clicking the speaker icon */
	position: absolute;
	font-size: 1em;
	width: 1.5em;
	right: 1.3em;
	top: -.5em;
	height: 0;
	min-height: 0;
	transition: height .1s linear, min-height .1s linear, top .1s linear;
	
	-webkit-appearance: slider-vertical;
}

/* make labels glow when their buttons glow */
#jcButtonsDiv input:focus + label{
	outline: none;
	
	filter: drop-shadow(0px 0px 5px white);
	transition: filter .2s;
}

#jcButtonsDiv input:hover + label{
	filter: drop-shadow(0px 0px 5px white);
	transition: filter .6s;
}

label[for="jcModeBtn"] {
	flex-grow: 1;
}

#jcProgressClickable {
	padding: .8em 0;
}

#jcProgressClickable * {
	pointer-events: none;
}

#jcSongProgress {
	position: relative;
	width: 11em; /* statically 11em so that jukebox.js knows what it is. */
	border: 1px solid white;
}

#jcPlaybackIndicator {
	position: absolute;
	left: 0em;
	transition: left .1s;
	
	vertical-align: middle;
	transform: translate(-50%, -50%);
	
	height: .75em;
}

/* rising music notes */
@keyframes noteRotation {
	from {transform: translate(-50%, -50%) rotate(10deg);}
	to {transform: translate(-50%, -50%) rotate(-10deg);}
}

.musicPlayerNote {
	position: fixed;
	width: 1.5em;
	height: 1.5em;
	z-index: 499;
	animation: noteRotation;
	animation-duration: 1.5s;
	animation-iteration-count: infinite;
	animation-direction: alternate;
	pointer-events: none;
}


/* media query overrides */
@media (orientation: landscape) {
	#songCover {
		display: flex;
	}
	
	#songDetails {
		padding: .2em;
		text-align: left;
	}
	
	#songCoverImg {
		max-height: 50vh;
		max-width: 50vh;
	}
	
	#miniPlayerTray {
		position: fixed;
		bottom: 2em;
		right: -20em;
		transition: right 1.5s;
	}
	
	#miniPlayerTray:not([data-song-index="-1"]) {
		right: 2em;
	}
	
	#miniPlayerTray[data-hidden] {
		right: -18.25em;
	}
}

@media (orientation: portrait) {
	#songDetails {
		font-size: 1.5rem;
		white-space: pre-wrap;
	}
	
	/* undo a lot of the stying jukeboxControls is getting from it's sliceBox class */
	#miniPlayerTray {
		width: 100%;
	}
	
	#playerTrayHider {
		display: none;
	}
	
	#jukeboxControls {
		width: 100%;
		padding: 0;
		padding-top: .1em;
		border-top: 2px solid var(--text-color);
		background-color: var(--background-color);
		color: var(--text-color);
	}
	
	#jukeboxControls a {
		color: var(--link-color);
	}
	
	#jukeboxControls::before, #jukeboxControls::after {
		display: none;
	}
	
	#jcPlaybackIndicator, #jcButtonsDiv input, #jcTopRight input {
		filter: brightness(var(--text-brightness));
	}
	
	#jcSongProgress {
		border-color: var(--text-color);
	}
	
	#jcTopRight {
		margin-right: .25em;
	}
	
	#jcVolumeSlider {
		right: 1.6em;
	}
}