:root {
	--player-color-dark-grey: rgba(103, 103, 103, 1);
}

.player img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

/* Player */

.player-block {
	display: flex;
	align-self: center;
	justify-self: center;
	overflow: hidden;
	max-height: 453px;
	border-radius: 0;
	position: fixed;
	bottom: 30px;
	right: 30px;
	font-family: "Oswald", sans-serif;
	background-color: #131414;
}

.player {
	position: relative;
	z-index: 1;
	overflow: hidden;
	padding: 30px;
	max-width: 500px;
	width: 100%;
	background: linear-gradient(
		-65deg,
		rgba(11, 11, 13, 1),
		rgba(18, 18, 19, 1),
		rgba(49, 51, 52, 1)
	);
	border: transparent;
}

.player.open-playlist + .playlist,
.player.open-playlist + .playlist .playlist__content {
	width: 500px;
	opacity: 1;
}

/* Player Playlist */

.playlist {
	width: 0;
	height: 100%;
	transition: all 0.4s;
	overflow: hidden;
}

.playlist__content {
	display: flex;
	flex-direction: column;
	height: 100%;
	gap: 20px;
	padding: 30px;
	opacity: 0;
	transition: all 0.2s;
}

.playlist__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 25px;
}

.playlist__title {
	margin: 0;
	font-size: 1.5rem;
	line-height: 1.5;
	font-weight: 400;
	color: var(--player-color-dark-grey);
	text-transform: uppercase;
}

.playlist__control {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	cursor: pointer;
}

.playlist__content i {
	position: absolute;
	width: 15px;
	height: 3px;
	background-color: var(--player-color-dark-grey);
	transition: 0.3s background-color;
}

.playlist__content i:first-child {
	transform: rotate(-45deg);
}

.playlist__content i:last-child {
	transform: rotate(45deg);
}

.playlist__list {
	display: flex;
	flex-direction: column;
	gap: 5px;
	overflow-y: auto;
	max-height: 310px;
	padding-right: 16px;
}

.playlist__list::-webkit-scrollbar {
	width: 4px;
}

.playlist__list::-webkit-scrollbar-track {
	background-color: transparent;
}

.playlist__list::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.05);
	border-radius: 2px;
}

.playlist__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 10px;
	max-height: 30px;
	border-radius: 6px;
	background-color: transparent;
	cursor: pointer;
	transition: all 0.3s;
	font-family: "Poppins", sans-serif;
}

.playlist__item.current {
	background-color: rgba(255, 255, 255, 0.05);
}

.playlist__song,
.playlist__duration {
	font-size: 0.875rem;
	font-weight: 300;
	line-height: 1.4;
	color: var(--player-color-dark-grey);
}

.playlist__song-name {
	color: #e6e6e6;
}

/* Player Settings */

.player__settings {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;
}

.player__settings input {
	display: none;
}

.player__playlist-btn,
.player__settings-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	border-radius: 50%;
	background-color: transparent;
	cursor: pointer;
	transition: all 0.3s;
}

.player__playlist-btn.active,
.player__settings-btn.active {
	filter: brightness(0) saturate(100%) invert(97%) sepia(100%) saturate(0%)
		hue-rotate(66deg) brightness(105%) contrast(104%);
}

.player__settings-btn.active + .player__settings-block {
	flex: 1;
	max-width: 100%;
}

.player__settings-block {
	display: flex;
	align-items: center;
	overflow: hidden;
	width: 0;
	transition: 0.5s all;
}

.player__autoplay-block {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1.125rem;
	line-height: 1.5;
	font-weight: 400;
}

.player__settings-checkbox {
	position: relative;
	display: flex;
	width: 50px;
	height: 24px;
	transform: translateY(1px);
}

.player__settings-switch {
	position: absolute;
	cursor: pointer;
	inset: 0;
	border-radius: 24px;
	background-color: var(--player-color-dark-grey);
	transition: 0.4s all;
}

.player__settings-switch:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 4px;
	bottom: 4px;
	border-radius: 50%;
	transition: all 0.4s;
	background-color: white;
}

input:checked + .player__settings-switch:before {
	transform: translateX(26px);
}

input:checked + .player__settings-switch {
	background-color: rgb(51, 142, 51);
}

/* Players Bars */

.player__box {
	margin-top: 15px;
}

.player__bars {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 4px;
	width: 100%;
	height: 80px;
	cursor: pointer;
}

.player__bar {
	min-height: 2px;
	width: 8px;
	height: 0;
	max-height: 155px;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.4),
		rgba(255, 255, 255, 0.05)
	);
	transition: height 0.2s ease-out, background 1s ease-out;
	cursor: pointer;
	pointer-events: all;
}

.player__bar.color {
	background: linear-gradient(
		120deg,
		rgba(59, 180, 155, 0.5) 0%,
		rgba(137, 58, 255, 0.5) 53%,
		rgba(253, 134, 241, 0.4) 100%
	);
}

.player__audio {
	display: none;
}

/* Player Controls */

.player__info {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	margin-top: 30px;
}

.player__music-info {
	display: flex;
	flex-direction: column;
}

.player__music-author,
.player__duration {
	font-size: 1rem;
	line-height: 1.5;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.4);
	text-transform: uppercase;
}

.player__music-title {
	margin: 0;
	font-size: 1.3rem;
	line-height: 1.5;
	font-weight: 400;
	color: white;
	text-transform: uppercase;
}

.player__controller {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 25px;
}

.player__controls {
	display: flex;
	align-items: center;
	gap: 44px;
}

.player__next-btn,
.player__prev-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5px;
	border-radius: 50%;
	background-color: transparent;
	cursor: pointer;
	transition: 0.3s all ease-in-out;
}

.player__next-btn.disabled,
.player__prev-btn.disabled {
	filter: brightness(0) saturate(100%) invert(45%) sepia(1%) saturate(914%)
		hue-rotate(318deg) brightness(91%) contrast(101%);
	cursor: default;
	pointer-events: none;
}

.player__pause-icon,
.player__play-icon,
.player__replay-btn img {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 11px;
	border-radius: 50%;
	background-color: transparent;
	cursor: pointer;
	transition: 0.3s all ease-in-out;
}

.player__pause-icon:active,
.player__play-icon:active,
.player__replay-icon:active {
	background-color: rgba(255, 255, 255, 0.05);
}

.player__pause-icon.hidden,
.player__play-icon.hidden,
.player__play-btn.hidden,
.player__replay-btn.hidden {
	display: none;
}

.player__volume-btn {
	position: relative;
	cursor: pointer;
	padding-right: 5px;
	height: 24px;
}

.player__volume-block {
	position: absolute;
	overflow: hidden;
	z-index: 10;
	width: 0;
	bottom: -10px;
	left: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background-color: #414143;
	transition: all 0.3s;
}

.player__volume-block input {
	overflow: hidden;
	margin: 20px;
	width: 100%;
	height: 10px;
	--range: 20%;
	appearance: none;
	outline: none;
	border-radius: 2px;
	background: linear-gradient(
		to right,
		white var(--range),
		rgba(87, 87, 87, 0.46) var(--range)
	);
	cursor: pointer;
}

.player__volume-block input[type="range"]::-webkit-slider-thumb {
	cursor: pointer;
	appearance: none;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.player__volume-icon {
	position: absolute;
	inset: 0;
	opacity: 1;
	width: max-content !important;
	visibility: visible;
	transition: all 0.3s;
}

.player__volume-default.hidden,
.player__volume-high.hidden,
.player__volume-mute.hidden {
	opacity: 0;
	visibility: hidden;
}

.player__volume-btn:hover .player__volume-block {
	width: 180px;
}

.player__random-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: all 0.3s;
}

.player__random-btn.active {
	filter: brightness(0) saturate(100%) invert(97%) sepia(100%) saturate(0%)
		hue-rotate(66deg) brightness(105%) contrast(104%);
}

@media screen and (max-width: 1280px) {
	.player-block {
		flex-direction: column;
		max-height: 100%;
	}

	.player.open-playlist + .playlist,
	.player.open-playlist + .playlist .playlist__content {
		width: 100%;
		height: 450px;
		opacity: 1;
	}

	.playlist__list {
		max-height: none;
	}

	.playlist {
		width: 100%;
		height: 0;
	}
}

@media screen and (max-width: 620px) {
	.player__controls {
		gap: 10px;
	}

	.player__volume-btn {
		width: 40px;
	}
}

@media screen and (max-width: 460px) {
	.player-block {
		border-radius: 20px;
	}

	.player {
		border-radius: 20px;
		padding: 40px 20px 20px;
	}

	.player::before {
		border-radius: 20px;
	}

	.player__settings {
		gap: 10px;
	}

	.playlist__content {
		padding: 20px;
	}

	.playlist__item {
		max-height: 100%;
	}

	.playlist__song {
		display: flex;
		flex-direction: column;
		gap: 5px;
	}
}

@media (hover: hover) and (pointer: fine) {
	.playlist__control:hover i {
		background-color: white;
	}

	.player__pause-icon:hover,
	.player__play-icon:hover,
	.player__replay-icon:hover,
	.player__random-btn:hover,
	.player__next-btn:hover,
	.player__prev-btn:hover {
		background-color: rgba(255, 255, 255, 0.05);
	}

	.player__playlist-btn:hover,
	.player__settings-btn:hover {
		filter: brightness(0) saturate(100%) invert(97%) sepia(100%) saturate(0%)
			hue-rotate(66deg) brightness(105%) contrast(104%);
		background-color: rgba(255, 255, 255, 0.05);
	}

	.playlist__item:hover {
		background-color: rgba(255, 255, 255, 0.05);
	}
}
