/* Editor Mode Styles - Only visible locally */

/* Editor Controls */
#editor-controls {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 10001;
	display: flex;
	gap: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#editor-controls button {
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#edit-toggle {
	background: #4285f4;
	color: #fff;
}

#edit-toggle:hover {
	background: #3367d6;
}

#edit-toggle.active {
	background: #ee4735;
}

#save-btn {
	background: #34a853;
	color: #fff;
}

#save-btn:hover {
	background: #2d9249;
}

#add-image-btn {
	background: #f29900;
	color: #fff;
}

#add-image-btn:hover {
	background: #d68500;
}

#cancel-btn {
	background: #5f6368;
	color: #fff;
}

#cancel-btn:hover {
	background: #4a4d51;
}

/* Edit Mode Indicators */
.edit-mode [data-editable] {
	outline: 2px dashed rgba(66, 133, 244, 0.4);
	outline-offset: 2px;
	transition: all 0.2s;
	min-height: 1em;
}

.edit-mode [data-editable]:hover {
	outline-color: #4285f4;
	background: rgba(66, 133, 244, 0.05);
}

.edit-mode [data-editable]:focus {
	outline: 2px solid #4285f4;
	background: rgba(66, 133, 244, 0.08);
}

.edit-mode [data-editable].insert-anchor-active {
	outline: 2px solid #f29900;
	background: rgba(242, 153, 0, 0.08);
}

/* Editable Images */
.edit-mode img[data-editable] {
	cursor: pointer;
	position: relative;
}

.edit-mode .image-wrapper {
	position: relative;
	display: inline-block;
}

.edit-mode .image-wrapper::after {
	content: 'Click to replace';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0,0,0,0.7);
	color: #fff;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	opacity: 0;
	transition: opacity 0.2s;
	pointer-events: none;
}

.edit-mode .image-wrapper:hover::after {
	opacity: 1;
}

/* Light mode adjustments */
.light-mode.edit-mode [data-editable]:hover {
	background: rgba(66, 133, 244, 0.08);
}

.light-mode.edit-mode [data-editable]:focus {
	background: rgba(66, 133, 244, 0.1);
}

.edit-mode [data-image-slot] {
	outline: 2px dashed rgba(242, 153, 0, 0.6);
	outline-offset: 2px;
	min-height: 80px;
	position: relative;
}

.edit-mode [data-image-slot]::before {
	content: 'Image slot';
	position: absolute;
	top: 8px;
	left: 10px;
	font-size: 12px;
	background: rgba(242, 153, 0, 0.15);
	color: #f29900;
	padding: 2px 8px;
	border-radius: 20px;
}

.edit-mode [data-image-slot].image-slot-active {
	outline-color: #f29900;
	background: rgba(242, 153, 0, 0.08);
}

/* Status indicator */
#editor-status {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	z-index: 10002;
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.3s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#editor-status.visible {
	opacity: 1;
	transform: translateY(0);
}

#editor-status.success {
	background: #34a853;
	color: #fff;
}

#editor-status.error {
	background: #ee4735;
	color: #fff;
}

#editor-status.saving {
	background: #4285f4;
	color: #fff;
}

/* Hidden file input for image upload */
#image-upload-input {
	display: none;
}

/* Floating delete button - appears on hover over editable text elements */
#editor-delete-btn {
	position: fixed;
	z-index: 10003;
	display: none;
	width: 22px;
	height: 22px;
	padding: 0;
	background: #ee4735;
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 16px;
	line-height: 22px;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	transition: background 0.15s, transform 0.15s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#editor-delete-btn:hover {
	background: #c62a1a;
	transform: scale(1.15);
}

/* Per-image delete button - injected into .case-img-wrap in edit mode */
.img-delete-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 10;
	width: 28px;
	height: 28px;
	padding: 0;
	background: #ee4735;
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 6px rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.15s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.img-delete-btn:hover {
	background: #c62a1a;
	transform: scale(1.1);
}

/* Upload button inside .image-brief placeholders - injected in edit mode */
.image-brief-upload-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 6px 14px;
	background: transparent;
	color: #f29900;
	border: 1px dashed #f29900;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	transition: background 0.15s, color 0.15s;
}

.image-brief-upload-btn:hover {
	background: rgba(242, 153, 0, 0.12);
}

.light-mode .image-brief-upload-btn {
	color: #c47a00;
	border-color: #c47a00;
}

.light-mode .image-brief-upload-btn:hover {
	background: rgba(196, 122, 0, 0.1);
}

/* Figure-row layout toolbar - appears in edit mode on hover */
body.edit-mode [data-figure-row] {
	position: relative;
}
.figure-row-layout-toolbar {
	position: absolute;
	top: -40px;
	right: 0;
	display: none;
	gap: 4px;
	padding: 4px;
	background: rgba(20, 20, 20, 0.94);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36);
	z-index: 12;
}
body.edit-mode [data-figure-row]:hover > .figure-row-layout-toolbar,
body.edit-mode [data-figure-row]:focus-within > .figure-row-layout-toolbar,
body.edit-mode .figure-row-layout-toolbar:hover {
	display: flex;
}
.figure-row-layout-toolbar button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 28px;
	border-radius: 4px;
	background: transparent;
	border: 1px solid transparent;
	color: rgba(255, 255, 255, 0.72);
	cursor: pointer;
	padding: 0;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.figure-row-layout-toolbar button:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}
.figure-row-layout-toolbar button.active {
	background: rgba(242, 153, 0, 0.18);
	border-color: rgba(242, 153, 0, 0.55);
	color: #f29900;
}
.light-mode .figure-row-layout-toolbar {
	background: rgba(255, 255, 255, 0.98);
	border-color: rgba(0, 0, 0, 0.10);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}
.light-mode .figure-row-layout-toolbar button {
	color: #555;
}
.light-mode .figure-row-layout-toolbar button:hover {
	background: rgba(0, 0, 0, 0.04);
	color: #111;
}
.light-mode .figure-row-layout-toolbar button.active {
	background: rgba(196, 122, 0, 0.10);
	border-color: rgba(196, 122, 0, 0.5);
	color: #c47a00;
}

/* Paragraph insert zones - injected between content elements in edit mode */
.para-insert-zone {
	position: relative;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: -4px 0;
	z-index: 4;
}

.para-insert-zone::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	background: transparent;
	transition: background 0.15s;
	pointer-events: none;
}

.para-insert-zone:hover::before {
	background: rgba(66, 133, 244, 0.35);
}

.para-insert-btn {
	width: 22px;
	height: 22px;
	padding: 0;
	background: #4285f4;
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 20px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.15s, transform 0.15s, background 0.15s;
	box-shadow: 0 1px 6px rgba(0,0,0,0.4);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.para-insert-zone:hover .para-insert-btn {
	opacity: 1;
}

.para-insert-btn:hover {
	background: #3367d6;
	transform: scale(1.12);
}
