// Questo file fa parte di MyTown.
// MyTown è software libero: puoi ridistribuirlo e/o modificarlo secondo
// i termini della GNU Affero General Public License come pubblicata dalla
// Free Software Foundation, versione 3.
// Distribuito senza ALCUNA GARANZIA; vedi la GNU AGPL v3 per i dettagli.
// Copyright (C) Kondor Consulting & Services S.r.l.
// SPDX-License-Identifier: AGPL-3.0-or-later

.wf-content {
	--background: #f4f5f8;
}

.wf-header {
	padding: 16px 16px 4px;

	h2 {
		margin: 0;
		font-size: 18px;
		font-weight: 700;
		color: #1f2430;
	}
}

.wf-timeline {
	padding: 12px 16px 32px;
}

.wf-step {
	position: relative;
	display: flex;
	gap: 14px;
	padding-bottom: 18px;

	// linea verticale che connette i marker
	&:not(.is-last) .wf-step-marker::after {
		content: '';
		position: absolute;
		top: 24px;
		bottom: 0;
		left: 11px;
		width: 2px;
		background: #d7dbe2;
	}
}

.wf-step-marker {
	position: relative;
	flex: 0 0 auto;

	ion-icon {
		font-size: 24px;
		color: #c2c7d0;

		&.done {
			color: var(--ion-color-success, #2dd36f);
		}
	}
}

.wf-step-body {
	flex: 1;
	min-width: 0;
	background: #fff;
	border-radius: 12px;
	padding: 12px 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wf-step-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	cursor: pointer;

	h3 {
		margin: 0;
		font-size: 15px;
		font-weight: 600;
		color: #1f2430;
	}
}

.wf-step-head-main {
	flex: 1;
	min-width: 0;
}

.wf-toggle {
	color: #9aa0ab;
	font-size: 18px;
	flex: 0 0 auto;
}

.wf-step-detail {
	margin-top: 10px;
	border-top: 1px solid #eef0f3;
	padding-top: 10px;
}

.wf-field-files {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wf-badge {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	background: #fff3cd;
	color: #946200;

	&.done {
		background: #d8f5e3;
		color: #1a7f43;
	}
}

.wf-date {
	font-size: 12px;
	color: #9aa0ab;
}

.wf-step-desc {
	margin: 6px 0 0;
	font-size: 13px;
	color: #6b7280;
}

.wf-snapshot {
	margin-top: 10px;
	border-top: 1px solid #eef0f3;
	padding-top: 10px;

	h4 {
		margin: 0 0 8px;
		font-size: 13px;
		font-weight: 700;
		color: #3b4252;
	}
}

// nota / istruzioni: chiusa di default, si apre cliccando l'icona
.wf-note {
	background: #eef4ff;
	border: 1px solid #d6e4ff;
	border-radius: 8px;
	padding: 6px 10px;
	margin: 6px 0;
}

.wf-note-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	background: transparent;
	border: none;
	padding: 4px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ion-color-primary, #3880ff);

	ion-icon {
		font-size: 18px;
	}

	.wf-note-title {
		flex: 1;
		text-align: left;
	}

	.wf-note-caret {
		font-size: 16px;
		color: #9aa0ab;
	}
}

.wf-note-text {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	color: #2b3445;
	white-space: pre-line;
	line-height: 1.4;
}

.wf-field {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 3px 0;
	font-size: 13px;

	.wf-field-label {
		color: #8a8f99;
	}

	.wf-field-value {
		color: #1f2430;
		font-weight: 500;
		text-align: right;
	}
}

.wf-file {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-top: 8px;
	padding: 8px 10px;
	border: 1px solid #e5e8ec;
	border-radius: 8px;
	background: #f8f9fb;
	font-size: 13px;
	color: #1f2430;

	icon {
		font-size: 18px;
	}

	span {
		flex: 1;
		text-align: left;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	ion-icon {
		color: var(--ion-color-primary, #3880ff);
		font-size: 18px;
	}
}

.wf-empty {
	text-align: center;
	color: #9aa0ab;
	padding: 48px 16px;

	ion-icon {
		font-size: 48px;
		margin-bottom: 8px;
	}
}

.wf-loading {
	display: flex;
	justify-content: center;
	padding: 32px;
}
