/**
 * Custom Dropdown Styles
 * Universal dropdown component styles
 */

.custom-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.custom-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .25rem 14px;
    border: 1px solid #d1d5db;
    background: white;
    color: #1f2937;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main, system-ui);
    font-size: .875rem;
}

.custom-dropdown-header:hover {
    border-color: #3b82f6;
}

.custom-dropdown-selected {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: 8px;
    transition: transform 0.2s ease;
    color: #6b7280;
}

.custom-dropdown-wrapper.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: fixed;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10010;
    display: block;
    max-height: 300px;
    overflow: hidden;
}

.custom-dropdown-search {
    width: 100%;
    padding: .25rem 14px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    color: #1f2937;
    font-family: var(--font-main, system-ui);
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}

.custom-dropdown-search:focus {
    border-bottom-color: #3b82f6;
}

.custom-dropdown-search::placeholder {
    color: #9ca3af;
}

.custom-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    background: white;
}

.custom-dropdown-list::-webkit-scrollbar {
    width: 8px;
}

.custom-dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-dropdown-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.custom-dropdown-group-label {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-family: var(--font-main, system-ui);
}

.custom-dropdown-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
    background: white;
    color: #1f2937;
    font-family: var(--font-main, system-ui);
    font-size: 14px;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: #f3f4f6;
}

.custom-dropdown-option.selected {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.custom-dropdown-option.hidden {
    display: none;
}

/* Dark mode support */
.dark-mode .custom-dropdown-header {
    background: #1a1a1a;
    border-color: #374151;
    color: #e5e7eb;
}

.dark-mode .custom-dropdown-menu {
    background: #1a1a1a;
    border-color: #374151;
}

.dark-mode .custom-dropdown-search {
    background: #1a1a1a;
    border-bottom-color: #374151;
    color: #e5e7eb;
}

.dark-mode .custom-dropdown-search:focus {
    border-bottom-color: #3b82f6;
}

.dark-mode .custom-dropdown-list {
    background: #1a1a1a;
}

.dark-mode .custom-dropdown-group-label {
    background: #2a2a2a;
    border-bottom-color: #374151;
    color: #9ca3af;
}

.dark-mode .custom-dropdown-option {
    background: #1a1a1a;
    border-bottom-color: #2a2a2a;
    color: #e5e7eb;
}

.dark-mode .custom-dropdown-option:hover {
    background: #2a2a2a;
}

.dark-mode .custom-dropdown-option.selected {
    background: #3b82f6;
    color: white;
}

/* Disabled state */
.custom-dropdown-wrapper.disabled .custom-dropdown-header {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
}

.custom-dropdown-wrapper.disabled .custom-dropdown-header:hover {
    border-color: #d1d5db;
}
