/* Blocks Library Admin CSS */

/* Hide the original textarea visually but keep it accessible for form submission */
.blockeditor-textarea-wrapper {
    position: relative !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.blockeditor-textarea-wrapper textarea {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 1px !important;
    opacity: 0.01 !important;
    pointer-events: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Main Editor Container */
.blockeditor-container {
    border: 1px solid #cdcdcd;
    background: #f7f7f7;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Toolbar */
.blockeditor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    align-items: center;
}

.blockeditor-toolbar-label {
    font-weight: 600;
    color: #555;
    margin-right: 10px;
    font-size: 13px;
}

/* Frontend Editor Toggle */
.blockeditor-frontend-toggle {
    margin-left: auto;
    padding-left: 15px;
    border-left: 1px solid #ddd;
}

.blockeditor-frontend-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    user-select: none;
}

.blockeditor-frontend-toggle-label:hover {
    color: #333;
}

.blockeditor-frontend-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.blockeditor-frontend-checkbox:checked + span {
    color: #27ae60;
    font-weight: 600;
}

/* Add Block Button */
.blockeditor-btn-add-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s;
}

.blockeditor-btn-add-block:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.blockeditor-btn-add-block svg {
    flex-shrink: 0;
    color: #5cb85c;
}

/* Add Block Dialog */
.blockeditor-add-block-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 999999;
    margin: 0;
    padding: 0;
}

.blockeditor-add-block-dialog[style*="display: flex"] {
    display: flex !important;
}

.blockeditor-add-block-dialog-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1000000;
}

.blockeditor-add-block-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.blockeditor-add-block-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blockeditor-add-block-dialog-header h3 svg {
    color: #5cb85c;
}

.blockeditor-add-block-dialog-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.blockeditor-add-block-dialog-close:hover {
    background: #f0f0f0;
    color: #333;
}

.blockeditor-add-block-dialog-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Block Sections */
.blockeditor-block-section {
    margin-bottom: 24px;
}

.blockeditor-block-section:last-child {
    margin-bottom: 0;
}

.blockeditor-block-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Block Grid */
.blockeditor-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.blockeditor-block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.blockeditor-block-item:hover {
    background: #fff;
    border-color: #5cb85c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blockeditor-block-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blockeditor-block-item-icon svg {
    width: 24px;
    height: 24px;
    color: #555;
}

.blockeditor-block-item:hover .blockeditor-block-item-icon {
    background: #5cb85c;
}

.blockeditor-block-item:hover .blockeditor-block-item-icon svg {
    color: #fff;
}

.blockeditor-block-item-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.blockeditor-block-item-desc {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

.blockeditor-block-item-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 6px;
}

.blockeditor-block-item-global {
    background: linear-gradient(135deg, #f5f7ff 0%, #f0f3ff 100%);
    border-color: #e0e5ff;
}

.blockeditor-block-item-global:hover {
    border-color: #667eea;
}

.blockeditor-block-item-global:hover .blockeditor-block-item-icon {
    background: #667eea;
}

/* Legacy Dropdown (keep for backwards compatibility) */
.blockeditor-dropdown {
    position: relative;
    display: inline-block;
}

.blockeditor-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
    border: 1px solid #4cae4c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    transition: all 0.15s ease;
}

.blockeditor-dropdown-btn:hover {
    background: linear-gradient(to bottom, #449d44 0%, #398439 100%);
    border-color: #398439;
}

.blockeditor-dropdown-icon {
    font-size: 16px;
    font-weight: bold;
}

.blockeditor-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.blockeditor-dropdown.open .blockeditor-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.blockeditor-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
}

.blockeditor-dropdown.open .blockeditor-dropdown-menu {
    display: block;
}

.blockeditor-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    text-align: left;
    transition: background 0.1s ease;
}

.blockeditor-dropdown-item:hover {
    background: #f5f5f5;
}

.blockeditor-dropdown-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.blockeditor-dropdown-item-icon svg {
    width: 18px;
    height: 18px;
}

.blockeditor-dropdown-item:hover .blockeditor-dropdown-item-icon {
    color: #3498db;
}

.blockeditor-dropdown-item-label {
    flex: 1;
}

/* Dropdown sections */
.blockeditor-dropdown-section {
    padding: 4px 0;
}

.blockeditor-dropdown-section-title {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blockeditor-dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* Global block items in dropdown */
.blockeditor-dropdown-item-global {
    background: #f0fff4;
    border-left: 3px solid #27ae60;
}

.blockeditor-dropdown-item-global:hover {
    background: #dcfce7;
}

.blockeditor-dropdown-item-badge {
    font-size: 9px;
    font-weight: 600;
    background: #27ae60;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Blocks List */
.blockeditor-list {
    min-height: 100px;
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 10px;
}

.blockeditor-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Block Item */
.blockeditor-item {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s ease;
}

.blockeditor-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

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

.blockeditor-item.dragging {
    opacity: 0.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Block Header */
.blockeditor-item-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(to bottom, #fafafa 0%, #f0f0f0 100%);
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    gap: 10px;
}

.blockeditor-item:not(.open) .blockeditor-item-header {
    border-bottom: none;
    border-radius: 4px;
}

.blockeditor-drag-handle {
    cursor: move;
    padding: 8px;
    color: #999;
    user-select: none;
    display: flex;
    align-items: center;
}

.blockeditor-drag-handle:hover {
    color: #666;
}

.blockeditor-drag-handle svg {
    display: block;
}

/* Action Buttons with SVG Icons */
.blockeditor-item-actions button {
    padding: 6px 8px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    cursor: pointer;
    color: #666 !important;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.blockeditor-item-actions button:hover {
    background: #f8f9fa !important;
    border-color: #bbb !important;
    color: #333 !important;
}

.blockeditor-item-actions button svg {
    display: block;
}

/* Visibility Button specific */
.blockeditor-btn-visibility {
    color: #666 !important;
}

/* Hidden state - visibility button turns red */
.blockeditor-item-hidden .blockeditor-btn-visibility {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

.blockeditor-item-hidden .blockeditor-btn-visibility:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
}

/* Delete button - subtle red on hover */
.blockeditor-btn-remove:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

/* Edit button - subtle blue on hover */
.blockeditor-btn-toggle:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #2563eb !important;
}

/* Duplicate button - subtle green on hover */
.blockeditor-btn-duplicate:hover {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #16a34a !important;
}

/* Hidden Block State */
.blockeditor-item.blockeditor-item-hidden {
    opacity: 0.5;
    border-color: #e74c3c !important;
}

.blockeditor-item.blockeditor-item-hidden .blockeditor-item-header {
    background: linear-gradient(to bottom, #fde8e8 0%, #f5d5d5 100%);
    border-color: #e74c3c;
}

.blockeditor-item.blockeditor-item-hidden .blockeditor-item-title::after {
    content: '(Hidden)';
    font-size: 11px;
    font-weight: normal;
    color: #e74c3c;
    margin-left: 8px;
    padding: 2px 6px;
    background: #fde8e8;
    border-radius: 3px;
}

.blockeditor-item-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blockeditor-item-title svg {
    width: 18px;
    height: 18px;
    color: #666;
    flex-shrink: 0;
}

/* Block Actions */
.blockeditor-item-actions {
    display: flex;
    gap: 5px;
}

.blockeditor-item-actions button {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blockeditor-item-actions button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.blockeditor-btn-toggle {
    background: #e8f4fc !important;
    border-color: #b8d4e8 !important;
    color: #2a6496 !important;
}

.blockeditor-btn-toggle:hover {
    background: #d4ebf9 !important;
}

.blockeditor-btn-remove {
    color: #a94442 !important;
}

.blockeditor-btn-remove:hover {
    background: #f8e8e8 !important;
    border-color: #c9302c !important;
}

.blockeditor-btn-move-up,
.blockeditor-btn-move-down {
    padding: 5px 8px !important;
}

.blockeditor-action-icon {
    font-size: 11px;
}

/* Block Body */
.blockeditor-item-body {
    padding: 20px;
    display: none;
    background: #fff;
    border-radius: 0 0 4px 4px;
}

.blockeditor-item.open .blockeditor-item-body {
    display: block;
}

/* Form Elements */
.blockeditor-form-group {
    margin-bottom: 18px;
}

.blockeditor-form-group:last-child {
    margin-bottom: 0;
}

/* Field Binding */
.blockeditor-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.blockeditor-field-header label {
    margin-bottom: 0 !important;
}

.blockeditor-field-binding {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blockeditor-binding-select {
    padding: 3px 8px;
    font-size: 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    min-width: 100px;
}

.blockeditor-binding-select:hover {
    border-color: #3498db;
}

.blockeditor-binding-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Insert Field dropdown styling */
.blockeditor-binding-select option:first-child {
    color: #999;
    font-style: italic;
}

.blockeditor-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.blockeditor-form-group small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 11px;
}

/* Global + Name Row */
.blockeditor-global-name-row {
    display: flex;
    gap: 20px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    align-items: flex-start;
}

.blockeditor-global-field {
    flex: 0 0 auto;
    min-width: 140px;
}

.blockeditor-name-field {
    flex: 1;
}

.blockeditor-name-field label .blockeditor-optional {
    font-weight: normal;
    color: #999;
    font-size: 11px;
}

.blockeditor-name-field .blockeditor-form-input {
    background: #fafafa;
}

.blockeditor-name-field .blockeditor-form-input:focus {
    background: #fff;
}

.blockeditor-name-field .blockeditor-form-input:required {
    border-color: #3498db;
}

.blockeditor-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.blockeditor-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.blockeditor-global-checkbox:checked + span {
    color: #27ae60;
}

.blockeditor-field-note {
    display: block;
    margin-top: 4px;
    color: #999;
    font-size: 11px;
    font-style: italic;
}

/* Global block indicator in header */
.blockeditor-item-title .blockeditor-global-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #27ae60;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
}

.blockeditor-form-input,
.blockeditor-form-textarea,
.blockeditor-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.blockeditor-form-input:focus,
.blockeditor-form-textarea:focus,
.blockeditor-form-select:focus {
    outline: none;
    border-color: #66afe9;
    box-shadow: 0 0 0 3px rgba(102, 175, 233, 0.25);
}

.blockeditor-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.blockeditor-form-select {
    background: #fff;
    cursor: pointer;
}

.blockeditor-form-color {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

/* Accordion Items */
.blockeditor-accordion-items {
    margin-bottom: 12px;
}

.blockeditor-accordion-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.blockeditor-accordion-item-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f9f9f9;
    gap: 10px;
}

.blockeditor-accordion-drag-handle {
    cursor: move;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    padding: 2px;
}

.blockeditor-accordion-drag-handle:hover {
    opacity: 1;
}

.blockeditor-accordion-drag-handle:active {
    cursor: grabbing;
}

.blockeditor-accordion-label {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blockeditor-accordion-icon-preview {
    font-size: 16px;
}

.blockeditor-accordion-item-actions {
    display: flex;
    gap: 6px;
}

.blockeditor-accordion-edit {
    padding: 4px 12px;
    background: #3498db;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-accordion-edit:hover {
    background: #2980b9;
}

.blockeditor-accordion-remove {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.blockeditor-accordion-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.blockeditor-accordion-add {
    padding: 8px 16px;
    background: #27ae60;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-accordion-add:hover {
    background: #219a52;
}

/* Accordion Icon Button Styling (same as tabs) */
.blockeditor-accordion-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.blockeditor-accordion-icon-btn:hover {
    background: #e0e0e0;
    border-color: #3498db;
    transform: scale(1.1);
}

/* Tabs Items */
.blockeditor-tabs-items {
    margin-bottom: 10px;
}

.blockeditor-tabs-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.blockeditor-tabs-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blockeditor-tabs-label {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.blockeditor-tabs-item-actions {
    display: flex;
    gap: 8px;
}

.blockeditor-tabs-edit {
    padding: 4px 10px;
    background: #3498db;
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.blockeditor-tabs-edit:hover {
    background: #2980b9;
}

.blockeditor-tabs-item input,
.blockeditor-tabs-item textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 8px;
    font-size: 13px;
}

.blockeditor-tabs-item input:focus,
.blockeditor-tabs-item textarea:focus {
    outline: none;
    border-color: #66afe9;
}

.blockeditor-tabs-add,
.blockeditor-tabs-remove {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.blockeditor-tabs-add {
    background: #5cb85c;
    border-color: #4cae4c;
    color: #fff;
}

.blockeditor-tabs-add:hover {
    background: #449d44;
}

.blockeditor-tabs-remove {
    background: #fff;
    color: #c9302c;
    border-color: #c9302c;
}

.blockeditor-tabs-remove:hover {
    background: #c9302c;
    color: #fff;
}

/* Quote Icon Buttons */
.blockeditor-quote-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.blockeditor-quote-icon-btn:hover {
    background: #e0e0e0;
    border-color: #3498db;
    transform: scale(1.1);
}

/* Tabs Dialog */
.blockeditor-tabs-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.blockeditor-tabs-dialog.open {
    display: flex;
}

.blockeditor-tabs-dialog-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.blockeditor-tabs-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.blockeditor-tabs-dialog-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.blockeditor-tabs-dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.blockeditor-tabs-dialog-close:hover {
    color: #333;
}

.blockeditor-tabs-dialog-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 130px);
}

.blockeditor-tabs-dialog-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
}

.blockeditor-tabs-dialog-body input,
.blockeditor-tabs-dialog-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.blockeditor-tabs-dialog-body input:focus,
.blockeditor-tabs-dialog-body textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.blockeditor-tabs-dialog-body textarea {
    min-height: 120px;
    resize: vertical;
}

.blockeditor-tabs-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

.blockeditor-tabs-dialog-cancel,
.blockeditor-tabs-dialog-save {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ccc;
}

.blockeditor-tabs-dialog-cancel {
    background: #fff;
    color: #666;
}

.blockeditor-tabs-dialog-cancel:hover {
    background: #f5f5f5;
}

.blockeditor-tabs-dialog-save {
    background: #3498db;
    border-color: #2980b9;
    color: #fff;
}

.blockeditor-tabs-dialog-save:hover {
    background: #2980b9;
}

/* Tabs Icon Suggestions */
.blockeditor-tabs-icon-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.blockeditor-tabs-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.blockeditor-tabs-icon-btn:hover {
    background: #e0e0e0;
    border-color: #3498db;
    transform: scale(1.1);
}

.blockeditor-tabs-icon-preview {
    margin-right: 4px;
}

.blockeditor-optional {
    font-weight: normal;
    color: #999;
    font-size: 11px;
}

/* Gallery Items */
.blockeditor-gallery-items {
    margin-bottom: 10px;
}

.blockeditor-gallery-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.blockeditor-gallery-item-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f9f9f9;
    gap: 10px;
}

.blockeditor-gallery-drag-handle {
    cursor: move;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    padding: 2px;
}

.blockeditor-gallery-drag-handle:hover {
    opacity: 1;
}

.blockeditor-gallery-drag-handle:active {
    cursor: grabbing;
}

.blockeditor-gallery-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blockeditor-gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blockeditor-gallery-placeholder {
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blockeditor-gallery-label {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blockeditor-gallery-icon-preview {
    font-size: 14px;
}

.blockeditor-gallery-item-actions {
    display: flex;
    gap: 6px;
}

.blockeditor-gallery-edit {
    padding: 4px 12px;
    background: #3498db;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-gallery-edit:hover {
    background: #2980b9;
}

.blockeditor-gallery-remove {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.blockeditor-gallery-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.blockeditor-gallery-add {
    padding: 8px 16px;
    background: #27ae60;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-gallery-add:hover {
    background: #219a52;
}

/* Gallery Dialog URL Preview */
.blockeditor-gallery-url-preview {
    margin-top: 8px;
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    overflow: hidden;
}

.blockeditor-gallery-url-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.blockeditor-gallery-url-preview .error {
    color: #e74c3c;
    font-size: 12px;
}

/* Columns Editor */
.columns-editor {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.column-input {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
}

.column-input label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
    font-size: 13px;
}

.column-input textarea {
    width: 100%;
    box-sizing: border-box;
}

.column-input.blockeditor-bindable-field .blockeditor-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.column-input.blockeditor-bindable-field .blockeditor-field-header label {
    margin-bottom: 0;
}

/* Image Block Preview */
.blockeditor-image-preview {
    margin-top: 10px;
    max-width: 300px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.blockeditor-image-preview img {
    max-width: 100%;
    max-height: 200px;
    display: block;
    object-fit: contain;
}

.blockeditor-image-preview:empty {
    display: none;
}

/* Preview Styles */
.blockeditor-preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px dashed #ccc;
    background: #fafafa;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .blockeditor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .blockeditor-dropdown {
        width: 100%;
    }

    .blockeditor-dropdown-btn {
        width: 100%;
        justify-content: center;
    }

    .blockeditor-dropdown-menu {
        width: 100%;
    }

    .blockeditor-item-header {
        flex-wrap: wrap;
    }

    .blockeditor-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* Toolbar Actions (Import/Export/AI) */
.blockeditor-toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.blockeditor-btn-export,
.blockeditor-btn-import,
.blockeditor-btn-ai-prompt,
.blockeditor-btn-generate-css {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #333;
}

.blockeditor-btn-export:hover,
.blockeditor-btn-import:hover,
.blockeditor-btn-ai-prompt:hover,
.blockeditor-btn-generate-css:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.blockeditor-btn-export svg,
.blockeditor-btn-import svg,
.blockeditor-btn-ai-prompt svg,
.blockeditor-btn-generate-css svg {
    flex-shrink: 0;
}

.blockeditor-btn-export svg {
    color: #17a2b8;
}

.blockeditor-btn-import svg {
    color: #28a745;
}

.blockeditor-btn-ai-prompt svg {
    color: #6f42c1;
}

.blockeditor-btn-generate-css svg {
    color: #06b6d4;
}

/* Export/Import Modal */
.blockeditor-export-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.blockeditor-export-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.blockeditor-export-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.blockeditor-export-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blockeditor-export-modal-header h3 svg {
    flex-shrink: 0;
}

.blockeditor-export-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.blockeditor-export-modal-close:hover {
    color: #333;
}

.blockeditor-export-modal-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
}

.blockeditor-export-modal-body p {
    margin: 0 0 12px 0;
    color: #666;
}

.blockeditor-export-textarea {
    width: 100%;
    min-height: 300px;
    font-family: monospace;
    font-size: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    background: #f9f9f9;
}

.blockeditor-export-textarea:focus {
    outline: none;
    border-color: #4a90d9;
    background: #fff;
}

.blockeditor-import-file-wrapper {
    margin-top: 12px;
}

.blockeditor-import-file {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

.blockeditor-export-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.blockeditor-export-copy-btn,
.blockeditor-export-download-btn,
.blockeditor-import-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-export-copy-btn {
    background: #4a90d9;
    color: #fff;
}

.blockeditor-export-copy-btn:hover {
    background: #3a7bc8;
}

.blockeditor-export-download-btn {
    background: #5cb85c;
    color: #fff;
}

.blockeditor-export-download-btn:hover {
    background: #4cae4c;
}

.blockeditor-import-btn {
    background: #4a90d9;
    color: #fff;
}

.blockeditor-import-btn:hover {
    background: #3a7bc8;
}

.blockeditor-import-cancel-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.blockeditor-import-cancel-btn:hover {
    background: #e0e0e0;
}

/* Global Block Confirmation Dialog */
.blockeditor-global-confirm-modal .blockeditor-export-modal-content {
    max-width: 500px;
}

.blockeditor-global-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #856404;
}

.blockeditor-global-changes {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.blockeditor-global-changes h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #495057;
}

.blockeditor-global-changes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blockeditor-global-changes-list li {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blockeditor-global-changes-list li:last-child {
    border-bottom: none;
}

.blockeditor-global-changes-list .change-icon {
    font-size: 16px;
}

.blockeditor-global-changes-list .change-type {
    color: #6c757d;
    font-size: 12px;
}

.blockeditor-global-confirm-text {
    margin: 0;
    font-weight: 500;
    color: #333;
}

.blockeditor-global-confirm-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-global-confirm-btn:hover {
    background: #c82333;
}

.blockeditor-global-cancel-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.blockeditor-global-cancel-btn:hover {
    background: #e0e0e0;
}

/* AI Prompt Modal */
.blockeditor-ai-modal-content {
    max-width: 800px;
}

.blockeditor-ai-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.blockeditor-ai-info p {
    margin: 0 0 8px 0;
    color: #4a5568;
}

.blockeditor-ai-info p:last-child {
    margin-bottom: 0;
}

.blockeditor-ai-stats {
    font-size: 13px;
    color: #718096;
}

.blockeditor-ai-section {
    margin-bottom: 20px;
}

.blockeditor-ai-section:last-child {
    margin-bottom: 0;
}

.blockeditor-ai-section h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2d3748;
}

.blockeditor-copy-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
}

.blockeditor-copy-btn:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
}

.blockeditor-ai-textarea {
    width: 100%;
    min-height: 150px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    resize: vertical;
    background: #f8fafc;
    color: #2d3748;
}

.blockeditor-ai-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fff;
}

.blockeditor-ai-textarea#blockeditor-ai-system-prompt {
    min-height: 200px;
    background: #fefefe;
}

.blockeditor-ai-textarea.blockeditor-ai-content {
    min-height: 100px;
}

.blockeditor-ai-copy-all-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.blockeditor-ai-copy-all-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.blockeditor-export-modal-close-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.blockeditor-export-modal-close-btn:hover {
    background: #e0e0e0;
}

/* =====================================================
   Features Block Admin Styles
   ===================================================== */

.blockeditor-features-items {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fff;
}

.blockeditor-features-item {
    border-bottom: 1px solid #eee;
}

.blockeditor-features-item:last-child {
    border-bottom: none;
}

.blockeditor-features-item-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f9f9f9;
    gap: 10px;
}

.blockeditor-features-item:hover .blockeditor-features-item-header {
    background: #f0f5ff;
}

.blockeditor-features-drag-handle {
    cursor: move;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    padding: 2px;
}

.blockeditor-features-drag-handle:hover {
    opacity: 1;
}

.blockeditor-features-drag-handle:active {
    cursor: grabbing;
}

.blockeditor-features-label {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blockeditor-features-icon-preview {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.blockeditor-features-item-actions {
    display: flex;
    gap: 6px;
}

.blockeditor-features-edit {
    padding: 4px 12px;
    background: #3498db;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.blockeditor-features-edit:hover {
    background: #2980b9;
}

.blockeditor-features-remove {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.blockeditor-features-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.blockeditor-features-add {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #5cb85c;
    text-align: center;
    transition: all 0.2s;
}

.blockeditor-features-add:hover {
    background: #e8f5e9;
    border-color: #5cb85c;
}
