// ============================================================================
// Elements | Button | Switch
// ============================================================================

@use "../../dev" as *;
@use "../../variables" as *;

@use "../soul_type" as *;

// ============================================================================
// Custom Select Dropdown
// ============================================================================

/// The custom select container must be positioned relative
/// @group Custom Select
.custom-select {
    position: relative;
    font-family: Arial;
}

/// Hide the original SELECT element
/// @group Custom Select
.custom-select select {
    display: none;
}

/// Style the selected item
/// @group Custom Select
.select-selected {
    background-color: DodgerBlue;
}

/// Style the arrow inside the select element
/// @group Custom Select
.select-selected:after {
    position: absolute;
    content: "";
    top: q(14);
    right: q(10);
    width: 0;
    height: 0;
    border: q(6) solid transparent;
    border-color: var(--color_surface_primary) transparent transparent
        transparent;
}

/// Point the arrow upwards when the select box is open (active)
/// @group Custom Select
.select-selected.select-arrow-active:after {
    border-color: transparent transparent var(--color_surface_primary)
        transparent;
    top: q(8);
}

/// Style the items (options), including the selected item
/// @group Custom Select
.select-items div,
.select-selected {
    color: var(--color_surface_primary) fff;
    padding: q(8) q(16);
    border: q(1) solid transparent;
    border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent;
    cursor: pointer;
}

/// Style for the options (items) in the dropdown
/// @group Custom Select
.select-items {
    position: absolute;
    background-color: DodgerBlue;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
}

/// Hide the items when the select box is closed
/// @group Custom Select
.select-hide {
    display: none;
}

/// Hover state for the items and style for the selected item
/// @group Custom Select
.select-items div:hover,
.same-as-selected {
    background-color: rgba(0, 0, 0, 0.1);
}
