#editor table button,
.data-cell button {
    cursor: pointer;
    padding: 0;
    border: none;
    display: flex;
    width: 100%;
    background: transparent;
}

/* Sticky first column */
#editor {
    position: relative;
    overflow-x: auto;
}

#editor table thead th:first-child,
#editor table tbody td:first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: white;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

#editor table thead th:first-child {
    z-index: 11;
}

#editor table thead th:first-child img,
#editor table tbody td:first-child img {
    max-width: 100%;
    height: auto;
}

td img {
    max-width: 150px;
}

.data-cell {
    padding: 12px 16px;
    border-left: 4px solid;
    border-left-color: currentcolor;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 0;
    position: relative;
}

.data-cell.good {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.data-cell.bad {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
}

.data-cell.neutral {
    border-left-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.data-cell .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cell-label {
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
}

.cell-description {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.8;
}

.null-value {
    font-style: italic;
}

.cell-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cell-icon img {
    max-width: 20px;
}

.data-cell.bad .cell-icon {
    background: rgba(245, 158, 11, 0.2);
}

.data-cell.good .cell-icon {
    background: rgba(16, 185, 129, 0.2);
}

.data-cell.neutral .cell-icon {
    background: rgba(37, 99, 235, 0.2);
}

.data-cell button .cell-contents {
    display: flex;
    align-items: start;
    gap: 2px;
    flex-direction: column;
}

.result-row-cell {
    min-height: 100px;
}

/* Pill/Tag Styles */

:root {
    /* Button Variables */
    --btn-transition: all 0.2s ease-in-out;

    /* Pill Variables */
    --pill-radius: 12px;
    --pill-padding: 4px 10px;
    --pill-info: #e8f4fd;
    --pill-info-text: #0178ff;
}

.pill {
    display: inline-block;
    padding: var(--pill-padding);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--pill-radius);
    border: none;
    background: var(--pill-info);
    color: var(--pill-info-text);
}

/* Interactive pill variations */
.pill-interactive {
    cursor: pointer;
    transition: var(--btn-transition);
    text-decoration: none;
    user-select: none;
}

.pill-interactive:hover {
    filter: brightness(0.95);
}


/** Expandable Picker Styles **/

/* Focus styles for accessibility */
.expandable-option:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

.expandable-option:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .expandable-option {
        border-width: 3px;
    }

    .expandable-option.selected {
        border-color: #000;
        background: #fff;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .expandable-option,
    .option-details,
    .expand-indicator {
        transition: none;
    }

    .expandable-option.expanded .expand-indicator {
        transform: none;
    }
}

/* Expandable Cards */
.expandable-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expandable-option {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.expandable-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.expandable-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

pre code {
    display: block;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

.option-header {
    padding: 1.5rem;
    display: flex;
    justify-content: between;
    align-items: center;
    background: white;
    cursor: pointer;
}

.expandable-option.selected .option-header {
    background: #eff6ff;
}

.option-main-info h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.option-main-info p {
    color: #64748b;
    font-size: 0.9rem;
}

.expand-indicator {
    font-size: 1.2rem;
    color: #64748b;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.expandable-option.expanded .expand-indicator {
    transform: rotate(180deg);
}

.option-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.expandable-option.expanded .option-details {
    max-height: 1000px;
}

.details-content {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/** SEARCH SELECT **/

.search-select {
    position: relative;
}

.search-select .dropdown-toggle {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-select .dropdown-toggle::after {
    margin-left: auto;
}

.search-select-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
}

.search-select .dropdown-menu {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.search-select-placeholder {
    margin-right: 7px;
}

.search-select-search {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.search-select-item {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.search-select-item:hover {
    background-color: #f8f9fa;
}

.search-select-item.active {
    background-color: #0d6efd;
    color: white;
}

.search-select-loading {
    color: #6c757d;
    text-align: center;
    padding: 1rem;
}

.search-select-error {
    color: #dc3545;
    text-align: center;
    padding: 1rem;
}

.search-select-no-results {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.search-select-min-chars {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
