.btn {
    padding: 0.5em 1em;
    margin-bottom: 0;
    border-radius: 2px;
    border: 1px solid;
    font-weight: 500;
    line-height: 1.143em;
    background: #e3165b;
    box-sizing: border-box;
    font-size: 14px;
    color: #fff;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-shadow: none;
    text-transform: capitalize;
}
 /* CUSTOM MODAL STYLES - REPLACE BOOTSTRAP */
        .custom-modal {
            display: none;
            position: fixed;
            z-index: 10000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.4);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .custom-modal.show {
            display: block;
            opacity: 1;
        }

        .custom-modal-dialog {
            position: relative;
            width: auto;
            margin: 30px auto;
            max-width: 600px;
            transform: translateY(-50px);
            transition: transform 0.3s ease;
        }

        .custom-modal.show .custom-modal-dialog {
            transform: translateY(0);
        }

        .custom-modal-dialog.modal-lg {
            max-width: 900px;
        }

        .custom-modal-dialog.modal-sm {
            max-width: 400px;
        }

        .custom-modal-content {
            position: relative;
            background-color: #fff;
            border: 1px solid rgba(0, 0, 0, 0.2);
            border-radius: 6px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
            outline: 0;
        }

        .custom-modal-header {
            padding: 15px;
            border-bottom: 1px solid #e5e5e5;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .custom-modal-title {
            margin: 0;
            font-size: 18px;
            font-weight: 500;
            line-height: 1.42857143;
        }

        .custom-modal-close {
            background: transparent;
            border: none;
            font-size: 28px;
            font-weight: 700;
            line-height: 1;
            color: #000;
            opacity: 0.2;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .custom-modal-close:hover {
            opacity: 0.5;
        }

        .custom-modal-body {
            position: relative;
            padding: 15px;
            max-height: calc(100vh - 200px);
            overflow-y: auto;
        }

        .custom-modal-footer {
            padding: 15px;
            text-align: right;
            border-top: 1px solid #e5e5e5;
        }

        .custom-modal-footer .btn {
            margin-left: 5px;
        }

        body.modal-open {
            overflow: hidden;
        }

        .spinner-border {
            display: inline-block;
            width: 2rem;
            height: 2rem;
            vertical-align: text-bottom;
            border: 0.25em solid currentColor;
            border-right-color: transparent;
            border-radius: 50%;
            animation: spinner-border 0.75s linear infinite;
        }

        .spinner-border-sm {
            width: 1rem;
            height: 1rem;
            border-width: 0.2em;
        }

        @keyframes spinner-border {
            to { transform: rotate(360deg); }
        }

/* Main Layout */
.page-editor-container {
    display: flex;
    overflow: hidden;
    transition: margin-bottom 0.3s ease-in-out;
}

/* Component Library Sidebar */
.component-library {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
    overflow-x: hidden;
}

.component-library-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
}

.component-library-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}
.component-library-footer{padding: 10px; border-top: 1px solid #ddd;}
.component-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
}

.component-categories {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.component-category {
    margin-bottom: 15px;
}

.component-category-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 8px;
    padding: 0 5px;
}

.component-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s ease;
}

.component-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.component-item:active {
    cursor: grabbing;
}

.component-item.dragging {
    opacity: 0.5;
}

.component-item-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.component-item-desc {
    font-size: 11px;
    color: #6c757d;
}

/* Main Canvas Area */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    color: #367cff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.toolbar-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.toolbar-btn-primary {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.toolbar-btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.toolbar-btn-success {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.toolbar-btn-success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
}

.device-switcher {
    display: flex;
    gap: 5px;
}

.device-btn {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.device-btn.active {
    background: #e9ecef;
    border-color: #adb5bd;
}


.editor-canvas.desktop {
    width: 100%;
    max-width: 1200px;
}

.editor-canvas.tablet {
    width: 768px;
}

.editor-canvas.mobile {
    width: 375px;
}

.canvas-content {
    min-height: 400px;
    padding: 0;
}

.canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #6c757d;
}

.canvas-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.canvas-empty h4 {
    margin-bottom: 8px;
}

.canvas-empty p {
    font-size: 14px;
}

/* Blocks */
.editor-block {
    position: relative;
    border: 2px dashed transparent;
    transition: all 0.2s ease;
}

.editor-block:hover {
    border-color: #007bff;
}

.editor-block.selected {
    border-color: #007bff;
    border-style: solid;
}

.editor-block.drag-over {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.block-toolbar {
    position: absolute;
    top: -30px;
    right: 0;
    display: none;
    background: #343a40;
    border-radius: 4px;
    padding: 4px;
    gap: 4px;
}

.editor-block:hover .block-toolbar,
.editor-block.selected .block-toolbar {
    display: flex;
}

.block-toolbar-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}

.block-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.block-drag-handle {
    cursor: grab;
}

.block-drag-handle:active {
    cursor: grabbing;
}

/* Properties Panel */
.properties-panel {
   width: 350px;
    min-width: 350px;
    background: #fff;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease;
    overflow-y: auto;
    height: 95vh;
    overflow-x: hidden;
}

.properties-panel.collapsed {
    width: 40px;
}

.properties-panel-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.properties-panel-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.properties-panel-content {
    flex: 1;
    overflow: auto;
    padding: 15px;
    overflow-x: hidden;
}

.property-group {
    margin-bottom: 20px;
}

.property-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
}

.property-item {
    margin-bottom: 12px;
}

.property-label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.property-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.property-input:focus {
    border-color: #007bff;
    outline: none;
}

.property-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.color-picker-wrapper {
    display: flex;
    gap: 8px;
}

.color-picker {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

/* Code Editor Mode */
.code-editor-wrapper {
    display: none;
    flex-direction: column;
    height: 100%;
}

.code-editor-wrapper.active {
    display: flex;
}

.code-editor-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.code-editor-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 2px solid transparent;
}

.code-editor-tab.active {
    background: #fff;
    border-bottom-color: #007bff;
}

.code-editor-content {
    flex: 1;
    overflow: hidden;
}

.CodeMirror {
    height: 100% !important;
    font-size: 13px;
}

/* Preview Panel */
.preview-panel {
    display: none;
    flex-direction: column;
    background: #e9ecef;
}

.preview-panel.active {
    display: flex;
}

.preview-iframe {
    flex: 1;
    border: none;
    background: #fff;
}

/* Version History Modal */
.version-list {
    max-height: 400px;
    overflow-y: auto;
}

.version-item {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background 0.2s ease;
}

.version-item:hover {
    background: #f8f9fa;
}

.version-item.active {
    background: #e7f1ff;
}

.version-number {
    font-weight: 600;
    margin-bottom: 4px;
}

.version-date {
    font-size: 12px;
    color: #6c757d;
}

.version-description {
    font-size: 13px;
    color: #495057;
    margin-top: 4px;
}

.version-status {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
    margin-left: 8px;
}

.version-status.draft {
    background: #ffc107;
    color: #212529;
}

.version-status.published {
    background: #28a745;
    color: #fff;
}

/* Responsive */
@media (max-width: 1200px) {
    .component-library {
        width: 240px;
    }

    .properties-panel {
        width: 260px;
    }
}

@media (max-width: 992px) {
    .component-library {
        position: fixed;
        left: -280px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .component-library.open {
        left: 0;
    }

    .properties-panel {
        position: fixed;
        right: -300px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: right 0.3s ease;
    }

    .properties-panel.open {
        right: 0;
    }
}

/* Drag & Drop */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    opacity: 0.8;
}

.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    padding: 40px;
    text-align: center;
    color: #6c757d;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

/* Toast Notifications */
.editor-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #343a40;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.editor-toast.success {
    background: #28a745;
}

.editor-toast.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Inline Editing */
[contenteditable="true"] {
    outline: none;
}

[contenteditable="true"]:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Loading Overlay */
.editor-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.editor-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dee2e6;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Enhancements */
.modal-editor {
    max-width: 800px;
}

.modal-editor .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Topic Selector */
.topic-selector {
    min-width: 200px;
}

/* Canvas Content - Allow overflow and proper sizing */
.canvas-content {
    min-height: 400px;
    padding: 0;
    overflow: visible !important;
    width: 100%;
}

/* Canvas wrapper should handle scrolling */
.editor-canvas-wrapper {
    flex: 1;
    background: #e9ecef;
    overflow: auto !important;
    padding: 20px;
    display: flex;
    justify-content: flex-start; /* Changed from center */
    align-items: flex-start; /* Allow content to start at top */
    height: 90vh;
}

/* Canvas should auto-size to content */
.editor-canvas {
    background: #fff;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    height: auto !important; /* Auto-height based on content */
    width: 100%;
    max-width: 1200px;
    transition: width 0.3s ease;
    overflow: visible !important;
}

.editor-canvas.desktop {
    width: 100%;
    max-width: 1200px;
}

.editor-canvas.tablet {
    width: 768px;
    max-width: 768px;
}

.editor-canvas.mobile {
    width: 375px;
    max-width: 375px;
}

/* Enhanced Editable Block Styles - FIXES for content editing */

/* ===== EDITABLE BLOCKS ===== */

.editable-block {
    position: relative;
    margin: 0;
    transition: all 0.2s ease;
    /* FIX: Ensure blocks don't interfere with content */
    cursor: default;
}

.editable-block:hover {
    outline: 2px dashed #007bff;
    outline-offset: 2px;
}

.editable-block.selected {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Nested Blocks (Cards, Columns, etc.) */
.editable-block-nested {
    display: inline-block;
    vertical-align: top;
}

.editable-block-nested:hover {
    outline: 2px dashed #28a745;
    outline-offset: 2px;
    z-index: 10;
}

.editable-block-nested.selected {
    outline: 2px solid #28a745;
    outline-offset: 2px;
    z-index: 20;
}

/* Prevent parent outline when hovering nested block */
.editable-block:has(.editable-block-nested:hover) {
    outline: none;
}

.editable-block:has(.editable-block-nested.selected) {
    outline: 1px dashed #dee2e6;
}

/* ===== EDITABLE CONTENT - KEY FIXES ===== */

.editable-content {
    /* FIX: Change cursor to text to indicate editability */
    cursor: text !important;
    position: relative;
    outline: none;
    /* FIX: Ensure content is selectable */
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* FIX: Clear visual feedback on hover */
.editable-content:hover {
    background-color: rgba(0, 123, 255, 0.08);
    /* FIX: Add subtle border to show it's editable */
    box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.3);
}

/* FIX: Strong visual feedback when focused/editing */
.editable-content:focus {
    background-color: rgba(0, 123, 255, 0.12) !important;
    box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.5) !important;
    outline: none !important;
    cursor: text !important;
}

/* FIX: Show placeholder for empty editable elements */
.editable-content:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
    font-style: italic;
    pointer-events: none;
}

/* FIX: Better text selection styling */
.editable-content::selection {
    background-color: #b3d7ff;
    color: inherit;
}

.editable-content::-moz-selection {
    background-color: #b3d7ff;
    color: inherit;
}

/* FIX: Prevent click blocking on editable content */
.editable-content * {
    pointer-events: auto;
    cursor: inherit;
}

/* FIX: Specific styles for different editable elements */
.editable-content h1,
.editable-content h2,
.editable-content h3,
.editable-content h4,
.editable-content h5,
.editable-content h6 {
    cursor: text;
    min-height: 1em;
}

.editable-content p {
    cursor: text;
    min-height: 1em;
}

.editable-content a {
    cursor: text;
    /* FIX: Prevent default link behavior while editing */
    pointer-events: none;
}

.editable-content a:focus {
    pointer-events: auto;
}

/* FIX: Special handling for buttons that are editable */
.editable-content button {
    cursor: text !important;
    pointer-events: auto;
}

/* ===== BLOCK TOOLBAR ===== */

.block-toolbar {
    position: absolute;
    top: -35px;
    left: 0;
    background: #007bff;
    border-radius: 4px;
    padding: 4px;
    display: none;
    gap: 4px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* FIX: Ensure toolbar doesn't block clicks */
    pointer-events: auto;
}

/* Nested Block Toolbar */
.block-toolbar-nested {
    background: #28a745;
    top: -32px;
    font-size: 12px;
}

.block-toolbar-nested .block-toolbar-btn {
    padding: 4px 6px;
}

.editable-block:hover .block-toolbar,
.editable-block.selected .block-toolbar {
    display: flex;
}

.editable-block-nested:hover .block-toolbar,
.editable-block-nested.selected .block-toolbar {
    display: flex;
}

.block-toolbar-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 8px;
    cursor: pointer !important;
    border-radius: 3px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    /* FIX: Ensure buttons are clickable */
    pointer-events: auto;
}

.block-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.block-toolbar-btn .svg-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    /* FIX: Prevent SVG from blocking clicks */
    pointer-events: none;
}

/* Block Overlay (for better click handling) */
.block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.editable-block.selected .block-overlay {
    background: rgba(0, 123, 255, 0.05);
}

/* ===== IMPROVED IMAGE EDITING INDICATORS ===== */

.editable-block img {
    transition: all 0.2s ease;
}

.editable-block:hover img {
    outline: 2px dashed #ffc107;
    outline-offset: 2px;
    cursor: pointer;
}

.editable-block.selected img {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* FIX: Show image edit hint on hover */
.editable-block:hover img::after {
    content: '📷 Click to edit';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 100;
}

/* ===== BACKGROUND IMAGE EDITING INDICATORS ===== */

/* FIX: Indicate elements with background images */
.editable-block [style*="background-image"]:not(img)::before {
    content: '🖼️';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.editable-block:hover [style*="background-image"]:not(img)::before,
.editable-block.selected [style*="background-image"]:not(img)::before {
    opacity: 1;
}

/* ===== NESTED BLOCK SPECIFIC STYLES ===== */

/* FIX: Ensure nested blocks maintain proper spacing */
.editable-block-nested {
    margin: 8px;
}

/* FIX: Card-specific improvements */
.editable-block-nested .editable-content {
    padding: 2px;
}

/* FIX: Testimonial/feedback card improvements */
.editable-block-nested .editable-content blockquote,
.editable-block-nested .editable-content p {
    cursor: text;
    min-height: 20px;
}

/* ===== DRAG AND DROP IMPROVEMENTS ===== */

.editable-block.sortable-chosen {
    opacity: 0.5;
}

.editable-block.sortable-ghost {
    opacity: 0.3;
    background: #e9ecef;
}

.editable-block.sortable-drag {
    opacity: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: grabbing !important;
}

/* FIX: Show drag handle cursor on toolbar drag button */
.block-toolbar-btn[data-action="drag"] {
    cursor: grab !important;
}

.block-toolbar-btn[data-action="drag"]:active {
    cursor: grabbing !important;
}

/* ===== UTILITY CLASSES ===== */

/* FIX: Prevent user selection on non-editable areas */
.block-toolbar,
.block-overlay {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes editPulse {
    0%, 100% {
        box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.5);
    }
    50% {
        box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.8);
    }
}

/* FIX: Apply pulse animation to focused editable content */
.editable-content:focus {
    animation: editPulse 2s infinite;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */

@media (max-width: 768px) {
    .block-toolbar {
        top: -30px;
        padding: 2px;
        gap: 2px;
    }
    
    .block-toolbar-btn {
        padding: 4px 6px;
    }
    
    .block-toolbar-btn .svg-icon {
        width: 14px;
        height: 14px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* FIX: Keyboard focus indicators */
.editable-content:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.block-toolbar-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* FIX: High contrast mode support */
@media (prefers-contrast: high) {
    .editable-block:hover {
        outline-width: 3px;
    }
    
    .editable-content:hover {
        background-color: rgba(0, 123, 255, 0.15);
    }
    
    .editable-content:focus {
        background-color: rgba(0, 123, 255, 0.25);
    }
}

/* FIX: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .editable-block,
    .editable-content,
    .block-toolbar-btn {
        transition: none;
    }
    
    .editable-content:focus {
        animation: none;
    }
}

/* ===== MODAL IMPROVEMENTS ===== */

#blockSettingsModal .modal-body {
    padding: 20px;
}

#blockHtmlEditor {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px;
    resize: vertical;
}

/* ===== UTILITY CLASSES ===== */

.text-muted {
    color: #6c757d !important;
}

.text-center {
    text-align: center !important;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.properties-section {
    animation: fadeIn 0.2s ease;
}

/* ===== SCROLLBAR STYLING ===== */

.properties-panel-content::-webkit-scrollbar {
    width: 8px;
}

.properties-panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.properties-panel-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.properties-panel-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* === EDITABLE CONTENT FIXES FOR NESTED CARDS === */

/* Ensure editable content is clickable and editable */
.editable-content {
    cursor: text !important;
    position: relative;
    z-index: 10; /* Above block overlay */
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
}

.editable-content:hover {
    outline: 1px dashed rgba(66, 153, 225, 0.5);
    outline-offset: 2px;
}

.editable-content:focus {
    outline: 2px solid rgba(66, 153, 225, 0.8);
    outline-offset: 2px;
    background-color: rgba(66, 153, 225, 0.05);
}

/* Block overlay should not block editable content */
.editable-block .block-overlay {
    pointer-events: none !important; /* Don't block clicks on editable content */
}

/* Nested blocks */
.editable-block-nested .editable-content {
    cursor: text !important;
}

/* Allow text selection in editable content */
.editable-content * {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
}

/* Ensure editable elements are always clickable */
[contenteditable="true"] {
    cursor: text !important;
    pointer-events: auto !important;
}



.form-group {
    margin-bottom: 15px;
}

.form-control {
    display: block;
    position: relative;
    box-sizing: border-box;
    float: left;
    width: 100%;
    margin-bottom: 15px;
    height: 32px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;

}
.input-sm {
    height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}
select.input-sm {
    height: 30px;
    line-height: 30px;
}
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
input {
    line-height: normal;
}
label {
    font-weight: 400;
    color: #5e5e5e;
    font-size: 0.8em;
}
label {
    display: inline-block;
    max-width: 100%;
   
}