/* Shared panel UI: toasts, confirm dialog, busy buttons, empty states. */

#mwm-toasts {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 360px;
	max-width: calc(100vw - 40px);
}

.mwm-toast {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	border-radius: 10px;
	border-left: 4px solid;
	background: #fff;
	color: #2c2c2c;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	animation: mwm-toast-in 0.2s ease-out;
}
.mwm-toast > i { margin-top: 2px; font-size: 16px; }
.mwm-toast-text { flex: 1; word-break: break-word; }
.mwm-toast button {
	border: 0;
	background: none;
	color: #888;
	font-size: 18px;
	line-height: 1;
	padding: 0 2px;
	cursor: pointer;
}
.mwm-toast-success { border-color: #1f9d55; }
.mwm-toast-success > i { color: #1f9d55; }
.mwm-toast-error { border-color: #d92d20; }
.mwm-toast-error > i { color: #d92d20; }
.mwm-toast-info { border-color: #2e8fff; }
.mwm-toast-info > i { color: #2e8fff; }
.mwm-toast-out { opacity: 0; transform: translateX(16px); transition: all 0.2s; }

@keyframes mwm-toast-in {
	from { opacity: 0; transform: translateX(16px); }
	to { opacity: 1; transform: none; }
}

.mwm-dialog-overlay {
	position: fixed;
	inset: 0;
	z-index: 2100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.45);
}
.mwm-dialog {
	width: 420px;
	max-width: 100%;
	padding: 24px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}
.mwm-dialog h5 { margin-bottom: 8px; font-size: 18px; }
.mwm-dialog p { margin-bottom: 20px; color: #555; white-space: pre-line; }
.mwm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.mwm-busy { position: relative; color: transparent !important; pointer-events: none; }
.mwm-busy::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid #fff;
	border-right-color: transparent;
	border-radius: 50%;
	animation: mwm-spin 0.7s linear infinite;
}
.btn-light.mwm-busy::after, .btn-secondary.mwm-busy::after { border-color: #666; border-right-color: transparent; }

@keyframes mwm-spin { to { transform: rotate(360deg); } }

.mwm-loading { padding: 48px 0; text-align: center; color: #888; }
.mwm-loading::before {
	content: "";
	display: block;
	width: 28px;
	height: 28px;
	margin: 0 auto 12px;
	border: 3px solid #d7dde5;
	border-right-color: transparent;
	border-radius: 50%;
	animation: mwm-spin 0.7s linear infinite;
}

.mwm-empty {
	padding: 56px 20px;
	border: 1px dashed #d7dde5;
	border-radius: 12px;
	background: #fff;
	text-align: center;
}
.mwm-empty > i { display: block; margin-bottom: 14px; font-size: 34px; color: #9fb4c9; }
.mwm-empty h5 { margin-bottom: 6px; }
.mwm-empty p { max-width: 420px; margin: 0 auto 18px; color: #777; }

.mwm-media-name {
	margin: 10px 0 0;
	font-size: 12px;
	color: #666;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mwm-upload-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.mwm-upload-bar .btn { position: relative; overflow: hidden; }
.mwm-storage { color: #666; font-size: 14px; }

@media (max-width: 575px) {
	#mwm-toasts { top: 10px; right: 10px; left: 10px; width: auto; max-width: none; }
}
