/**
 * Quick Client Searchable Select Styles
 * 
 * Modern searchable dropdown styling
 */

/* Container */
.searchable-select-container {
    position: relative;
    width: 100%;
}

/* Search Input */
.searchable-select-input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.searchable-select-input:focus {
    border-color: #4A90E2;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.searchable-select-input::-webkit-input-placeholder {
    color: #6c757d;
    opacity: 1;
}

.searchable-select-input::-moz-placeholder {
    color: #6c757d;
    opacity: 1;
}

.searchable-select-input:-ms-input-placeholder {
    color: #6c757d;
    opacity: 1;
}

.searchable-select-input::-ms-input-placeholder {
    color: #6c757d;
    opacity: 1;
}

.searchable-select-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Dropdown */
.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow: hidden;
}

/* Options Container */
.searchable-select-options {
    max-height: 298px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar Styling */
.searchable-select-options::-webkit-scrollbar {
    width: 8px;
}

.searchable-select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.searchable-select-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.searchable-select-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Option Items */
.searchable-select-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    text-align: left;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.searchable-select-option:last-child {
    border-bottom: none;
}

.searchable-select-option:hover {
    background-color: #f8f9fa;
}

.searchable-select-option.highlighted {
    background-color: #e3f2fd;
    color: #1976d2;
}

.searchable-select-option.selected {
    background-color: #4A90E2;
    color: #fff;
}

.searchable-select-option.selected:hover {
    background-color: #357ABD;
}

/* No Results Message */
.searchable-select-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Disabled State */
.searchable-select-container.disabled .searchable-select-input {
    background-color: #e9ecef;
    opacity: 1;
    cursor: not-allowed;
}

/* Error State */
.searchable-select-container.error .searchable-select-input {
    border-color: #dc3545;
}

.searchable-select-container.error .searchable-select-input:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Success State */
.searchable-select-container.success .searchable-select-input {
    border-color: #28a745;
}

.searchable-select-container.success .searchable-select-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Loading State */
.searchable-select-container.loading .searchable-select-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%234A90E2' d='M10 3a7 7 0 100 14 7 7 0 000-14zm0 12a5 5 0 110-10 5 5 0 010 10z' opacity='.25'/%3E%3Cpath fill='%234A90E2' d='M10 3a7 7 0 017 7h2a9 9 0 00-9-9v2z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-size: 20px;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .searchable-select-input {
        background-color: #2b2b2b;
        border-color: #444;
        color: #fff;
    }
    
    .searchable-select-dropdown {
        background-color: #2b2b2b;
        border-color: #444;
    }
    
    .searchable-select-option {
        color: #fff;
        border-bottom-color: #444;
    }
    
    .searchable-select-option:hover {
        background-color: #3a3a3a;
    }
    
    .searchable-select-option.highlighted {
        background-color: #1a4d7a;
        color: #fff;
    }
    
    .searchable-select-option.selected {
        background-color: #4A90E2;
        color: #fff;
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .searchable-select-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .searchable-select-dropdown {
        max-height: 250px;
    }
    
    .searchable-select-options {
        max-height: 248px;
    }
}