/* Unified ListView Selection Style
   This stylesheet provides consistent styles for all ListView components in CartaNova
*/

/* Basic container styles */
.common-listview {
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    /* background-color and background-image removed */
    overflow-y: auto; /* Show vertical scrollbar when needed */
    overflow-x: hidden; /* Hide horizontal scrollbar */
    width: 100%;
    max-height: none; /* Remove any height restrictions */
}

/* Allow the Prompts component listview to grow beyond the fixed height */
.prompts-panel .common-listview {
    max-height: none;
}

/* Item styling */
.common-listview .rz-listbox-item {
    height: 40px; /* Fixed height for each item */
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* Maintain the item height in the Prompts component but allow for more items */
.prompts-panel .common-listview .rz-listbox-item {
    height: 40px; /* Keep consistent item height */
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s, color 0.2s;
}

.common-listview .rz-listbox-item:last-child {
    border-bottom: none;
}

/* Hover effect */
.common-listview .rz-listbox-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

/* Selected state */
.common-listview .rz-listbox-item.rz-state-highlight,
.common-listview .rz-state-highlight,
.common-listview .rz-listbox-item.rz-selected {
    background-color: rgba(83, 175, 49, 0.2) !important;
    color: var(--text-color, #333) !important;
    font-weight: 500;
    border-left: 3px solid #53AF31 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Focus state */
.common-listview .rz-listbox-item:focus,
.common-listview .rz-listbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(83, 175, 49, 0.25);
}

/* Disabled state */
.common-listview .rz-listbox-item.rz-state-disabled {
    opacity: 0.6;
    background-color: #f5f5f5;
}

/* Empty state */
.common-listview .rz-listbox-empty-message {
    padding: 10px;
    color: #777;
    font-style: italic;
    text-align: center;
}

/* Dark mode support */
[data-theme='dark'] .common-listview {
    /* background-color and background-image removed */
    border-color: #444;
}

[data-theme='dark'] .common-listview .rz-listbox-item {
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .common-listview .rz-listbox-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .common-listview .rz-listbox-item.rz-state-highlight,
[data-theme='dark'] .common-listview .rz-state-highlight,
[data-theme='dark'] .common-listview .rz-listbox-item.rz-selected {
    background-color: rgba(95, 184, 58, 0.25) !important;
    color: #ffffff !important;
    border-left-color: #5fb83a !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme='dark'] .common-listview .rz-listbox-item.rz-state-disabled {
    background-color: #333;
}

[data-theme='dark'] .common-listview .rz-listbox-empty-message {
    color: #999;
}

/* Standard HTML select elements styling to match Radzen ListBox */
select.common-select {
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    background-color: var(--panel-bg, white);
    background-image: linear-gradient(to bottom, rgba(250, 250, 250, 0.05), rgba(0, 0, 0, 0.05));
    background-size: 100% 100%;
    padding: 8px 12px;
    width: 100%;
    color: var(--text-color, #333);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: auto; /* Keep native dropdown arrow */
}

select.common-select:hover {
    border-color: rgba(83, 175, 49, 0.5);
}

select.common-select:focus {
    border-color: #53AF31;
    box-shadow: 0 0 0 2px rgba(83, 175, 49, 0.25);
}

select.common-select option {
    padding: 8px 12px;
    background-color: var(--panel-bg, white);
    color: var(--text-color, #333);
}

select.common-select option:checked {
    background-color: rgba(83, 175, 49, 0.2);
    font-weight: 500;
}

/* Dark mode support for select */
[data-theme='dark'] select.common-select {
    background-color: #2a2a2a;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.15));
    border-color: #444;
    color: #e0e0e0;
}

[data-theme='dark'] select.common-select option {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

[data-theme='dark'] select.common-select option:checked {
    background-color: rgba(95, 184, 58, 0.25);
}