.file-upload {
	height: 0;
	opacity: 0;
}

.file-upload.state-on {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 200px max-content;
	align-items: start;
	height: max-content;
	opacity: 1;
	interpolate-size: allow-keywords;
	transition: height .5s ease-in-out, opacity .25s .5s ease-in-out;
}

.file-upload.state-file-drop-on {
	grid-template-rows: 200px max-content;
}

.file-upload.state-file-list-on {
	grid-template-rows: max-content;
}

.file-upload.state-file-drop-on.state-file-list-on {
	grid-template-rows: 200px max-content max-content;
}

.file-drop {
	display: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border: 2px dashed #ccc;
	text-align: center;
	cursor: pointer;
}

.file-drop.dragging {
	border-color: #008a9c;
	background-color: #dceded;
}

.file-upload.state-file-drop-on input[type=file] {
	display: none;
}

.file-upload.state-file-drop-on .file-drop {
	display: flex;
}

.file-upload .list {
	display: none;
}

.file-upload.state-file-list-on .list {
	display: block;
}

.list {
	padding: 8px 0;
}

.list-item {
	position: relative;
	display: grid;
	grid-template-columns: 16px 24px 16px 1fr 16px auto 16px;
	grid-template-rows: 8px minmax(40px,auto) 8px;
	margin: .25rem 0;
	padding: 0 .5rem;
	place-items: center;
}
.list-item :first-child {
	grid-area: 2 / 2 / 3 / 3;
}
.list-item :nth-child(2) {
	grid-area: 2 / 4 / 3 / 5;
	justify-self: start;
}
.list-item :nth-child(3) {
	grid-area: 2 / 6 / 3 / 7;
	font-size: .75rem;
}
.list-item.state-uploading {
	border-radius: 4rem;
	background-color: #eee;
	background-image: linear-gradient(to right,#9cf,#69f);
	background-repeat: no-repeat;
	background-size: calc(var(--progress, 0)* 1%) 100%;
	transition: background-size .4s;
	overflow: hidden;
}
.list-item:hover :nth-child(3) {
	position: relative;
	visibility: hidden;
}
.list-item:hover .list-item-filesize::after {
	content: 'Remove';
	display: block;
	position: absolute;
	top: 0;
	right: 0;
	padding: .35rem;
	border-radius: 5px;
	color: #fff;
	background-color: #c00;
	visibility: visible;
	text-align: right;
	line-height: 1;
	cursor: pointer;
	transition: all .2s ease-in-out;
	z-index: 1;
}
.list-item:hover .list-item-filesize:hover::after {
	background-color: #f31919;
	box-shadow: 5px 6px 13px #00000021;
}

.list-item[data-pending]:hover .list-item-filesize::after {
	content: 'Exclude';
}

.list-item[data-pending]:hover .list-item-filesize::after {
	content: 'Exclude';
}

.list-item.state-exclude[data-pending]:hover .list-item-filesize::after {
	content: 'Include';
	background-color: #00b40f;
}

.list-item.state-exclude[data-pending]:hover .list-item-filesize:hover::after {
	background-color: #00c410;
}

.list-item[data-pending] :nth-child(2)::after {
	content: '\2713  Uploaded';
	display: inline-block;
	margin-inline-start: 1rem;
	color: #090;
	font-weight: bold;
	opacity: 0;
	transform: translateX(4rem);
	animation: slide-in 1s ease-out forwards;
}

@keyframes slide-in {
	to {
		opacity: 1;
		transform: translateX(0);
	}
}
.list-item.state-exclude[data-pending]::after {
	content: '';
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #fffc;
}

.list-item.state-uploading::before {
	content: '';
	display: block;
	position: absolute;
	top: 0;
	left: 0; /* Start the shine off-screen to the left */
	width: 100%;
	height: 100%;
	background-image: linear-gradient(105deg, transparent 100px, #fff6 164px, transparent 228px, transparent 100%);
	background-size: 200%;
	transform: translateX(calc((var(--progress, 0) - 100) * 1%));
	animation: shine 3s infinite linear;
}

@keyframes shine {
	0% {
		background-position-x: 71%;
	}
	100% {
		background-position-x: -181%;
	}
}

.list-file:empty {
	position: relative;
	height: 80px;
}
.list-file:empty::before {
	content: 'No files added yet.';
	display: block;
	margin: 4px 0;
	padding: .75rem;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	color: #999;
	font-style: italic;
	text-align: center;
}

.list-item-name-link {
	color: inherit;
	text-decoration: none;
}
.list-item-name-link:hover {
	text-decoration: underline;
	color: #008a9c;
}
