/* SearchableSelect Component Styles */
/* Matches standard Bootstrap select dropdown styling */

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select.open {
    z-index: 1001;
}

.searchable-select-input {
    position: relative;
    cursor: pointer;
}

.searchable-select-display {
    display: flex;
    align-items: center;
    padding-right: 2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #fff !important;
    cursor: default;
}

.searchable-select-display-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-display .text-muted {
    color: #6c757d;
}

/* Input when dropdown is open */
.searchable-select input.form-control {
    padding-right: 2rem;
    background-color: #fff !important;
}

.searchable-select-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #495057;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.searchable-select-icon i.rotate {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 600px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.2rem 0.2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    margin-top: -1px;
}

.searchable-select.open .searchable-select-input .form-control {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #ced4da;
    box-shadow: none;
}

.searchable-select-items {
    padding: 0;
}

.searchable-select-item {
    cursor: pointer;
    display: block;
    color: #212529;
    background-color: #fff;
    transition: background-color 0.1s ease, color 0.1s ease;
    border: none;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

/* Hover and keyboard highlight */
.searchable-select-item:hover,
.searchable-select-item.highlighted {
    background-color: #fd7e14;
    color: #fff;
}

/* Selected item */
.searchable-select-item.selected {
    background-color: #fd7e14;
    color: #fff;
}

.searchable-select-item.selected:hover,
.searchable-select-item.selected.highlighted {
    background-color: #e96b02;
    color: #fff;
}

/* Clear selection item */
.searchable-select-item.clear-item {
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.searchable-select-item.clear-item:hover,
.searchable-select-item.clear-item.highlighted {
    background-color: #f8f9fa;
    color: #495057;
}

/* Empty state */
.searchable-select-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Scrollbar styling */
.searchable-select-dropdown::-webkit-scrollbar {
    width: 5px;
}

.searchable-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.searchable-select-dropdown::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

/* Disabled state */
.searchable-select.disabled .searchable-select-input {
    cursor: not-allowed;
    opacity: 0.65;
    background-color: #e9ecef;
}

.searchable-select.disabled .form-control {
    background-color: #e9ecef !important;
    cursor: not-allowed;
}

.searchable-select.disabled .searchable-select-display {
    background-color: #e9ecef !important;
}

/* ============================================
   SIZE VARIATIONS
   ============================================ */

/* MINI Size */
.searchable-select-mini .searchable-select-display,
.searchable-select-mini input.form-control {
    height: 22px !important;
    min-height: 22px !important;
    padding: 0.1rem 1.5rem 0.1rem 0.25rem !important;
    font-size: 0.68rem !important;
    line-height: 1.2;
}

.searchable-select-mini .searchable-select-icon {
    right: 0.3rem;
}

.searchable-select-mini .searchable-select-icon i {
    font-size: 0.55rem;
}

.searchable-select-mini .searchable-select-dropdown {
    max-height: 150px;
}

.searchable-select-mini .searchable-select-item {
    padding: 0.2rem 0.35rem;
    font-size: 0.68rem;
    line-height: 1.2;
}

.searchable-select-mini .searchable-select-item.clear-item {
    padding: 0.15rem 0.35rem;
    font-size: 0.65rem;
}

.searchable-select-mini .searchable-select-empty {
    padding: 0.35rem;
    font-size: 0.65rem;
}

/* COMPACT Size */
.searchable-select-compact .searchable-select-display,
.searchable-select-compact input.form-control {
    height: 26px !important;
    min-height: 26px !important;
    padding: 0.15rem 1.75rem 0.15rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.3;
}

.searchable-select-compact .searchable-select-icon {
    right: 0.4rem;
}

.searchable-select-compact .searchable-select-icon i {
    font-size: 0.6rem;
}

.searchable-select-compact .searchable-select-dropdown {
    max-height: 180px;
}

.searchable-select-compact .searchable-select-item {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.searchable-select-compact .searchable-select-item.clear-item {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

.searchable-select-compact .searchable-select-empty {
    padding: 0.4rem;
    font-size: 0.7rem;
}

/* NORMAL Size (default) */
.searchable-select-normal .searchable-select-display,
.searchable-select-normal input.form-control {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0.3rem 2rem 0.3rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.4;
}

.searchable-select-normal .searchable-select-icon {
    right: 0.6rem;
}

.searchable-select-normal .searchable-select-icon i {
    font-size: 0.75rem;
}

.searchable-select-normal .searchable-select-dropdown {
    max-height: 220px;
}

.searchable-select-normal .searchable-select-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.searchable-select-normal .searchable-select-item.clear-item {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.searchable-select-normal .searchable-select-empty {
    padding: 0.6rem;
    font-size: 0.8rem;
}

/* BIG Size */
.searchable-select-big .searchable-select-display,
.searchable-select-big input.form-control {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5;
}

.searchable-select-big .searchable-select-icon {
    right: 0.75rem;
}

.searchable-select-big .searchable-select-icon i {
    font-size: 0.9rem;
}

.searchable-select-big .searchable-select-dropdown {
    max-height: 280px;
}

.searchable-select-big .searchable-select-item {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

.searchable-select-big .searchable-select-item.clear-item {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.searchable-select-big .searchable-select-empty {
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* ============================================
   STYLED INPUT COMPONENT
   Consistent styling for inputs matching SearchableSelect sizes
   ============================================ */

.styled-input {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.styled-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.25);
}

.styled-input.disabled,
.styled-input:disabled {
    background-color: #e9ecef !important;
    cursor: not-allowed;
    opacity: 0.65;
}

.styled-input.is-invalid {
    border-color: #dc3545;
}

.styled-input.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25);
}

/* MINI Size - matches SearchableSelect Mini */
.styled-input-mini {
    height: 22px !important;
    min-height: 22px !important;
    padding: 0.1rem 0.25rem !important;
    font-size: 0.68rem !important;
    line-height: 1.2;
}

/* COMPACT Size - matches SearchableSelect Compact */
.styled-input-compact {
    height: 26px !important;
    min-height: 26px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.3;
}

/* NORMAL Size - matches SearchableSelect Normal */
.styled-input-normal {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.4;
}

/* BIG Size - matches SearchableSelect Big */
.styled-input-big {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5;
}

/* Number input specific - hide spin buttons but keep functionality */
.styled-input[type="number"] {
    -moz-appearance: textfield;
}

.styled-input[type="number"]::-webkit-outer-spin-button,
.styled-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Show spin buttons when requested */
.styled-input[type="number"]:not(.no-spin) {
    -moz-appearance: auto;
}

.styled-input[type="number"]:not(.no-spin)::-webkit-outer-spin-button,
.styled-input[type="number"]:not(.no-spin)::-webkit-inner-spin-button {
    -webkit-appearance: auto;
}

/* Date/Time input specific adjustments */
.styled-input[type="date"],
.styled-input[type="datetime-local"],
.styled-input[type="time"] {
    padding-right: 0.25rem !important;
}

/* Placeholder styling */
.styled-input::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.styled-input-mini::placeholder {
    font-size: 0.65rem;
}

.styled-input-compact::placeholder {
    font-size: 0.7rem;
}

.styled-input-normal::placeholder {
    font-size: 0.8rem;
}

.styled-input-big::placeholder {
    font-size: 0.9rem;
}