/* ==================== AUTOCOMPLETE EQUIPMENT SELECTOR (UNIFIED) ==================== */

.equipment-section {
    transition: opacity 0.3s ease-in-out;
}

.equipment-selector {
    margin-bottom: 0.75rem;
}

.equipment-selector label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

/* Autocomplete wrapper */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

/* Unified input field (search + manual) */
.equipment-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.equipment-input:focus {
    border-color: #0077be;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 119, 190, 0.1);
    border-radius: 4px 4px 0 0;
}

.equipment-input::placeholder {
    color: #999;
    opacity: 0.8;
}

/* Suggestions dropdown */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #0077be;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: none;
}

.autocomplete-suggestion {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover {
    background-color: #f5f9fc;
}

.autocomplete-suggestion .inventory-star {
    color: #ff9800;
    font-size: 0.85rem;
    margin-right: 0.3rem;
}

/* Inventory items at top with subtle highlight */
.autocomplete-suggestion:has(.inventory-star) {
    background-color: #fffbf0;
    font-weight: 500;
}

.autocomplete-suggestion:has(.inventory-star):hover {
    background-color: #fff4d9;
}

/* Unit hint for automatic conversions (lb/kg, m/ft) */
.unit-hint {
    display: block;
    margin-top: 0.3rem;
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .equipment-selector {
        margin-bottom: 0.6rem;
    }

    .equipment-selector label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .equipment-input {
        font-size: 0.85rem;
        padding: 0.5rem 0.7rem;
    }

    .autocomplete-suggestions {
        max-height: 180px;
    }

    .autocomplete-suggestion {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .unit-hint {
        font-size: 0.75rem;
    }
}

/* Hide equipment sections when not active (Spinning vs Fly toggle) */
.equipment-section[style*="display: none"] {
    display: none !important;
}

/* Scrollbar styling for suggestions */
.autocomplete-suggestions::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}