## ADDED Requirements ### Requirement: Specialization priority list The system SHALL display all 14 specializations in a vertical ordered list. The position in the list represents the user's priority ranking, with position 1 being the highest priority. #### Scenario: Initial state - **WHEN** the application loads for the first time (no saved state) - **THEN** all 14 specializations are displayed in their default order (Banking, Brand Management, Corporate Finance, Entertainment Media and Technology, Entrepreneurship and Innovation, Finance, Financial Instruments and Markets, Global Business, Leadership and Change Management, Management, Marketing, Management of Technology and Operations, Sustainable Business and Innovation, Strategy) ### Requirement: Drag-and-drop reordering The system SHALL allow the user to reorder specializations by dragging items to a new position in the list. The drag interaction SHALL provide visual feedback showing the item being dragged and the target drop position. #### Scenario: Drag specialization to new position - **WHEN** the user drags the specialization at position 5 to position 1 - **THEN** the dragged specialization moves to position 1 and all items previously at positions 1-4 shift down by one #### Scenario: Visual drag feedback - **WHEN** the user begins dragging a specialization - **THEN** the dragged item is visually distinguished (e.g., elevated, semi-transparent) and the list shows a drop indicator at the target position ### Requirement: Keyboard reordering The system SHALL support keyboard-based reordering for accessibility. Users SHALL be able to select a specialization and move it up or down in the list using keyboard controls. #### Scenario: Move item up with keyboard - **WHEN** a specialization is focused and the user activates the move-up action - **THEN** the specialization swaps with the item above it #### Scenario: Move item at top boundary - **WHEN** the specialization at position 1 is focused and the user activates move-up - **THEN** nothing happens (item stays at position 1) ### Requirement: Optimization mode toggle The system SHALL display a toggle control with two options: Maximize Count and Priority Order. Exactly one mode SHALL be active at any time. The toggle SHALL display a brief description of each mode. #### Scenario: Switch to Priority Order - **WHEN** the user selects Priority Order mode (from Maximize Count) - **THEN** the toggle updates to show Priority Order as active and the optimization recalculates using the priority-order algorithm #### Scenario: Default mode - **WHEN** the application loads for the first time - **THEN** Maximize Count mode is active ### Requirement: Recalculation on rank change The system SHALL trigger a full optimization recalculation whenever the specialization ranking order changes. The recalculation SHALL use the current optimization mode and pinned courses. #### Scenario: Rank change triggers recalc - **WHEN** the user moves a specialization from position 3 to position 1 - **THEN** the optimization runs with the updated ranking and results reflect the new priority order ### Requirement: State persistence The system SHALL persist the specialization ranking order and selected optimization mode to localStorage. On subsequent loads, the system SHALL restore the saved ranking and mode. #### Scenario: Restore saved ranking - **WHEN** the user reloads the page after reordering specializations - **THEN** the specialization list appears in the previously saved order #### Scenario: Corrupted or missing localStorage - **WHEN** localStorage data is missing or unparseable - **THEN** the system falls back to default ranking and Maximize Count mode