/*
 * ffplayer-unified.css: the look of the Fractal Fantasy player bar (see ffplayer-unified.js).
 *
 * The element ids are the ones the old players used, so a page's own overrides keep working
 * (e.g. `#timeline { background: #333333; }` for the progress colour, which is blue by default).
 */

/* ----- bar ----- */

#audioplayer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 61px;
	overflow: hidden;
	background-color: black;
	font-family: Avenir, Helvetica, Arial, sans-serif;
	z-index: 2;
	touch-action: none; /* dragging along the bar scrubs */
}

/* progress: grows from the left edge of the credits */
#timeline {
	position: absolute;
	left: 60px;
	top: 0;
	width: 0;
	height: 60px;
	background: blue;
	cursor: pointer;
}

.ffplayer-playlist #timeline { left: 90px; }
.ffplayer-titles #timeline { display: none; }

#playhead { display: none; }

/* ----- buttons ----- */

#pButton {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 60px;
	height: 60px;
	padding: 15px;
	border: none;
	outline: none;
	background-color: black;
	background-size: 30px 30px;
	background-repeat: no-repeat;
	background-position: center;
	cursor: pointer;
	z-index: 100000000;
}

#pButton.play { background-image: url('img/play.png'); }
#pButton.pause { background-image: url('img/pause.png'); }
#pButton.loadingbutton { background-image: url('img/loading.gif'); }

.next {
	display: block;
	position: fixed;
	left: 45px;
	bottom: 0;
	width: 45px;
	height: 60px;
	border: none;
	outline: none;
	background: black url('img/fwd.svg') no-repeat center;
	cursor: pointer;
	z-index: 100;
}

#pButton:hover, .next:hover { opacity: 0.7; }
#pButton:active, .next:active { opacity: 0.2; }

/* the button images, fetched up front so the first switch doesn't flicker */
.ffplayer::after {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	opacity: 0;
	z-index: -1;
	content: url('img/pause.png') url('img/loading.gif') url('img/play.png');
}

/* ----- credits ----- */

#credits {
	position: absolute;
	left: 60px;
	bottom: 0;
	height: 60px;
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.7);
	z-index: 100;
	pointer-events: none;
}

.ffplayer-playlist #credits { left: 90px; }
.ffplayer-titles #credits { left: 10px; }

#credits a { pointer-events: auto; }

.ffplayer-titles #credits li { line-height: 14px; }

.left {
	float: left;
	margin-left: 15px;
}

#credits li {
	display: table-cell;
	vertical-align: middle;
	height: 60px;
	width: 100vw;
	font-size: 8px;
	user-select: none;
	-webkit-user-select: none;
}

#credits a:link, #credits a:visited {
	text-decoration: none;
	color: rgba(255, 255, 255, 0.7);
}

#credits a:hover { text-decoration: underline; }

#titleContainer {
	display: inline-block;
	width: 200px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis; /* long titles are cut off */
	vertical-align: top;
	user-select: none;
	-webkit-user-select: none;
}

#trackTitle { white-space: nowrap; }

/* ----- icons on the right ----- */

#icons {
	position: fixed;
	right: 0;
	bottom: 0;
	z-index: 10000000;
}

#icons.empty { display: none; }

#volumeContainer {
	float: right;
	box-sizing: border-box;
	height: 61px; /* the bar's height, so the divider runs its full height */
	display: flex;
	align-items: center;
	padding-left: 16px;
	padding-right: 17px;
	border-left: solid 1px #282828;
	background-color: black;
	cursor: pointer;
	user-select: none;
}

.download-button,
.embed-button,
.volume-button {
	float: left;
	width: 25px;
	height: 25px;
	margin: 0 2px;
}

.download-icn,
.embed-icn,
.volume-icn {
	display: block;
	width: 100%;
	height: auto;
	cursor: pointer;
}

.download-button:hover,
.embed-button:hover,
.volume-button:hover { opacity: 0.7; }

/* share panel, slides out from the right */
.container-share-embed {
	position: fixed;
	bottom: 0;
	right: -120px;
	width: 0;
	height: 60px;
	background-color: #282828;
	color: #fff;
	z-index: -1;
	transition: all .3s ease-out 0s;
}

.container-share-embed.show {
	right: 0;
	width: 90%;
	padding-right: 120px;
}

.block-embed {
	display: block;
	float: none;
	padding: 10px;
}

/* ----- phones ----- */

@media (max-width: 420px) {
	#icons { display: none; }
}

@media (max-width: 300px) {
	#credits { display: none; }
}

/* ----- "tap for sound": only while the browser holds the sound back ----- */

.ffplayer-tap-note {
	display: none;
	position: fixed;
	left: 50%;
	bottom: 72px;
	transform: translateX( -50% );
	padding: 5px 12px;
	border-radius: 12px;
	background: rgba( 0, 0, 0, 0.55 );
	color: #ddd;
	font: 12px Avenir, Helvetica, Arial, sans-serif;
	letter-spacing: 0.05em;
	pointer-events: none;
	z-index: 3;
}

.ffplayer-needs-tap .ffplayer-tap-note, .ffplayer-page-note { display: block; }
