/* custom-select.css */

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main, var(--text-primary, #fff));
    background: var(--glass-bg, var(--bg-card, #1a1f2e));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    min-height: 36px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.custom-select-trigger:hover {
    border-color: rgba(176, 141, 85, 0.5);
    /* subtle gold */
    background: rgba(255, 255, 255, 0.05);
    /* slightly lighter on hover */
}

.custom-select-trigger.open {
    border-color: var(--primary-gold, #b08d55);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: var(--shadow-sm);
}

.custom-select-trigger span {
    padding-right: 15px;
    word-break: break-word;
    display: inline-block;
    width: 100%;
}

.custom-select-trigger .arrow {
    position: relative;
    width: 10px;
    height: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.custom-select-trigger .arrow::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted, #a0aec0);
    border-bottom: 2px solid var(--text-muted, #a0aec0);
    transform: rotate(45deg);
    top: -2px;
    right: 0;
    transition: border-color 0.3s;
}

.custom-select-trigger.open .arrow {
    transform: rotate(-180deg);
    top: 2px;
}

.custom-select-trigger:hover .arrow::before {
    border-color: var(--primary-gold, #b08d55);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--primary-gold, #b08d55);
    border-top: none;
    background: var(--glass-bg, var(--bg-card, #1a1f2e));
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: opacity 0.2s, visibility 0.2s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    max-height: 350px;
    min-width: 100%;
    overflow-y: auto;
    z-index: 10100;
    /* Custom Scrollbar for the dropdown */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-gold) rgba(0, 0, 0, 0.2);
}

.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 14px 0;
}

.custom-options::-webkit-scrollbar-thumb {
    background-color: var(--primary-gold);
    border-radius: 32px;
}

.custom-select-trigger.open+.custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.custom-option {
    position: relative;
    display: block;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-main, var(--text-primary, #fff));
    cursor: pointer;
    transition: var(--transition-base);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    word-break: break-word;
}

.custom-option:last-of-type {
    border-bottom: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.custom-option:hover {
    background: rgba(176, 141, 85, 0.15);
    color: var(--text-main, var(--text-light, #fff));
    padding-left: 18px;
    /* slight indent on hover */
}

.custom-option.selected {
    color: var(--primary-gold, #b08d55);
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
}

/* Modifiers for specifically smaller or specifically themed usages */
.custom-select-wrapper.small .custom-select-trigger {
    padding: 4px 10px;
    font-size: 0.75rem;
    min-height: 28px;
    border-radius: 32px;
}

.custom-select-wrapper.small .custom-options {
    border-radius: 0 0 14px 14px;
}

.custom-select-wrapper.small .custom-option {
    padding: 6px 10px;
    font-size: 0.75rem;
}

/* ========================
   Mobile Responsive
   ======================== */
@media (max-width: 768px) {
    .custom-select-wrapper {
        min-width: 0;
        width: 100%;
    }
    .custom-select-trigger {
        padding: 8px 32px 8px 10px;
        font-size: 0.85rem;
    }
    .custom-options {
        min-width: 100%;
        max-width: calc(100vw - 40px);
        max-height: 250px;
    }
    .custom-option {
        padding: 8px 10px;
        font-size: 0.85rem;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .custom-select-trigger {
        padding: 7px 28px 7px 8px;
        font-size: 0.82rem;
    }
    .custom-select-trigger::after {
        right: 8px;
    }
    .custom-options {
        max-height: 200px;
    }
    .custom-option {
        padding: 7px 8px;
        font-size: 0.82rem;
    }
}