/**
 * BW Blocks Editor Styles
 * Styles for the block editor interface
 */

/* Editor wrapper adjustments */
.wp-block[data-type^="bw-blocks/"] {
    margin: 20px 0;
}

/* Badge block editor styles */
.wp-block[data-type="bw-blocks/badge"] {
    text-align: center;
}

.wp-block[data-type="bw-blocks/badge"] .bw-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
}

.wp-block[data-type="bw-blocks/badge"] .bw-badge span {
    color: white !important;
}

/* H1 block editor styles */
.wp-block[data-type="bw-blocks/hero-h1"] .bw-hero-h1 {
    margin: 20px 0;
    color: white !important;
    /* Add dark background for visibility in editor */
    background-color: #2d3748;
    padding: 20px;
    border-radius: 8px;
}

.wp-block[data-type="bw-blocks/hero-h1"] .bw-hero-h1.bw-gradient-text {
    background: linear-gradient(to right, #ffffff 0%, rgba(255,255,255,0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons block editor styles */
.wp-block[data-type="bw-blocks/buttons"] .bw-buttons {
    margin: 20px 0;
}

/* Make sure buttons are visible in editor */
.wp-block[data-type="bw-blocks/buttons"] .bw-btn {
    cursor: default;
    pointer-events: none;
}

/* Selected block highlight */
.wp-block[data-type^="bw-blocks/"].is-selected {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Block toolbar positioning */
.wp-block[data-type^="bw-blocks/"] .block-editor-block-toolbar {
    top: -40px;
}

/* Inspector controls styling */
.components-panel__body.bw-blocks-panel {
    border-top: 2px solid #667eea;
}

/* Help text styling */
.bw-blocks-help {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* ===== BW Gallery Grid Editor Styles ===== */
.wp-block[data-type="bw-blocks/gallery-grid"] {
    max-width: 1200px;
    margin: 20px auto;
}

.bw-gallery-grid-editor {
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    min-height: 200px;
}

/* Gallery preview matching frontend layout */
.bw-gallery-preview {
    display: grid !important;
    grid-template-columns: 1.5fr 0.75fr 0.75fr !important;
    grid-template-rows: repeat(2, 200px) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
}

.bw-gallery-preview-item {
    position: relative;
    overflow: hidden;
    background: #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* First item - large */
.bw-gallery-preview-item:first-child {
    grid-row: 1 / 3;
    grid-column: 1;
}

/* Second and third items - top row */
.bw-gallery-preview-item:nth-child(2) {
    grid-row: 1;
    grid-column: 2;
}

.bw-gallery-preview-item:nth-child(3) {
    grid-row: 1;
    grid-column: 3;
}

/* Fourth and fifth items - bottom row */
.bw-gallery-preview-item:nth-child(4) {
    grid-row: 2;
    grid-column: 2;
}

.bw-gallery-preview-item:nth-child(5) {
    grid-row: 2;
    grid-column: 3;
}

.bw-gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery info box */
.bw-gallery-info {
    background: #f0f5ff;
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bw-gallery-info-icon {
    color: #667eea;
    font-size: 20px;
}

.bw-gallery-info-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.bw-gallery-info-text strong {
    color: #667eea;
    font-weight: 600;
}

/* Empty state */
.bw-gallery-empty-state {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
}

.bw-gallery-empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.bw-gallery-empty-state p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}