package dev.ulfrx.recipe.navigation

import androidx.navigation3.runtime.NavKey
import kotlinx.serialization.Serializable

/**
 * Type-safe Nav 3 destinations. Each leaf is a `@Serializable` `NavKey` so the
 * back stack can be persisted (Nav 3 uses kotlinx-serialization for restoration).
 *
 * Screens are grouped by tab so future detail destinations slot in without
 * polluting the top-level namespace — e.g. `Screen.Pantry.Detail(id)`. The
 * grouping is purely a code-organisation convenience; Nav 3 treats each leaf as
 * an independent NavKey regardless of nesting.
 *
 * The Recipes catalog has no own tab — it is reached via the shell-wide search
 * destination (see `ShellSearchViewModel`).
 */
sealed interface Screen : NavKey {
    sealed interface Home : Screen {
        @Serializable
        data object Root : Home
    }

    sealed interface Planner : Screen {
        @Serializable
        data object Home : Planner
    }

    sealed interface Pantry : Screen {
        @Serializable
        data object Home : Pantry
    }

    sealed interface Shopping : Screen {
        @Serializable
        data object Home : Shopping
    }
}
