/* Modern Custom Dropdown Styles */

.custom-dropdown-wrapper {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.custom-dropdown {
    position: relative;
    font-size: 14px;
}

.custom-dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.custom-dropdown-selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(156, 136, 255, 0.1), rgba(184, 167, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-dropdown-selected:hover {
    border-color: #9c88ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(156, 136, 255, 0.3);
}

.custom-dropdown-selected:hover::before {
    opacity: 1;
}

.custom-dropdown.open .custom-dropdown-selected {
    border-color: #9c88ff;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(156, 136, 255, 0.4);
}

.selected-text {
    flex: 1;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.dropdown-icon {
    margin-left: 8px;
    color: #999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.custom-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
    color: #9c88ff;
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #9c88ff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(156, 136, 255, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100vw;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-search {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: none;
    border-bottom: 1px solid #2a2a2a;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.dropdown-search:focus {
    background: #151515;
    border-bottom-color: #9c88ff;
}

.dropdown-search::placeholder {
    color: #666;
}

.dropdown-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
}

/* Custom scrollbar */
.dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #9c88ff;
    border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #b8a7ff;
}

.dropdown-option {
    padding: 10px 14px;
    color: #ddd;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2px 0;
    position: relative;
    overflow: hidden;
    animation: optionFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes optionFadeIn {
    to {
        opacity: 1;
    }
}

.dropdown-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #9c88ff;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.dropdown-option:hover {
    background: linear-gradient(90deg, rgba(156, 136, 255, 0.15), rgba(156, 136, 255, 0.05));
    color: #fff;
    transform: translateX(4px);
}

.dropdown-option:hover::before {
    transform: scaleY(1);
}

.dropdown-option.selected {
    background: linear-gradient(90deg, rgba(156, 136, 255, 0.25), rgba(156, 136, 255, 0.1));
    color: #fff;
    font-weight: 600;
    padding-left: 18px;
}

.dropdown-option.selected::before {
    transform: scaleY(1);
    background: #9c88ff;
}

.dropdown-option.selected::after {
    content: '✓';
    position: absolute;
    right: 14px;
    color: #9c88ff;
    font-weight: bold;
    animation: checkMark 0.3s ease;
}

@keyframes checkMark {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-dropdown-wrapper {
        min-width: 160px;
        width: 100%;
    }
    
    .custom-dropdown-selected {
        padding: 10px 12px;
    }
    
    .dropdown-option {
        padding: 8px 12px;
    }
    
    .custom-dropdown-menu {
        max-width: calc(100vw - 2rem);
        left: 0;
        right: 0;
    }
    
    .dropdown-options {
        max-height: 200px;
    }
}

/* Loading state (optional) */
.custom-dropdown.loading .custom-dropdown-selected {
    pointer-events: none;
    opacity: 0.6;
}

.custom-dropdown.loading .dropdown-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus styles for accessibility */
.custom-dropdown-selected:focus-visible {
    outline: 2px solid #9c88ff;
    outline-offset: 2px;
}

.dropdown-option:focus-visible {
    outline: 2px solid #9c88ff;
    outline-offset: -2px;
}
