/*
 * Easy Popup Lightbox Maker - Editor CSS
 *
 * Styles specific to the popup editor page.
 *
 * @package EasyPopupLightboxMaker
 */

/* ===========================
   Editor Layout (Two-column)
   =========================== */

.eplmkr-editor-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: var(--eplmkr-space-6);
	align-items: start;
}

@media (max-width: 1100px) {
	.eplmkr-editor-layout {
		grid-template-columns: 1fr;
	}
}

.eplmkr-editor-main {
	min-width: 0;
}

.eplmkr-editor-sidebar {
	position: sticky;
	top: 48px;
}

@media (max-width: 1100px) {
	.eplmkr-editor-sidebar {
		position: static;
	}
}


/* ===========================
   Elements Toolbar
   =========================== */

.eplmkr-elements-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--eplmkr-space-2);
}


/* ===========================
   Elements List
   =========================== */

.eplmkr-elements-list {
	display: flex;
	flex-direction: column;
	gap: var(--eplmkr-space-3);
	min-height: 80px;
}

.eplmkr-element-item {
	background: var(--eplmkr-surface-container-low);
	border-radius: var(--eplmkr-radius-lg);
	padding: var(--eplmkr-space-4);
	position: relative;
	transition: background var(--eplmkr-transition-fast);
	cursor: grab;
}

.eplmkr-element-item:hover {
	background: var(--eplmkr-surface-container);
}

.eplmkr-element-item.eplmkr-dragging {
	opacity: 0.5;
	cursor: grabbing;
}

.eplmkr-element-item__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--eplmkr-space-3);
}

.eplmkr-element-item__type {
	display: flex;
	align-items: center;
	gap: var(--eplmkr-space-2);
	font-family: var(--eplmkr-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--eplmkr-primary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.eplmkr-element-item__actions {
	display: flex;
	gap: var(--eplmkr-space-1);
}

.eplmkr-element-item__body .eplmkr-input,
.eplmkr-element-item__body .eplmkr-select,
.eplmkr-element-item__body textarea {
	font-size: 0.8125rem;
}

.eplmkr-element-item__body textarea {
	display: block;
	width: 100%;
	min-height: 80px;
	padding: 0.5rem 0.75rem;
	font-family: var(--eplmkr-font-body);
	color: var(--eplmkr-on-surface);
	background: var(--eplmkr-surface-container-lowest);
	border: 1.5px solid transparent;
	border-radius: var(--eplmkr-radius-md);
	resize: vertical;
	transition: all var(--eplmkr-transition-base);
	outline: none;
}

.eplmkr-element-item__body textarea:focus {
	border-color: rgba(174, 28, 89, 0.3);
	box-shadow: 0 0 0 3px rgba(174, 28, 89, 0.08);
}


/* ===========================
   Live Preview
   =========================== */

.eplmkr-live-preview {
	position: relative;
}

.eplmkr-live-preview__popup {
	background: white;
	border-radius: var(--eplmkr-radius-lg);
	padding: 24px;
	box-shadow: var(--eplmkr-shadow-lg);
	max-width: 600px;
	margin: 0 auto;
	position: relative;
}

.eplmkr-live-preview__popup h1,
.eplmkr-live-preview__popup h2,
.eplmkr-live-preview__popup h3,
.eplmkr-live-preview__popup h4 {
	margin-bottom: 0.5rem;
}

.eplmkr-live-preview__popup p {
	margin: 0 0 0.75rem;
	line-height: 1.6;
}

.eplmkr-live-preview__popup img {
	max-width: 100%;
	height: auto;
	border-radius: var(--eplmkr-radius-md);
	margin-bottom: 0.75rem;
}

.eplmkr-live-preview__popup .eplmkr-preview-button,
.eplmkr-modal .eplmkr-preview-button {
	display: inline-block;
	padding: 0.625rem 1.5rem;
	background: linear-gradient(135deg, #ae1c59, #5a3bdd);
	color: #fff;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.875rem;
	text-decoration: none;
	margin-bottom: 0.75rem;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.eplmkr-modal .eplmkr-preview-button:hover {
	opacity: 0.9;
	transform: translateY(-1px);
	color: #fff;
}

.eplmkr-live-preview__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--eplmkr-surface-container-high);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--eplmkr-on-surface-variant);
	font-size: 1rem;
	line-height: 1;
}

/* Preview modal close button — matches frontend .eplmkr-popup__close */
.eplmkr-modal .eplmkr-modal__close-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.06);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: #333;
	transition: background 0.2s ease, color 0.2s ease;
	z-index: 3;
	padding: 0;
	line-height: 1;
}

.eplmkr-modal .eplmkr-modal__close-btn:hover {
	background: rgba(0, 0, 0, 0.12);
	color: #000;
}


/* ===========================
   Drag handle
   =========================== */

.eplmkr-drag-handle {
	cursor: grab;
	color: var(--eplmkr-outline-variant);
	display: flex;
	align-items: center;
}

.eplmkr-drag-handle:active {
	cursor: grabbing;
}


/* ===========================
   Autosave indicator
   =========================== */

#eplmkr-autosave-status {
	color: var(--eplmkr-on-surface-variant);
	padding: 0 var(--eplmkr-space-3);
}

#eplmkr-autosave-status.eplmkr-saving {
	color: var(--eplmkr-primary);
}

#eplmkr-autosave-status.eplmkr-saved {
	color: #16a34a;
}
