/* ===== C-Select Component (Custom Select Dropdown) ===== */
/* Used globally - shell-ui.js converts all <select> elements to c-select */

.c-select { 
    position: relative; 
    display: inline-block; 
    width: 100%; 
}

.c-select__button {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: var(--input-padding-y, 0.75rem) var(--input-padding-x, 1rem);
    font-size: 0.95rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    min-height: var(--input-height, 44px);
    line-height: 1.2;
    box-sizing: border-box;
}

.c-select__button:hover { 
    background: #f8f9fa;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border-color: rgba(139, 195, 74, 0.3);
}

.c-select__button:active { 
    transform: translateY(0) scale(0.98); 
}

.c-select__button:focus-visible { 
    outline: 2px solid #8bc34a; 
    outline-offset: 2px; 
}

.c-select[aria-expanded='true'] .c-select__button {
    border-color: #8bc34a;
    box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.1), 0 3px 8px rgba(0,0,0,0.12);
    background: #f8f9fa;
}

.c-select__label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-select__caret { 
    opacity: 0.7; 
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: #8bc34a;
    font-weight: bold;
}

.c-select[aria-expanded='true'] .c-select__caret { 
    transform: rotate(180deg);
    color: #8bc34a;
}

.c-select__list {
    position: absolute;
    z-index: 3600;
    left: 0;
    right: 0;
    margin-top: 6px;
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    transform-origin: top center;
    transform: translateY(-6px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 195, 74, 0.4) transparent;
    width: 100%;
    box-sizing: border-box;
}

.c-select[aria-expanded='true'] .c-select__list {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.c-select__list::-webkit-scrollbar {
    width: 6px;
}

.c-select__list::-webkit-scrollbar-track {
    background: transparent;
}

.c-select__list::-webkit-scrollbar-thumb {
    background: rgba(139, 195, 74, 0.4);
    border-radius: 3px;
}

.c-select__list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 195, 74, 0.6);
}

.c-select__item { 
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.15s ease;
    color: #374151;
    position: relative;
    margin: 1px 0;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.c-select__item:hover { 
    background: #f1f5f9;
    color: #1e293b;
}

.c-select__item:active {
    background: #e2e8f0;
}

.c-select__item[aria-selected='true'] { 
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 500;
}

.c-select__item[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.c-select__item[data-active='true'] { 
    outline: 2px solid #8bc34a; 
    outline-offset: -2px; 
}

/* Dark mode for c-select */
html.dark-mode .c-select__button {
    background: #1e1e1e;
    color: #ecf0f1;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

html.dark-mode .c-select__button:hover { 
    background: #2a2a2a;
    border-color: rgba(139, 195, 74, 0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

html.dark-mode .c-select[aria-expanded='true'] .c-select__button {
    border-color: #8bc34a;
    box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.2), 0 3px 8px rgba(0,0,0,0.4);
    background: #2a2a2a;
}

html.dark-mode .c-select__caret {
    color: #8bc34a;
}

html.dark-mode .c-select[aria-expanded='true'] .c-select__caret {
    color: #8bc34a;
}

html.dark-mode .c-select__list {
    background-color: #2a2a2a;
    color: #ecf0f1;
    border-color: #404040;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

html.dark-mode .c-select__item {
    color: #ecf0f1;
}

html.dark-mode .c-select__item:hover {
    background: #1e1e1e;
    color: #ecf0f1;
}

html.dark-mode .c-select__item:active {
    background: #3a3a3a;
}

html.dark-mode .c-select__item[aria-selected='true'] {
    background: #1e1e1e;
    color: #ecf0f1;
}

html.dark-mode .c-select__item[data-active='true'] { 
    outline-color: #8bc34a; 
}

html.dark-mode .c-select__list::-webkit-scrollbar-thumb {
    background: rgba(139, 195, 74, 0.4);
}

html.dark-mode .c-select__list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 195, 74, 0.6);
}
