/* wwwroot/css/CustomDropdown.css */

/* Container for the custom dropdown */
.cf-custom-dropdown-container {
    position: relative;
    display: inline-block;
    align-items: center;
    width: 100%;
    max-width: 340px;
    font-family: 'Montserrat', sans-serif;
}

/* The dropdown with options section */
.cf-dropdown-options-subsidiary{
    position: absolute;
    top: 40px;
    left: 59%;
    background-color: white;
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 200px; /* Limit height */
    overflow-y: auto;  /* Enable vertical scrolling */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.cf-dropdown-options{
    position: absolute;
    top: 40px;
    left: 54%;
    width: 30%;
    background-color: white;
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 200px; /* Limit height */
    overflow-y: auto;  /* Enable vertical scrolling */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.cf-dropdown-options-sector{
    position: absolute;
    top: 40px;
    left: 54%;
    background-color: white;
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.cf-dropdown-select{
    padding: 0.75rem 1rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: #006DB2;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-dropdown-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.cf-dropdown-select:hover {
    background-color: #f0f0f0;
}

/* The visible part of the dropdown (button-like appearance) */
.cf-custom-dropdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0.8rem;
    color: white;
    font-family: 'Montserrat', sans-serif;
    line-height: 60px;
    width: 340px;
    letter-spacing: 0%;
    cursor: pointer;
}

/* Label on the left */
.cf-dropdown-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

/* Selected value and arrow on the right */
.cf-dropdown-selected {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-radius: 25px;
    height: 32px;
    width: 120px;
    padding: 0.3rem 0.8rem;
    color: #006DB2;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 18px;
    position: relative;
}

.cf-dropdown-selected span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  max-width: calc(100% - 32px);
}

/* Downward arrow */
.cf-dropdown-arrow {
    margin-left: 0.5rem;
    color: #006DB2;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    max-width: 16px;
    flex-shrink: 0;
    font-weight: bold;
}

/* The actual select element (hidden but functional) */
.cf-custom-dropdown-container select.cf-dropdown-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Hide the default select appearance */
    cursor: pointer;
}

/* Style the dropdown options (visible when the select is interacted with) */
.cf-custom-dropdown-container select.cf-dropdown-select:focus,
.cf-custom-dropdown-container select.cf-dropdown-select:hover {
    outline: none;
}

/* Style the dropdown options */
.cf-custom-dropdown-container select.cf-dropdown-select option {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #333;
    background-color: white;
    padding: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cf-custom-dropdown-container {
        max-width: 100%;
    }

    .cf-custom-dropdown {
        font-size: 14px;
        padding: 0.4rem 0.8rem;
    }

    .cf-dropdown-selected {
        font-size: 14px;
        padding: 0.2rem 0.6rem;
    }

    .cf-dropdown-arrow {
        width: 14px !important;
        height: 14px !important;
        min-width: 14px;
        max-width: 14px;
        flex-shrink: 0;
    }
}

.single-dropdown {
    background-color: #4db6ac !important;
    justify-content: center !important;
}

.dual-dropdown {
    justify-content: space-evenly !important;
}

@media (max-width: 768px) {
    .dual-dropdown .col-md-6,
    .single-dropdown .col-md-6 {
        max-width: 100%;
    }
}