/* Deck Builder — floating cell editor styles */

#sb-cell-editor {
    width: 200px;  /* default, overridden by JS based on cell size */
    position: relative;
    overflow: visible;
    font-family: var(--mantine-font-family);
    font-size: 14px;
}

.sb-editor-body {
    width: 100%;
    max-height: 320px;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Arrow pointing at the active cell */
.sb-editor-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    margin-left: -6px;
}
.sb-editor-arrow.above {
    bottom: -6px;
}
.sb-editor-arrow.below {
    top: -6px;
}
[data-mantine-color-scheme="dark"] .sb-editor-arrow.above {
    border-top: 6px solid var(--mantine-color-dark-4);
}
[data-mantine-color-scheme="dark"] .sb-editor-arrow.below {
    border-bottom: 6px solid var(--mantine-color-dark-4);
}
[data-mantine-color-scheme="light"] .sb-editor-arrow.above {
    border-top: 6px solid var(--mantine-color-gray-3);
}
[data-mantine-color-scheme="light"] .sb-editor-arrow.below {
    border-bottom: 6px solid var(--mantine-color-gray-3);
}

/* Theme-aware backgrounds */
[data-mantine-color-scheme="dark"] .sb-editor-body {
    background: var(--mantine-color-dark-7);
    border: 1px solid var(--mantine-color-dark-4);
    color: var(--mantine-color-dark-0);
}
[data-mantine-color-scheme="light"] .sb-editor-body {
    background: var(--mantine-color-white);
    border: 1px solid var(--mantine-color-gray-3);
    color: var(--mantine-color-dark-9);
}

.sb-editor-search {
    border: none;
    outline: none;
    padding: 8px 10px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: inherit;
    border-bottom: 1px solid;
}

[data-mantine-color-scheme="dark"] .sb-editor-search {
    border-bottom-color: var(--mantine-color-dark-4);
}
[data-mantine-color-scheme="dark"] .sb-editor-search::placeholder {
    color: var(--mantine-color-dark-2);
}
[data-mantine-color-scheme="light"] .sb-editor-search {
    border-bottom-color: var(--mantine-color-gray-3);
}
[data-mantine-color-scheme="light"] .sb-editor-search::placeholder {
    color: var(--mantine-color-gray-5);
}

.sb-editor-options {
    overflow-y: auto;
    flex: 1;
    max-height: 260px;
    padding: 3px 0;
    scrollbar-width: thin;
}
.sb-editor-options::-webkit-scrollbar {
    width: 6px;
}
.sb-editor-options::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 3px;
}
.sb-editor-options::-webkit-scrollbar-track {
    background: transparent;
}

.sb-editor-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.1s;
}

[data-mantine-color-scheme="dark"] .sb-editor-option:hover,
[data-mantine-color-scheme="dark"] .sb-editor-option.active {
    background: var(--mantine-color-dark-5);
}
[data-mantine-color-scheme="light"] .sb-editor-option:hover,
[data-mantine-color-scheme="light"] .sb-editor-option.active {
    background: var(--mantine-color-gray-1);
}

.sb-editor-option.selected {
    font-weight: 600;
}

.sb-editor-option img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.sb-editor-option .emoji {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sb-editor-option .label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-editor-no-results {
    padding: 10px;
    text-align: center;
    opacity: 0.5;
    font-size: 11px;
}
