#pragma once

class SdCard {
public:
    static SdCard& instance();
    bool init();
    bool isMounted() const { return mounted_; }
    bool isUsbMscActive() const { return usbMscActive_; }

    // Enable USB Mass Storage mode (unmounts SD from ESP, exposes via USB)
    // Returns true if successful. Requires reboot to return to normal mode.
    bool enableUsbMsc();

    static constexpr const char* MOUNT_POINT = "/sdcard";

private:
    SdCard() = default;
    ~SdCard() = default;
    SdCard(const SdCard&) = delete;
    SdCard& operator=(const SdCard&) = delete;

    bool mounted_ = false;
    bool usbMscActive_ = false;
};
