.modern-select {
    position: relative;
    width: 100%;
    margin: 16px 0;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--bs-border-radius);
    padding: 9px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
    position: relative;
}

.select-trigger:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select-trigger.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.select-value {
    flex: 1;
    color: #374151;
    font-size: 1rem;
}

.select-value.modern_placeholder {
    color: var(--bs-body-color);
}

.select-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: #6b7280;
}

.select-arrow.open {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    margin-top: 4px;
}

.select-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-search {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.select-search input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.select-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.select-options {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    display: flex;
    align-items: center;
    position: relative;
}

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

.select-option.selected {
    background-color: #6366f1;
    color: white;
}

.select-option.highlighted {
    background-color: #eef2ff;
}

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

.option-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-select .select-value {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .select-dropdown {
        position: fixed;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        transform: translateY(100%);
    }

    .select-dropdown.open {
        transform: translateY(0);
    }

    .select-option {
        padding: 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .select-search input {
        padding: 12px;
        font-size: 16px;
    }

    .select-trigger {
        padding: 16px;
        font-size: 16px;
    }
}

/* Overlay for mobile */
.select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.select-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 769px) {
    .select-overlay {
        display: none;
    }
}

.no-results {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}
