/*
 * Upload and Edit form helpers: live name check, drag-and-drop and file list.
 * Used by index.php and mission_details.php together with /js/upload-form.js.
 */

/* Live mission name check */
.name-status {
	min-height: 1.4em;
	margin-top: 6px;
	font-size: 1.3rem;
	line-height: 1.45;
	word-break: break-all;
}
.name-status .name-url { opacity: .75; margin-right: 8px; }
.name-status .name-url b { opacity: 1; }
.name-status code {
	padding: 0 5px;
	border-radius: 3px;
	font-size: 1.25rem;
	background: rgba(240, 80, 110, .12);
	color: #d6304f;
}
.name-status.is-available .name-msg { color: #1f9e6e; font-weight: 600; }
.name-status.is-taken .name-msg,
.name-status.is-invalid .name-msg,
.name-status.is-too_long .name-msg { color: #d6304f; font-weight: 600; }
.name-status.is-checking .name-msg { opacity: .6; }
[data-theme="dark"] .name-status.is-available .name-msg { color: #4cd9a0; }
[data-theme="dark"] .name-status.is-taken .name-msg,
[data-theme="dark"] .name-status.is-invalid .name-msg,
[data-theme="dark"] .name-status.is-too_long .name-msg,
[data-theme="dark"] .name-status code { color: #ff7a8f; }

/* Drag-and-drop */
.drop-zone-wrap { display: none; }
form.js-upload-form.can-drop .drop-zone-wrap { display: block; }
.drop-zone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 18px 16px;
	border: 2px dashed #c9c9c9;
	border-radius: 8px;
	text-align: center;
	transition: border-color .15s, background-color .15s;
}
.drop-zone-icon { opacity: .6; margin-bottom: 4px; }
.drop-zone-title { font-weight: 600; }
.drop-zone-sub { font-size: 1.3rem; opacity: .7; }
form.js-upload-form.is-dragging .drop-zone {
	border-color: #1e87f0;
	background-color: rgba(30, 135, 240, .08);
}
form.js-upload-form.is-dragging { outline: 2px dashed rgba(30, 135, 240, .35); outline-offset: 8px; border-radius: 8px; }
[data-theme="dark"] .drop-zone { border-color: #3e4446; }
[data-theme="dark"] form.js-upload-form.is-dragging .drop-zone { border-color: #3391ff; background-color: rgba(51, 145, 255, .1); }

.file-summary {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	font-size: 1.35rem;
}
.file-summary:empty { display: none; }
.file-summary li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	padding: 4px 0;
	margin: 0;
}
.file-summary .fs-icon { width: 1em; text-align: center; font-weight: 700; }
.file-summary .fs-name { word-break: break-all; }
.file-summary .fs-size { opacity: .6; font-size: 1.25rem; }
.file-summary .fs-msg { flex-basis: 100%; padding-left: calc(1em + 8px); font-size: 1.3rem; }
.file-summary .is-ok .fs-icon { color: #1f9e6e; }
.file-summary .is-bad .fs-icon,
.file-summary .is-bad .fs-msg,
.file-summary .is-bad .fs-text { color: #d6304f; }
.file-summary .is-note .fs-icon,
.file-summary .is-note .fs-text { color: #b07a00; }
[data-theme="dark"] .file-summary .is-ok .fs-icon { color: #4cd9a0; }
[data-theme="dark"] .file-summary .is-bad .fs-icon,
[data-theme="dark"] .file-summary .is-bad .fs-msg,
[data-theme="dark"] .file-summary .is-bad .fs-text { color: #ff7a8f; }
[data-theme="dark"] .file-summary .is-note .fs-icon,
[data-theme="dark"] .file-summary .is-note .fs-text { color: #f2c97d; }
