﻿.custom-dropdown {
    position: relative;
    width: 100%;
    font-family: sans-serif;
    user-select: none;
}

.selected-option {
    border: 1px solid #005B7F;
    border-radius: 6px;
    padding: 9px;
    color: #5e5e5e;
    background-color: #fff;
    cursor: pointer;
    position: relative;
}

    .selected-option::after {
        content: "▾";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        pointer-events: none;
    }

.custom-dropdown.open .selected-option::after {
    content: "▴";
}

.dropdown-options {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #005B7F;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    position: absolute;
    width: 100%;
    display: none;
}

.custom-dropdown.open .dropdown-options {
    display: block;
}

.dropdown-options li {
    padding: 10px;
    cursor: pointer;
    color: #444;
}

    .dropdown-options li:hover {
        background-color: #f0f0f0;
    }

/* Scrollbar styling */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 3px;
}

    .dropdown-options::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }

.dropdown-options::-webkit-scrollbar-button {
    display: none;
}

.dropdown-options::-webkit-scrollbar-track {
    background-color: transparent;
}

/* Remove bottom radius from selected box */
.custom-dropdown.open .selected-option {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

/* Remove top radius from dropdown list */
.custom-dropdown.open .dropdown-options {
    border-radius: 0 0 6px 6px !important;
    margin-top: -1px; /* prevent double border line */
    border-top: none;
}

/* Responsive */
@media (max-width: 768px) {
    .custom-dropdown {
        max-width: 100%;
    }

    .selected-option {
        padding: 15px;
        border-radius: 10px;
    }

    .dropdown-options {
        border: 1px solid #005B7F !important;
        margin-top: -1px;
    }
}

/* Disabled state */
.custom-dropdown.disabled {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Search box styling merged --- */
.custom-dropdown.open .dropdown-search {
    display: block;
    /*border: 1px solid #005B7F;*/
    border-bottom: none;
    border-top: none;
}

.custom-dropdown .dropdown-search {
    display: none;
    padding: 0;
    border: none;
    background: #fff;
}

    .custom-dropdown .dropdown-search input {
        width: 100%;
        padding: 10px; /* same as li padding */
        border: none;
        outline: none;
        box-sizing: border-box;
        font-family: inherit;
        font-size: inherit;
        color: #444;
        background: #fff;
        box-sizing: border-box;
    }

        .custom-dropdown .dropdown-search input:focus {
            background-color: white; /* same as li:hover */
        }

/*.custom-dropdown.open .dropdown-search {
    border-bottom: 1px solid #eee;*/ /* subtle divider */
/*}*/

.dropdown-options .dropdown-search {
    padding: 0;
    cursor: default; /* not clickable */
}


.custom-dropdown .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px; /* adjust as needed */
    overflow-y: auto;
    background: #fff;
    /*border: 1px solid #ccc;*/
    padding: 0;
    margin: 0;
    list-style: none;
    z-index: 100;
}

    .custom-dropdown .dropdown-options li.dropdown-search {
        position: sticky;
        top: 0;
        background: #f9f9f9; /* same as dropdown background */
        z-index: 10; /* keep above other items */
        padding: 4px 12px;
        border-bottom: 1px solid #ddd; /* optional separator */
    }

        .custom-dropdown .dropdown-options li.dropdown-search input {
            width: 100%;
            border: none;
            outline: none;
            background: transparent;
            font-size: 14px;
            padding: 4px 0;
            box-sizing: border-box;
        }

.dropdown-options li.highlight {
    background-color: #e6f3ff;
    /*outline: 2px solid #007bff;*/
    border:none;
    outline:none;
}