/* Nice Select - Custom Dark Theme */
.nice-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    box-sizing: border-box;
    clear: both;
    cursor: pointer;
    display: block;
    float: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: normal;
    height: auto;
    line-height: 50px;
    outline: none;
    padding-left: 18px;
    padding-right: 30px;
    position: relative;
    text-align: left !important;
    transition: all 0.2s ease-in-out;
    user-select: none;
    white-space: nowrap;
    width: 100%;
    color: white;
}

.nice-select:hover {
    border-color: #f97316;
}

.nice-select:active,
.nice-select.open,
.nice-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Error state */
.nice-select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.nice-select.error:after {
    border-color: #ef4444;
}

.nice-select:after {
    border-bottom: 2px solid #9ca3af;
    border-right: 2px solid #9ca3af;
    content: "";
    display: block;
    height: 5px;
    margin-top: -4px;
    pointer-events: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform-origin: 66% 66%;
    transform: rotate(45deg);
    transition: all 0.15s ease-in-out;
    width: 5px;
}

.nice-select.open:after {
    transform: rotate(-135deg);
}

.nice-select.open .list {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.nice-select.disabled {
    border-color: #6b7280;
    color: #6b7280;
    pointer-events: none;
}

.nice-select.disabled:after {
    border-color: #6b7280;
}

.nice-select.wide {
    width: 100%;
}

.nice-select.wide .list {
    left: 0 !important;
    right: 0 !important;
}

.nice-select.right {
    float: right;
}

.nice-select.right .list {
    left: auto;
    right: 0;
}

.nice-select.small {
    font-size: 12px;
    height: 36px;
    line-height: 34px;
}

.nice-select.small:after {
    height: 4px;
    width: 4px;
}

.nice-select.small .option {
    line-height: 34px;
    min-height: 34px;
}

.nice-select .list {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    margin-top: 4px;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    transform-origin: 50% 0;
    transform: scale(0.75) translateY(-21px);
    transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
    z-index: 9;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.nice-select .list:hover .option:not(:hover) {
    background-color: transparent;
}

.nice-select .option {
    cursor: pointer;
    font-weight: 400;
    line-height: 40px;
    list-style: none;
    margin: 0;
    min-height: 40px;
    outline: none;
    padding-left: 18px;
    padding-right: 29px;
    text-align: left;
    transition: all 0.2s;
    color: white;
}

.nice-select .option:hover,
.nice-select .option.focus,
.nice-select .option.selected.focus {
    background-color: #374151;
}

.nice-select .option.selected {
    font-weight: bold;
    background-color: #f97316;
    color: white;
}

.nice-select .option.disabled {
    background-color: transparent;
    color: #6b7280;
    cursor: default;
}

.nice-select .optgroup {
    font-weight: bold;
    color: #9ca3af;
}

.nice-select .optgroup .option {
    background-color: #111827;
    color: white;
    padding-left: 30px;
}

/* Search functionality */
.nice-select .search-box {
    padding: 10px;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    background-color: #1f2937;
    z-index: 10;
}

.nice-select .search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    background-color: #111827;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.nice-select .search-box input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.nice-select .search-box input::placeholder {
    color: #9ca3af;
}

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

/* Loading state for search */
.nice-select .list.searching::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #374151;
    border-top: 2px solid #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar styling */
.nice-select .list::-webkit-scrollbar {
    width: 6px;
}

.nice-select .list::-webkit-scrollbar-track {
    background: #111827;
    border-radius: 3px;
}

.nice-select .list::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.nice-select .list::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Responsive */
@media (max-width: 768px) {
    .nice-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .nice-select .list {
        max-height: 250px;
    }
}

/* Dark theme specific adjustments */
.nice-select .option.highlighted {
    background-color: #f97316;
    color: white;
}

.nice-select .option.selected.highlighted {
    background-color: #ea580c;
}

/* Animation for dropdown */
@keyframes niceSelectDropdown {
    from {
        opacity: 0;
        transform: scale(0.75) translateY(-21px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.nice-select.open .list {
    animation: niceSelectDropdown 0.2s ease-out;
}

/* Custom styling for specific select types */
.nice-select.console-select .option i {
    margin-right: 8px;
}

.nice-select.state-select .option i {
    margin-right: 8px;
}

/* Enhanced focus states for accessibility */
.nice-select:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.nice-select .option:focus {
    background-color: #f97316;
    color: white;
    outline: none;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
    .nice-select .option {
        min-height: 44px; /* Better touch target */
        line-height: 44px;
    }

    .nice-select .search-box input {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
