/* Custom Bullet List Block Styles */

/* Block Container */
.wp-block-pinkrebel-custom-bullet-list {
	margin: var(--wp--preset--spacing--40, 2rem) 0;
}

/* List Container */
.custom-bullet-list {
	--icon-size: 24px;
	--icon-gap: 16px;
	--item-gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* List Item Container */
.list-item-container {
	position: relative;
	margin-bottom: var(--item-gap);
}

.list-item-container:last-child {
	margin-bottom: 0;
}

/* Editor hover effect - subtle outline only */
.wp-block-editor .list-item-container:hover {
	outline: 1px solid rgba(0, 115, 170, 0.3);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Individual List Item */
.list-item {
	display: flex;
	align-items: center;
	gap: var(--icon-gap);
	min-height: var(--icon-size);
}

/* Icon Container */
.icon-container {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--icon-size);
	height: var(--icon-size);
}

/* Bullet Icon */
.bullet-icon {
	width: var(--icon-size);
	height: var(--icon-size);
	object-fit: contain;
	display: block;
}

/* Bullet Placeholder */
.bullet-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--icon-size);
	height: var(--icon-size);
	background-color: var(--wp--preset--color--secondary, #666);
	color: white;
	border-radius: 50%;
	font-size: calc(var(--icon-size) * 0.6);
	font-weight: bold;
	line-height: 1;
}

/* Text Container */
.text-container {
	flex: 1;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
	text-align: inherit;
	text-decoration: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
}

.list-item-text {
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.text-container span,
.text-container div {
	display: block;
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
	text-align: inherit;
	text-decoration: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
}

/* Item Controls (Editor only) - Only for icon management now */
.item-controls {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	align-items: center;
	position: relative;
	z-index: 10;
}

.icon-control {
	display: flex;
	gap: 4px;
	align-items: center;
}

.icon-control .components-button {
	pointer-events: auto !important;
	position: relative;
	z-index: 11;
}

.remove-item-button {
	margin-left: auto;
	pointer-events: auto !important;
	position: relative;
	z-index: 11;
}

.icon-preview-controls {
	display: flex;
	gap: 4px;
	align-items: center;
}

.icon-preview-controls .components-button {
	pointer-events: auto;
	position: relative;
	z-index: 11;
}

/* Icon Preview in Editor */
.icon-preview-container {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
}

.icon-preview {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 4px;
	background: white;
}

.icon-actions {
	display: flex;
	gap: 8px;
}

.icon-preview-small {
	display: flex;
	gap: 4px;
	align-items: center;
}

/* Global Icon Control */
.global-icon-control {
	margin-bottom: 16px;
}

/* Sidebar List Item Management */
.sidebar-list-item {
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 8px;
	padding: 12px;
	background: #f9f9f9;
}

.sidebar-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.sidebar-item-header strong {
	font-size: 13px;
	color: #1e1e1e;
}

.sidebar-item-preview {
	font-size: 12px;
	color: #666;
	font-style: italic;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sidebar-add-item-button {
	width: 100%;
	margin-top: 12px;
	justify-content: center;
}

/* Ensure buttons in sidebar work properly */
.sidebar-list-item .components-button,
.sidebar-add-item-button {
	pointer-events: auto !important;
	position: relative;
	z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
	.item-controls {
		flex-wrap: wrap;
		gap: 6px;
	}
}

@media (max-width: 480px) {
	.icon-actions {
		flex-direction: column;
		gap: 4px;
	}
	
	.icon-actions .components-button {
		font-size: 12px;
		padding: 4px 8px;
	}
}

/* Frontend-only styles */
.wp-block-pinkrebel-custom-bullet-list:not(.wp-block-editor) .item-controls,
.wp-block-pinkrebel-custom-bullet-list:not(.wp-block-editor) .list-footer {
	display: none;
}

.wp-block-pinkrebel-custom-bullet-list:not(.wp-block-editor) .list-item-container {
	border: none;
	padding: 0;
}

.wp-block-pinkrebel-custom-bullet-list:not(.wp-block-editor) .list-item-container:hover {
	background: none;
}

/* Typography inheritance */
.custom-bullet-list {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.text-container span {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

/* Ensure proper alignment for different font sizes */
.text-container {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

/* Fade-in Animation Styles */
.has-fade-in-animation .list-item-container.fade-in-item {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.has-fade-in-animation .list-item-container.fade-in-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	.has-fade-in-animation .list-item-container.fade-in-item {
		opacity: 0;
		transform: none;
		transition: opacity 0.3s ease-out;
	}
	
	.has-fade-in-animation .list-item-container.fade-in-visible {
		opacity: 1;
		transform: none;
	}
}

/* Editor Sidebar Styles */
.sidebar-list-item {
	padding: 12px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin-bottom: 12px;
	background-color: #f9f9f9;
}

.sidebar-list-item:last-of-type {
	margin-bottom: 16px;
}

.sidebar-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.sidebar-item-header strong {
	font-size: 13px;
	color: #1e1e1e;
}

.sidebar-item-preview {
	font-size: 12px;
	color: #666;
	margin-bottom: 8px;
	line-height: 1.4;
	max-height: 2.8em;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebar-item-icon {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #e0e0e0;
}

.sidebar-icon-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sidebar-icon-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.sidebar-item-global-icon {
	display: flex;
	align-items: center;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #e0e0e0;
}

.full-width-button {
	width: 100% !important;
	justify-content: center !important;
}

.sidebar-add-item-button {
	width: 100% !important;
	justify-content: center !important;
	margin-top: 12px !important;
}
