/* Studio-Elf Editor */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

.sbc-editor-container {
    padding: 0.5rem;
    background-color: var(--bs-body-color);
}

.btn-bookshelf-group-sm > .btn, .btn-sm {
    --bs-btn-padding-y: 0.25rem;
    --bs-btn-padding-x: 0.5rem;
    --bs-btn-font-size: 1rem;
    --bs-btn-border-radius: var(--bs-border-radius-sm);
}

.vr {
    display: inline-block;
    align-self: stretch;
    width: var(--bs-border-width);
    min-height: 1em;
    background-color: var(--bs-border-color);
    /*         opacity: .25;
     */
}

.sbc-editor {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 300px;
    min-height: 300px;
    border: 1px solid var(--bs-border-color);
    outline-color: transparent;
    resize: vertical;
    overflow: hidden;
}

.sbc-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.25rem;
}

    .sbc-editor-toolbar .sbc-separator-vertical {
        height: auto
    }

.sbc-editor-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
    outline: none;
    overflow: auto;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

    .sbc-editor-content ul,
    .sbc-editor-content ol,
    .sbc-editor-content li {
        margin: unset;
        padding: unset;
        font-size: unset;
    }

    .sbc-editor-content ul,
    .sbc-editor-content ol {
        margin-left: 1rem;
    }

    .sbc-editor-content table {
        border: 2px solid var(--bs-border-color);
        border-collapse: collapse;
    }

        .sbc-editor-content table th,
        .sbc-editor-content table td {
            border: 1px solid var(--bs-border-color);
            padding: 8px;
        }

/* Monaco Editor Container */
.monaco-editor-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Ensure Monaco editor resizes with container */
.monaco-editor {
    width: 100% !important;
    height: 100% !important;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    /*padding: 0.25rem;*/
    border-radius: 0.375rem;
    background-color: rgba(0, 0, 0, 0.03);
}

    /* Optional: Add a subtle visual separator between sections */
    .toolbar-section:not(:last-child)::after {
        content: "";
        height: 1.5rem;
        width: 1px;
        background-color: rgba(0, 0, 0, 0.1);
        margin-left: 0.25rem;
    }
.color-grid-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    min-width: 150px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.color-picker {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
}

.color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .color-swatch:hover {
        transform: scale(1.2);
        box-shadow: 0 0 0 2px var(--bs-primary);
    }

.sbc-editor-toolbar {
    position: relative;
    z-index: 10; /* Higher than content */
}

.color-grid-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000; /* High z-index */
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    min-width: 150px;
}

.sbc-editor-content {
    z-index: 1; /* Lower than toolbar and pickers */
}
/* Modal Styles */
.sbc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.sbc-modal-dialog {
    max-width: 500px;
    width: 70%;
    margin: 0 auto;
}

.sbc-modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.sbc-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.sbc-modal-footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 0.75rem;
}
/* Table Builder Styles */
.table-grid-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.table-grid {
    display: inline-block;
    border: 1px solid #ccc;
    background: #fff;
    padding: 4px;
}
.table-grid-row {
    display: flex;
}

.table-cell {
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    margin: 1px;
    background: #f9f9f9;
    cursor: pointer;
}

    .table-cell.selected {
        background: #4a90e2;
        border-color: #357ab7;
    }

.table-grid-info {
    margin-top: 4px;
    font-size: 12px;
    text-align: center;
}

