/* Smart Media Cleanup — Media Folders panel */

/* ---- Layout: inject panel left of the attachments grid ---- */
.smc-has-folders .media-frame-content {
	display: flex;
	flex-direction: row;
	overflow: hidden;
}

.smc-has-folders .media-frame-content .attachments-browser {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
}

#smc-folders-panel {
	width: 190px;
	min-width: 150px;
	flex-shrink: 0;
	background: #f6f7f7;
	border-right: 1px solid #dcdcde;
	overflow-y: auto;
	font-size: 13px;
	line-height: 1.4;
}

/* ---- Header ---- */
.smc-folders-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px;
	background: #fff;
	border-bottom: 1px solid #dcdcde;
	position: sticky;
	top: 0;
	z-index: 1;
}

.smc-folders-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #646970;
}

.smc-btn-add-root {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #2271b1;
	padding: 0;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.smc-btn-add-root:hover {
	color: #135e96;
}

/* ---- Search ---- */
.smc-folder-search-wrap {
	padding: 6px 8px;
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
	position: sticky;
	top: 38px;
	z-index: 1;
}

.smc-folder-search {
	width: 100%;
	box-sizing: border-box;
	padding: 4px 8px;
	font-size: 12px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	color: #3c434a;
	line-height: 1.4;
}

.smc-folder-search:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

/* ---- Folder list ---- */
.smc-folder-list,
.smc-folder-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.smc-folder-children {
	display: none;
	padding-left: 14px;
}

.smc-folder-item.open > .smc-folder-children {
	display: block;
}

.smc-folder-item {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	padding: 5px 10px;
	cursor: pointer;
	color: #3c434a;
	position: relative;
	border-bottom: 1px solid transparent;
	user-select: none;
}

.smc-folder-item:hover {
	background: #e8f0fb;
}

.smc-folder-item.smc-active {
	background: #2271b1;
	color: #fff;
}

.smc-folder-item.smc-active .smc-folder-count {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

/* ---- Toggle arrow ---- */
.smc-toggle-wrap {
	width: 14px;
	flex-shrink: 0;
	margin-right: 2px;
}

.smc-toggle {
	font-size: 10px !important;
	width: 14px !important;
	height: 14px !important;
	color: inherit;
	transition: transform 0.15s;
	cursor: pointer;
	display: block;
}

.smc-folder-item.open > .smc-toggle,
.smc-folder-item.open > * .smc-toggle {
	transform: rotate(90deg);
}

/* ---- Icon ---- */
.smc-folder-icon {
	font-size: 15px !important;
	width: 15px !important;
	height: 15px !important;
	margin-right: 5px;
	flex-shrink: 0;
	color: inherit;
}

/* ---- Name ---- */
.smc-folder-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
}

/* ---- Count badge ---- */
.smc-folder-count {
	font-size: 10px;
	background: #dcdcde;
	color: #646970;
	padding: 1px 5px;
	border-radius: 9px;
	margin-left: 4px;
	flex-shrink: 0;
}

/* ---- Rename / Delete buttons (visible on hover) ---- */
.smc-folder-actions {
	display: none;
	margin-left: 3px;
	flex-shrink: 0;
	gap: 1px;
}

.smc-folder-item:hover .smc-folder-actions,
.smc-folder-item.smc-active .smc-folder-actions {
	display: flex;
}

.smc-btn-rename,
.smc-btn-delete {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 3px;
	font-size: 13px;
	color: inherit;
	opacity: 0.65;
	line-height: 1;
}

.smc-btn-rename:hover,
.smc-btn-delete:hover {
	opacity: 1;
}

.smc-btn-delete:hover {
	color: #cc1818;
}

/* ---- Children container spans full width ---- */
.smc-folder-item > .smc-folder-children {
	width: 100%;
	flex-basis: 100%;
	padding-left: 16px;
}

/* ---- Drag & drop ---- */
.attachment[draggable="true"] {
	cursor: grab;
}

.attachment.smc-dragging {
	opacity: 0.4;
}

.smc-folder-item.smc-drag-over {
	background: #dce7f8 !important;
	outline: 2px dashed #2271b1;
	outline-offset: -2px;
	color: #2271b1 !important;
}

/* Hide WordPress's "Drop files to upload" overlay while dragging an attachment.
   !important is required because WordPress shows it via jQuery .show() (inline style). */
body.smc-attachment-dragging .uploader-window {
	display: none !important;
}

/* ---- Bulk assign bar ---- */
#smc-bulk-bar {
	position: sticky;
	bottom: 0;
	background: #2271b1;
	color: #fff;
	padding: 10px 12px;
	font-size: 12px;
	line-height: 1.5;
	border-top: 2px solid #135e96;
}

#smc-bulk-bar strong {
	display: block;
	font-size: 13px;
}

.smc-bulk-hint {
	opacity: 0.85;
	font-size: 11px;
}

/* Signal to the user that folders are now drop targets for the selection */
body.smc-has-selection #smc-folders-panel .smc-folder-item:not([data-id="0"]) {
	cursor: copy;
}

body.smc-has-selection #smc-folders-panel .smc-folder-item:not([data-id="0"]):hover {
	background: #dce7f8;
	color: #2271b1;
	outline: 2px dashed #2271b1;
	outline-offset: -2px;
}

/* ---- Modal dialog ---- */
#smc-folder-modal {
	position: fixed;
	inset: 0;
	z-index: 100100;
}

.smc-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.smc-modal-box {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 4px;
	padding: 20px 24px;
	min-width: 300px;
	max-width: 400px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.smc-modal-box h3 {
	margin: 0 0 10px;
	font-size: 16px;
}

.smc-modal-box #smc-modal-message {
	color: #646970;
	margin: 0 0 12px;
}

.smc-modal-box .regular-text {
	width: 100%;
	margin-bottom: 12px;
}

.smc-modal-actions {
	margin: 0;
	display: flex;
	gap: 8px;
}
