/* Custom Sort Dropdown Styles - Matches existing theme */

.custom-sort-container {
    position: relative;
    display: inline-block;
}

.custom-sort-button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 140px; /* Match typical select width */
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    position: relative;
}

.custom-sort-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.custom-sort-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.custom-sort-button::after {
    content: '▼';
    font-size: 12px;
    margin-left: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.custom-sort-button[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.custom-sort-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #81b9f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    list-style: none;
    padding: 4px 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    display: block !important;
}

.custom-sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-sort-option {
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.custom-sort-option:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Scrollbar for menu */
.custom-sort-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-sort-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.custom-sort-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .custom-sort-button {
        padding: 12px;
        font-size: 16px;
        min-height: 48px;
        min-width: 160px;
    }
    
    .custom-sort-menu {
        right: auto;
        left: 0;
        min-width: 160px;
    }
    
    .custom-sort-option {
        padding: 12px;
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-sort-button:focus,
    .custom-sort-option:focus {
        outline: 2px solid #000;
        outline-offset: 1px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .custom-sort-button::after,
    .custom-sort-menu {
        transition: none;
    }
}
