/**
 * Pixel Clusters - Block Editor Styles
 * Version: 2.1.0
 */

/* Block Wrapper */
.pixel-cluster-block-editor {
    position: relative;
    min-height: 100px;
}

/* Placeholder styling */
.pixel-cluster-block-editor .components-placeholder {
    min-height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
}

.pixel-cluster-block-editor .components-placeholder__icon {
    color: #2271b1;
}

.pixel-cluster-block-editor .components-placeholder__label {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.pixel-cluster-block-editor .components-placeholder__instructions {
    color: #50575e;
    font-size: 14px;
    max-width: 400px;
}

/* Loading state */
.pixel-cluster-block-editor .components-spinner {
    margin: 20px auto;
}

/* Preview container */
.pixel-cluster-block-editor .cluster,
.pixel-cluster-block-editor .pc-cluster {
    pointer-events: none;
}

/* Ensure images display properly in editor */
.pixel-cluster-block-editor .pc-item__image-bg,
.pixel-cluster-block-editor .images {
    background-color: #e9ecef;
}

/* Card hover effects disabled in editor */
.pixel-cluster-block-editor .pc-item--card:hover,
.pixel-cluster-block-editor .pc-item--product:hover,
.pixel-cluster-block-editor .cluster .column3:hover,
.pixel-cluster-block-editor .cluster.flex .columns:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Block toolbar icon */
.editor-block-list-item-pixel-cluster-cluster .block-editor-block-types-list__item-icon {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-radius: 4px;
}

.editor-block-list-item-pixel-cluster-cluster .block-editor-block-types-list__item-icon svg {
    fill: white;
}

/* Inspector controls enhancements */
.block-editor-block-inspector .components-panel__body-title {
    border-bottom: 1px solid #e0e0e0;
}

/* Selected block outline */
.wp-block-pixel-cluster-cluster.is-selected {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Responsive adjustments in editor */
.pixel-cluster-block-editor .cluster .column3,
.pixel-cluster-block-editor .pc-cluster .pc-item--card {
    width: calc(33.333% - 20px);
}

.pixel-cluster-block-editor .cluster.flex .columns,
.pixel-cluster-block-editor .pc-cluster .pc-item--product {
    flex: 1 1 calc(33.333% - 24px);
    max-width: calc(33.333% - 16px);
}

/* Server Side Render wrapper */
.pixel-cluster-block-editor .wp-block-pixel-cluster-cluster__placeholder {
    padding: 40px 20px;
    text-align: center;
    background: #f0f0f1;
    border-radius: 8px;
}

/* Empty state message */
.pixel-cluster-block-editor .pc-cluster:empty::before {
    content: attr(data-empty-message);
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: #757575;
    font-style: italic;
}

/* Fix for disabled container */
.pixel-cluster-block-editor [disabled],
.pixel-cluster-block-editor .components-disabled {
    opacity: 1;
}

/* Product buttons in editor */
.pixel-cluster-block-editor .pc-item__buttons,
.pixel-cluster-block-editor .buttons {
    pointer-events: none;
}

.pixel-cluster-block-editor .pc-btn,
.pixel-cluster-block-editor .buttons a,
.pixel-cluster-block-editor .buttons button {
    cursor: default;
}

/* Alignment support */
.wp-block-pixel-cluster-cluster.alignwide .cluster,
.wp-block-pixel-cluster-cluster.alignwide .pc-cluster {
    max-width: none;
}

.wp-block-pixel-cluster-cluster.alignfull .cluster,
.wp-block-pixel-cluster-cluster.alignfull .pc-cluster {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Inspector panel custom styles */
.pixel-cluster-inspector-hint {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px;
    margin: 16px 0;
    font-size: 13px;
    color: #1d2327;
}

.pixel-cluster-inspector-hint strong {
    display: block;
    margin-bottom: 4px;
}

/* Loading overlay */
.pixel-cluster-block-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Preview mode adjustments */
@media (max-width: 782px) {
    .pixel-cluster-block-editor .cluster .column3,
    .pixel-cluster-block-editor .pc-cluster .pc-item--card {
        width: 100%;
        margin: 0 0 16px 0;
    }
    
    .pixel-cluster-block-editor .cluster.flex .columns,
    .pixel-cluster-block-editor .pc-cluster .pc-item--product {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Dark mode support for editor */
.is-dark-theme .pixel-cluster-block-editor .components-placeholder {
    background: linear-gradient(135deg, #2c3338 0%, #1d2327 100%);
    border-color: #50575e;
}

.is-dark-theme .pixel-cluster-block-editor .components-placeholder__label {
    color: #f0f0f1;
}

.is-dark-theme .pixel-cluster-block-editor .components-placeholder__instructions {
    color: #c3c4c7;
}
