/* Enhanced Custom Select Dropdown Styles */
.custom-select {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.custom-select-toggle {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(37, 68, 227, 0.2);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,250,255,0.9));
    backdrop-filter: blur(10px);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(37, 68, 227, 0.1);
    min-height: 48px;
}

.custom-select-toggle:focus {
    outline: none;
    border-color: #2544E3;
    box-shadow: 0 0 0 3px rgba(37, 68, 227, 0.15), 0 4px 12px rgba(37, 68, 227, 0.2);
    background: linear-gradient(135deg, rgba(255,255,255,1), rgba(248,250,255,1));
}

.custom-select-toggle:hover {
    border-color: #2544E3;
    box-shadow: 0 4px 12px rgba(37, 68, 227, 0.15);
    transform: translateY(-1px);
}

.custom-select-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2544E3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 8px;
}

.custom-select.open .custom-select-toggle::after {
    transform: rotate(180deg);
    border-top-color: #1e37b8;
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,255,0.95));
    backdrop-filter: blur(15px);
    border: 2px solid rgba(37, 68, 227, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(37, 68, 227, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 68, 227, 0.3) transparent;
}

.custom-select-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-select-menu::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-menu::-webkit-scrollbar-thumb {
    background: rgba(37, 68, 227, 0.3);
    border-radius: 3px;
}

.custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 68, 227, 0.5);
}

.custom-select.open .custom-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-option {
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(37, 68, 227, 0.08);
    position: relative;
    overflow: hidden;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 68, 227, 0.05), transparent);
    transition: left 0.5s ease;
}

.custom-select-option:hover::before {
    left: 100%;
}

.custom-select-option:hover {
    background: linear-gradient(135deg, rgba(37, 68, 227, 0.08), rgba(37, 68, 227, 0.05));
    transform: translateX(2px);
    padding-left: 20px;
}

.custom-select-option.selected {
    background: linear-gradient(135deg, rgba(37, 68, 227, 0.15), rgba(37, 68, 227, 0.12));
    color: #2544E3;
    font-weight: 600;
    border-left: 4px solid #2544E3;
    padding-left: 20px;
}

.custom-select-option.selected::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #2544E3;
    font-weight: bold;
    font-size: 16px;
}

.custom-select-option .option-icon {
    margin-right: 10px;
    color: #2544E3;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.custom-select-option:hover .option-icon {
    transform: scale(1.1);
}

.custom-select-option .option-label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.custom-select-option .option-description {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
    margin-top: 2px;
}

/* Enhanced focus states */
.custom-select-option:focus {
    outline: 2px solid #2544E3;
    outline-offset: -2px;
}

/* Loading state */
.custom-select.loading .custom-select-toggle {
    opacity: 0.7;
    pointer-events: none;
}

.custom-select.loading .custom-select-toggle::after {
    border-top-color: #6c757d;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.custom-select.error .custom-select-toggle {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Success state */
.custom-select.success .custom-select-toggle {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

/* Hidden original select */
.custom-select select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-select-menu {
        max-height: 200px;
        border-radius: 8px;
    }

    .custom-select-option {
        padding: 12px 14px;
        font-size: 14px;
    }

    .custom-select-toggle {
        padding: 10px 14px;
        min-height: 44px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-select-toggle {
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(45, 45, 45, 0.9));
        border-color: rgba(37, 68, 227, 0.4);
        color: #ffffff;
    }

    .custom-select-menu {
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(45, 45, 45, 0.95));
        border-color: rgba(37, 68, 227, 0.4);
    }

    .custom-select-option .option-label {
        color: #ffffff;
    }

    .custom-select-option .option-description {
        color: #adb5bd;
    }
}