/**
 * Combobox Component Styles
 * Lightweight searchable dropdown for desktop.
 */

/* Wrapper */
.combobox {
    position: relative;
}

/* Input */
.combobox-input {
    padding-right: 2.5rem;
    cursor: text;
}

.combobox-input:focus {
    border-color: #F16523;
    box-shadow: 0 0 0 0.2rem rgba(241, 101, 35, 0.25);
}

/* Has value state */
.combobox--has-value .combobox-input {
    border-color: #27AE60;
    background-color: #f0fff4;
}

.combobox--has-value .combobox-input:focus {
    border-color: #F16523;
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(241, 101, 35, 0.25);
}

/* Chevron */
.combobox-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: auto;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* Clear button */
.combobox-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: color 0.15s, background-color 0.15s;
}

.combobox-clear:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* Dropdown */
.combobox-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.combobox-dropdown--open {
    display: block;
}

/* Section header (e.g. "Last selection") */
.combobox-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 4px;
}

/* Divider between sections */
.combobox-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Individual option */
.combobox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.95rem;
    color: #111827;
    cursor: pointer;
    transition: background-color 0.1s;
    line-height: 1.4;
}

.combobox-item:hover,
.combobox-item--active {
    background-color: #f3f4f6;
}

/* Selected state */
.combobox-item--selected {
    color: #F16523;
    font-weight: 500;
    background-color: #fff7ed;
}

.combobox-item--selected::after {
    content: '\2713';
    color: #F16523;
    font-weight: bold;
    margin-left: auto;
    padding-left: 12px;
}

.combobox-item--selected:hover,
.combobox-item--selected.combobox-item--active {
    background-color: #ffedd5;
}

/* Add new option */
.combobox-item--add {
    color: #F16523;
    font-weight: 500;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
}

.combobox-item--add:hover,
.combobox-item--add.combobox-item--active {
    background-color: #fff7ed;
}

.combobox-add-icon {
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 6px;
}

/* Empty state */
.combobox-empty {
    padding: 16px 12px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}
