/*----------------------------------------*/
/*  Enhanced Drag & Drop Styles
/*  Polished, consistent UX for nestable
/*  drag-and-drop reordering.
/*----------------------------------------*/

// ===== CSS Custom Properties =====
:root {
	--ezd-drag-handle-color: #b0b5bd;
	--ezd-drag-handle-hover-color: #4c4cf1;
	--ezd-drag-active-bg: rgba(76, 76, 241, 0.06);
	--ezd-drag-placeholder-bg: rgba(76, 76, 241, 0.06);
	--ezd-drag-placeholder-border: rgba(76, 76, 241, 0.45);
	--ezd-drag-ghost-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(76, 76, 241, 0.25);
	--ezd-drag-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}



// ==========================================================
//  SAVE INDICATOR – Toast after reorder
// ==========================================================
.ezd-save-indicator {
	position: fixed;
	top: 46px;
	right: 20px;
	background: linear-gradient(135deg, #2db22d 0%, #27a027 100%);
	color: #fff;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 4px 16px rgba(45, 178, 45, 0.3);
	z-index: 100000;
	display: none;
	align-items: center;
	gap: 8px;

	&.is-visible {
		display: flex;
		animation: ezd-save-slide-in 0.3s ease forwards;
	}

	&.is-hiding {
		animation: ezd-save-slide-out 0.3s ease forwards;
	}

	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
	}
}

@keyframes ezd-save-slide-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ezd-save-slide-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-10px);
	}
}

// ==========================================================
//  PARENT DOCS SIDEBAR – Drag Enhancement
// ==========================================================
.parent-nestable {
	.easydocs-navitem {
		transition: var(--ezd-drag-transition);
	}

	// Drag handle in sidebar – enhanced hover.
	.dd-handle {

		.dd-handle-icon {
			color: rgba(255, 255, 255, 0.5);
			transition: color 0.2s ease, transform 0.2s ease;
		}

		&:hover .dd-handle-icon {
			color: #fff;
			transform: scale(1.15);
		}
	}

	// Placeholder in sidebar
	.dd-placeholder {
		background: rgba(76, 76, 241, 0.2) !important;
		border-color: rgba(76, 76, 241, 0.6) !important;
		border-radius: 4px;
		height: 50px !important;
		margin: 4px 0 !important;

		&::before {
			display: none;
		}
	}

	// Dragging item in sidebar.
	.dd-dragel {
		.easydocs-navitem {
			background: #1e1f3a !important;
			border-radius: 8px;
			box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
			border-left-color: var(--clr-blue, #4c4cf1);
		}
	}
}



// ===== Toolbar Actions =====
.ezd-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

// ===== Toggle Expand/Collapse Button =====
.ezd-toggle-expand-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 1px solid #dee2e6;
	border-radius: 6px;
	color: #495057;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;

	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
		transition: transform 0.2s ease;
	}

	.btn-text {
		line-height: 1;
	}

	&:hover {
		background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
		border-color: #adb5bd;
		color: #212529;

		.dashicons {
			color: var(--clr-blue, #4c4cf1);
		}
	}

	&:focus {
		outline: none;
		box-shadow: 0 0 0 3px rgba(76, 76, 241, 0.15);
		border-color: var(--clr-blue, #4c4cf1);
	}

	&:active {
		transform: scale(0.98);
	}

	// Expanded state styling
	&[data-state="expanded"] {
		background: linear-gradient(135deg, #e7f3ff 0%, #d2e6f9 100%);
		border-color: #90c2f0;
		color: #1877f2;

		.dashicons {
			color: #1877f2;
		}

		&:hover {
			background: linear-gradient(135deg, #d2e6f9 0%, #bbd8f0 100%);
			border-color: #6eb1eb;
		}
	}
}

// ==========================================================
//  RESPONSIVE ADJUSTMENTS
// ==========================================================
@media (max-width: 1440px) {
	.dd-placeholder::before {
		font-size: 11px;
	}
}

// ==========================================================
//  SKELETON LOADING
// ==========================================================
.ezd-skeleton-line {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: ezd-skeleton-shimmer 1.5s ease-in-out infinite;
	border-radius: 4px;
}

@keyframes ezd-skeleton-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

.ezd-skeleton-loading {
	pointer-events: none;
	opacity: 0.85;
}

// ==========================================================
//  TOAST ERROR VARIANT
// ==========================================================
.ezd-save-indicator.is-error {
	background: linear-gradient(135deg, #d33 0%, #b52727 100%) !important;
	box-shadow: 0 4px 16px rgba(211, 51, 51, 0.3);
}

.ezd-toast-container {
	position: fixed;
	top: 46px;
	right: 20px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;

	.ezd-save-indicator {
		pointer-events: auto;
		position: static;
	}
}

// ==========================================================
//  RTL SUPPORT
// ==========================================================
body.rtl {
	.parent-nestable .easydocs-navitem::after {
		right: auto;
		left: 0;
	}

	.ezd-save-indicator {
		right: auto;
		left: 20px;
	}

	.ezd-toolbar-actions {
		margin-left: 0;
		margin-right: auto;
	}

	.ezd-toast-container {
		right: auto;
		left: 20px;
	}
}
