#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>

typedef NS_ENUM(NSInteger, TransportMode) {
    TransportModeAuto, TransportModeBus, TransportModeTruck
};
typedef NS_ENUM(NSInteger, AlertLevel) {
    AlertLevelNone, AlertLevelImportant, AlertLevelFull
};

@class BusViewController;
@class SettingsViewController;

@interface MapViewController : UIViewController <CLLocationManagerDelegate>
@property (nonatomic, strong) MKMapView *mapView;
@property (nonatomic, strong) CLLocationManager *locationManager;
@property (nonatomic, weak) BusViewController *busVC;

// Navigation state
@property (nonatomic, strong) MKRoute *currentRoute;
@property (nonatomic, strong) NSArray<MKRouteStep *> *routeSteps;
@property (nonatomic) NSInteger currentStepIndex;
@property (nonatomic) BOOL isNavigating;
@property (nonatomic) CLLocationDistance distanceRemaining;
@property (nonatomic) NSTimeInterval etaSeconds;

// Camera settings
@property (nonatomic) CGFloat cameraAltitude;
@property (nonatomic) CGFloat cameraPitch;
@property (nonatomic) CGFloat cameraOffset;
@property (nonatomic) CGFloat cameraHeadingOffset;

// UI opacity
@property (nonatomic) CGFloat menuOpacity;

// Bus stops
@property (nonatomic, strong) NSMutableSet<NSString *> *busStopsFetched;
@property (nonatomic) BOOL pendingBusFetch;

// Buttons
@property (nonatomic, strong) UIButton *searchButton;
@property (nonatomic, strong) UIButton *mapButton;
@property (nonatomic, strong) UIButton *trackingButton;
@property (nonatomic, strong) UIButton *settingsButton;
@property (nonatomic, strong) UIButton *modalitaButton;
@property (nonatomic, strong) UIButton *compassButton;
@property (nonatomic, readonly) BOOL searchActive;
@property (nonatomic) BOOL busForceHidden;

- (void)openSettings;
- (void)settingsDidClose;
- (void)applyCameraSettings;
- (void)applyArrowTransform;
- (void)applyMenuOpacity;
- (void)showBusView:(BOOL)show fullScreen:(BOOL)full;
- (void)applyBusStopsVisibility;
@end
