/* ═══════════════════════════════════════════════════════════
   Composant Dropzone — Styles
   ═══════════════════════════════════════════════════════════ */

.dz-container {
	position: relative;
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	box-sizing: border-box;
}

.dz-container *,
.dz-container *::before,
.dz-container *::after {
	box-sizing: inherit;
}

/* ── Zone principale (drag & drop) ── */

.dz-area {
	border: 2px dashed #c0c8d0;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	cursor: pointer;
	background: #fafbfc;
	outline: none;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
	will-change: border-color, background-color;
}

.dz-area:hover,
.dz-area:focus-visible {
	border-color: #4a90d9;
	background: #f0f6ff;
	box-shadow: 0 0 0 3px rgba(74, 144, 217, .1);
}

.dz-area.dz-drag-over {
	border-color: #2d6bbf;
	background: #e8f0fe;
	border-style: solid;
	box-shadow: 0 0 0 4px rgba(45, 107, 191, .15);
}

.dz-area.dz-full {
	opacity: .5;
	pointer-events: none;
}

/* ── Icône upload ── */

.dz-icon {
	width: 40px;
	height: 40px;
	color: #8899aa;
	margin: 0 auto 8px;
	display: block;
	transition: color 150ms ease, transform 150ms ease;
}

.dz-area:hover .dz-icon {
	color: #4a90d9;
	transform: translateY(-2px);
}

.dz-area.dz-drag-over .dz-icon {
	color: #2d6bbf;
	transform: translateY(-4px);
}

/* ── Textes ── */

.dz-text-main {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 500;
	color: #3a4550;
}

/* ── Input fichier caché ── */

.dz-input {
	display: none !important;
}

/* ── Barre d'informations ── */

.dz-info {
	display: flex;
	gap: 16px;
	padding: 8px 4px;
	font-size: 12px;
	color: #8899aa;
	flex-wrap: wrap;
}

/* ── Liste de fichiers ── */

.dz-file-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.dz-file-item {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	padding: 10px 12px;
	margin-bottom: 4px;
	border-radius: 6px;
	background: #f5f7f9;
	border: 1px solid #e2e6ea;
	animation: dzSlideIn 200ms ease both;
	transition: background-color 200ms ease, border-color 200ms ease;
}

.dz-file-item.dz-status-error {
	background: #fef2f2;
	border-color: #f5c6c6;
}

.dz-file-item.dz-status-success {
	background: #f0faf0;
	border-color: #b8e6b8;
}

.dz-file-item.dz-status-uploading {
	background: #f0f6ff;
	border-color: #a8c8f0;
	animation: dzPulse 1.5s ease-in-out infinite;
}

.dz-status-uploading .dz-progress {
	height: 6px;
}

.dz-status-uploading .dz-progress-bar {
	background: linear-gradient(
		90deg,
		#4a90d9 0%,
		#6ba8ef 50%,
		#4a90d9 100%
	);
	background-size: 200% 100%;
	animation: dzShimmer 1.2s ease-in-out infinite;
}

.dz-status-uploading .dz-file-status {
	opacity: 1;
	color: #4a90d9;
	animation: none;
}

.dz-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #a8c8f0;
	border-top-color: #4a90d9;
	border-radius: 50%;
	animation: dzSpin .7s linear infinite;
}

/* ── Infos fichier (nom + taille) ── */

.dz-file-info {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
}

.dz-file-name {
	font-weight: 500;
	color: #3a4550;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.dz-file-size {
	font-size: 12px;
	color: #8899aa;
	white-space: nowrap;
}

/* ── Bloc droit (statut + supprimer) ── */

.dz-file-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	margin-left: auto;
	padding-left: 12px;
}

/* ── Barre de progression ── */

.dz-progress {
	flex-basis: 100%;
	height: 4px;
	background: #e2e6ea;
	border-radius: 2px;
	margin-top: 6px;
	overflow: hidden;
}

.dz-progress-bar {
	height: 100%;
	background: #4a90d9;
	border-radius: 2px;
	transition: width 200ms cubic-bezier(.4, 0, .2, 1);
	will-change: width;
}

.dz-status-success .dz-progress-bar {
	background: #48b868;
}

.dz-status-error .dz-progress-bar {
	background: #e05555;
}

/* ── Message de statut ── */

.dz-file-status {
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	animation: dzFadeIn 200ms ease 100ms forwards;
}

.dz-file-status:empty {
	display: none;
}

.dz-file-status.dz-error {
	color: #d14040;
	white-space: normal;
	word-break: break-word;
	flex-basis: 100%;
	order: 10;
	margin-top: 4px;
	margin-bottom: 4px;
}

.dz-file-status.dz-success {
	color: #2d8a4e;
	font-weight: 600;
}

@media (max-width: 480px) {
	.dz-file-item {
		padding: 8px 10px;
	}

	.dz-file-info {
		flex-wrap: wrap;
	}

	.dz-file-size {
		display: none;
	}
}

/* ── Bouton télécharger ── */

.dz-btn-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: none;
	color: #8899aa;
	cursor: pointer;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
	text-decoration: none;
}

.dz-btn-download:hover {
	background: #e8f0fe;
	color: #4a90d9;
	transform: scale(1.1);
}

.dz-btn-download:active {
	transform: scale(.95);
}

/* ── Bouton supprimer ── */

.dz-btn-delete {
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: none;
	font-size: 18px;
	line-height: 24px;
	color: #8899aa;
	cursor: pointer;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.dz-btn-delete:hover {
	background: #fde8e8;
	color: #d14040;
	transform: scale(1.1);
}

.dz-btn-delete:active {
	transform: scale(.95);
}

.dz-btn-delete:disabled {
	opacity: .4;
	cursor: not-allowed;
}

/* ── Toast notification ── */

.dz-toast {
	margin-top: 8px;
	padding: 8px 12px;
	font-size: 13px;
	color: #d14040;
	background: #fef2f2;
	border: 1px solid #f5c6c6;
	border-radius: 6px;
	text-align: center;
	animation: dzSlideIn 200ms ease both;
}

.dz-toast-hide {
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 200ms ease, transform 200ms ease;
}

/* ── Keyframes ── */

@keyframes dzFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes dzSlideIn {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes dzPulse {
	0%, 100% { background-color: #f0f6ff; }
	50%      { background-color: #e0eeff; }
}

@keyframes dzShimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

@keyframes dzSpin {
	to { transform: rotate(360deg); }
}
