/* Media Folder Pro — Admin Styles */

/* Sidebar container */
#mfp-folder-root {
	position: fixed;
	top: 32px; /* WP admin bar */
	left: 160px; /* WP admin menu */
	bottom: 0;
	width: 260px;
	background: #f0f0f1;
	border-right: 1px solid #c3c4c7;
	overflow-y: auto;
	z-index: 99;
	font-size: 13px;
	padding: 0;
	display: flex;
	flex-direction: column;
}

/* Collapsed admin menu */
.folded #mfp-folder-root {
	left: 36px;
}

/* Push main content */
body.upload-php #wpbody {
	margin-left: 260px;
}

/* Toolbar */
.mfp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	border-bottom: 1px solid #c3c4c7;
	background: #fff;
	flex-shrink: 0;
}

.mfp-toolbar__title {
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.mfp-toolbar__btn {
	background: none;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	cursor: pointer;
	color: #2271b1;
	font-size: 16px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
}

.mfp-toolbar__btn:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* All Media link */
.mfp-all-media {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: #1d2327;
	cursor: pointer;
	border-bottom: 1px solid #e0e0e0;
	background: #fff;
	flex-shrink: 0;
	transition: background 0.15s;
}

.mfp-all-media:hover {
	background: #f0f6fc;
}

.mfp-all-media.is-active {
	background: #2271b1;
	color: #fff;
}

.mfp-all-media__icon {
	font-size: 16px;
	width: 20px;
	text-align: center;
}

/* Uncategorized link */
.mfp-uncategorized {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: #787c82;
	cursor: pointer;
	border-bottom: 1px solid #c3c4c7;
	background: #fff;
	flex-shrink: 0;
	transition: background 0.15s;
	font-style: italic;
}

.mfp-uncategorized:hover {
	background: #f0f6fc;
	color: #1d2327;
}

.mfp-uncategorized.is-active {
	background: #2271b1;
	color: #fff;
	font-style: normal;
}

.mfp-uncategorized__icon {
	font-size: 16px;
	width: 20px;
	text-align: center;
}

/* Tree container */
.mfp-tree {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0;
}

.mfp-tree ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mfp-tree ul ul {
	padding-left: 16px;
}

/* Folder item */
.mfp-folder {
	position: relative;
}

.mfp-folder__row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 12px 5px 8px;
	cursor: pointer;
	border-radius: 0;
	transition: background 0.15s;
	user-select: none;
}

.mfp-folder__row:hover {
	background: #f0f6fc;
}

.mfp-folder__row.is-active {
	background: #2271b1;
	color: #fff;
}

.mfp-folder__toggle {
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	color: #787c82;
	flex-shrink: 0;
	transition: transform 0.2s;
}

.mfp-folder__row.is-active .mfp-folder__toggle {
	color: rgba(255, 255, 255, 0.7);
}

.mfp-folder__toggle.is-expanded {
	transform: rotate(90deg);
}

.mfp-folder__toggle.is-leaf {
	visibility: hidden;
}

.mfp-folder__icon {
	font-size: 15px;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}

.mfp-folder__name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 13px;
	line-height: 1.4;
}

.mfp-folder__count {
	font-size: 11px;
	color: #787c82;
	flex-shrink: 0;
}

.mfp-folder__row.is-active .mfp-folder__count {
	color: rgba(255, 255, 255, 0.7);
}

/* Inline rename input */
.mfp-folder__rename-input {
	flex: 1;
	font-size: 13px;
	padding: 1px 4px;
	border: 1px solid #2271b1;
	border-radius: 2px;
	outline: none;
	background: #fff;
	color: #1d2327;
}

/* Children container */
.mfp-folder__children {
	display: none;
}

.mfp-folder__children.is-open {
	display: block;
}

/* Context menu */
.mfp-context-menu {
	position: fixed;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	min-width: 160px;
	padding: 4px 0;
}

.mfp-context-menu__item {
	display: block;
	width: 100%;
	padding: 6px 12px;
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: #1d2327;
	transition: background 0.1s;
}

.mfp-context-menu__item:hover {
	background: #2271b1;
	color: #fff;
}

.mfp-context-menu__item--danger {
	color: #d63638;
}

.mfp-context-menu__item--danger:hover {
	background: #d63638;
	color: #fff;
}

.mfp-context-menu__separator {
	height: 1px;
	background: #e0e0e0;
	margin: 4px 0;
}

/* Empty state */
.mfp-empty {
	padding: 30px 16px;
	text-align: center;
	color: #787c82;
}

.mfp-empty__icon {
	font-size: 36px;
	margin-bottom: 8px;
}

.mfp-empty__text {
	font-size: 13px;
	margin-bottom: 12px;
}

.mfp-empty__cta {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 3px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s;
}

.mfp-empty__cta:hover {
	background: #135e96;
}

/* Loading spinner */
.mfp-loading {
	padding: 30px 12px;
	text-align: center;
}

.mfp-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid #c3c4c7;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: mfp-spin 0.6s linear infinite;
}

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

/* Modal folder filter dropdown */
.mfp-modal-filter-wrap {
	float: left;
	margin-right: 8px;
	margin-top: 10px;
}

.mfp-modal-filter {
	min-width: 220px;
	max-width: 400px;
	width: auto;
	height: 32px;
	font-size: 13px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	color: #1d2327;
	padding: 0 24px 0 8px;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23787c82'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	text-overflow: ellipsis;
}

.mfp-modal-filter:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

/* Folder select on Upload tab */
.mfp-upload-folder-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	background: #f0f6fc;
	border-bottom: 1px solid #c3c4c7;
}

.mfp-upload-folder-label {
	font-size: 13px;
	color: #1d2327;
	font-weight: 500;
	white-space: nowrap;
}

/* Drag & drop — media on folder (blue) */
.mfp-drop-target {
	background: #f0f6fc !important;
	outline: 2px dashed #2271b1;
	outline-offset: -2px;
}

.mfp-dragging .mfp-folder__row {
	transition: background 0.1s;
}

.mfp-dragging .mfp-folder__row:hover {
	background: #e8f0fe;
}

body.upload-php .attachments .attachment[draggable="true"] {
	cursor: grab;
}

body.upload-php .attachments .attachment[draggable="true"]:active {
	cursor: grabbing;
}

/* Drag & drop — folder on folder (yellow/amber) */
.mfp-folder-drop-target {
	background: #fef3cd !important;
	outline: 2px dashed #dba617;
	outline-offset: -2px;
}

.mfp-dragging-folder .mfp-folder__row {
	transition: background 0.1s;
}

.mfp-dragging-folder .mfp-folder__row:hover {
	background: #fef9e7;
}

/* Tree drop zone for root-level drop */
.mfp-tree-drop-target {
	background: #fef9e7;
	outline: 2px dashed #dba617;
	outline-offset: -4px;
}

/* Bulk assign button */
.mfp-bulk-btn {
	margin-left: 8px !important;
	margin-top: 10px !important;
}

/* Bulk assign dropdown */
.mfp-bulk-dropdown {
	position: fixed;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1001;
	min-width: 200px;
	max-width: 280px;
	max-height: 300px;
	overflow-y: auto;
	padding: 4px 0;
}

.mfp-bulk-dropdown__item {
	display: block;
	width: 100%;
	padding: 6px 12px;
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: #1d2327;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background 0.1s;
}

.mfp-bulk-dropdown__item:hover {
	background: #2271b1;
	color: #fff;
}

.mfp-bulk-dropdown__item--remove {
	color: #787c82;
	font-style: italic;
}

.mfp-bulk-dropdown__item--remove:hover {
	background: #787c82;
	color: #fff;
}

/* Toast notifications */
.mfp-toast {
	position: fixed;
	top: 50px;
	right: 20px;
	z-index: 100001;
	padding: 10px 18px;
	border-radius: 4px;
	font-size: 13px;
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	transform: translateX(120%);
	transition: transform 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	max-width: 320px;
	pointer-events: none;
}

.mfp-toast.is-visible {
	transform: translateX(0);
	opacity: 1;
}

.mfp-toast--success {
	background: #00a32a;
}

.mfp-toast--error {
	background: #d63638;
}

.mfp-toast--info {
	background: #2271b1;
}

/* Responsive: hide on small screens */
@media screen and (max-width: 782px) {
	#mfp-folder-root {
		display: none;
	}

	body.upload-php #wpbody {
		margin-left: 0;
	}
}
