// SCSS variables for easy customization
$primary-color: #fff;
$secondary-color: #f0f0f0;
$border-color: #ccc;
$text-color: #333;
$secondary-text-color: #555;
$shadow-color: rgba(0, 0, 0, 0.1);
$dropdown-width: 200px;
$transition-speed: 0.2s;

// Hides the original <select> element
.custom-dropdown-js {
    display: none !important;
}

// Main container for the custom dropdown
.custom-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: top;
    font-family: sans-serif;
    font-size: 14px;
    color: $text-color;
    width: $dropdown-width;

    // The button that displays the selected value and toggles the menu
    &-button {
        background-color: $primary-color;
        border: 1px solid $border-color;
        padding: 8px 15px;
        border-radius: 5px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color $transition-speed, box-shadow $transition-speed;

        // &:hover {
        //     background-color: $secondary-color;
        // }

        // Styles for the SVG arrow icon inside the button
        .arrow-icon {
            transition: transform $transition-speed;
        }
    }

    // The dropdown menu that holds all the options
    &-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        border: 1px solid $border-color;
        border-top: none;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 4px 6px $shadow-color;
        z-index: 100;
        max-height: 200px;
        overflow-y: auto;
        list-style-type: none;
        padding: 0;
        margin: 0;
        display: none; // Initially hidden

        // Styles for each individual option item
        .custom-dropdown-item {
            padding: 10px 15px;
            color: $secondary-text-color;
            cursor: pointer;
            transition: background-color $transition-speed;

            &:hover,
            &.active {
                background-color: $secondary-color;
                color: #000;
            }

            // Style for the currently selected item
            &[data-selected="true"] {
                background-color: #e6f7ff;
                font-weight: bold;
            }
        }
    }
}